Jump to content

codeape

Members
  • Posts

    183
  • Joined

  • Last visited

Posts posted by codeape

  1. My current Linux build ... you being Swede and all:

    Gigabyte GA-Z97-HD3 Motherboard - https://www.dustinhome.se/product/5010786253/ga-z97-hd3

    Intel Core i5 4690K / 3.5 GHz processor - https://www.dustinhome.se/product/5010791975/core-i5-4690k-35-ghz-processor

    16 Gb ram - Corsair XMS3 - https://www.dustinhome.se/product/5010639170/xms3

     

    I had a Asus Nvidia GTX 580 already so I used that as GFX card. I can also recommend this PC case if you want something that is easy to work with, is good ventilated and silent https://www.dustinhome.se/product/5010810959/define-r5 and this silent PSU https://www.dustinhome.se/product/5010752536/rm750. I got this to cool the CPU https://www.dustinhome.se/product/5010763755/cooling-freezer-i11

     

    It works well with Leadwerks, Ubuntu 14.04 LTS and the Nvidia proprietary driver.

    • Upvote 1
  2. Pretty good and inexpensive Blender introduction video tutorial series (51 episodes):

    http://store.steampowered.com/app/373020/

     

    Section 1 - Understanding the Interface.

    Chapter 01 - First encounters 5 mins

    Chapter 02 - Navigation 6 mins

    Chapter 03 - Layout Customizing 8 mins

    Chapter 04 - User Preference Changes 6 mins

    (Autodepth, Autoperspective, Addon - Layers, VBO’s.)

     

    Section 2 - 3D View.

    Chapter 01 - Menus, Modes and Display. 5 mins

    Chapter 02 - Pivot Point and 3d Manipulator 8 mins

    Chapter 03 - Layers and Snapping 7 mins

     

    Section 3 - Modeling

    Chapter 01 - Mesh Data, Object Data 7 mins

    Chapter 02 - Object Tools 7 mins

    Chapter 03 - Mesh Tools - Extrude 2 mins

    Chapter 04 - Mesh Tools - Bevel 1 min

    Chapter 05 - Mesh Tools - Subdivide 2 mins

    Chapter 06 - Mesh Tools - Working With Loops. 5 mins

    Chapter 07 - Mesh Tools - Vertex Connect 2 mins

    Chapter 08 - Mesh Tools - Inset. 2 mins

    Chapter 09 - Mesh Tools - Merging 2 mins

    Chapter 10 - Mesh Tools - Knife Tool 2 mins

     

    Section 4 - Modeling A Game Asset

    Chapter 01 - Ref Images & Traffic Cone Blockout 10 mins

    Chapter 02 - Traffic Cone Modeling 8 mins

    Chapter 03 - Normal Editing - Smooth/Hard Edges 5 mins

    Chapter 04 - High Res Traffic Cone 5 mins

    Chapter 05 - Camera Modeling 15 mins

    Chapter 06 - Modeling With Curves 7 mins

    Chapter 07 - Camera Modeling Finish 2 mins

    Chapter 08 - Removing NGons 4 mins

    Chapter 09 - Hi Res Lens And Ribbed Cable 6 mins

    Chapter 10 - Organizing And Naming Objects 3 mins

     

    Section 5 - UV’s.

    Chapter 01 - UV’s Overview 12 mins

    Chapter 02 - Mirror Modifier 5 mins

    Chapter 03 - UV Unwrapping The Base 7 mins

    Chapter 04 - UV Unwrapping The Cable 10 mins

    Chapter 05 - UV Unwrapping The Cone 9 mins

    Chapter 06 - UV Final Layout 8 mins

     

    Section 6 - Baking

    Chapter 01 - Baking Setup And Creating Images 4 mins

    Chapter 02 - Baking Ambient Occlusion 10 mins

    Chapter 03 - Baking Normal Maps 9 mins

    Chapter 04 - Creating The Base Color Materials 5 mins

    Chapter 05 - Baking The Base Color 2 mins

    Chapter 06 - Setting Up A Complete Material 3 mins

    Chapter 07 - Cord Baking And Multiple UV Sets 9 mins

    Chapter 08 - Baking The Camera Lens 7 mins

     

    Section 7 - 3D Painting

    Chapter 01 - 3D Painting Setup 6 mins

    Chapter 02 - Painting A Vertical Gradient 6 mins

    Chapter 03 - Multi Layered Painting 18 mins

    Chapter 04 - Worn Edges With Cavity Masking 13 mins

    Chapter 05 - Baking All Layers Down To 1. 7 mins

     

    Section 8 - Importing And Exporting

    Chapter 01 - Importing A TF2 Character 3 mins

    Chapter 02 - Rigging And Placing The Asset 2 mins

    Chapter 03 - LOD Creation 6 mins

    Chapter 04 - Exporting As OBJ 1 min

    Chapter 05 - Importing Into Team Fortress 2. 5 mins

    • Upvote 1
  3. Interesting. This is the code in Linux that handles the resize creation flag:

    	 if (Window::Resizable & style)
     {
    	 XSetStandardProperties(display, window->window, name, name, 0L, NULL, 0, NULL);
     }
     else
     {
    	 sizehints.flags = PMinSize | PMaxSize;
    	 sizehints.min_width = width;
    	 sizehints.min_height = height;
    	 sizehints.max_width = width;
    	 sizehints.max_height = height;
    	 XSetStandardProperties(display, window->window, name, name, 0L, NULL, 0, &sizehints);
     }

     

    The XSetStandardProperties function has been superseded by XSetWMProperties.

  4. Sorry for the late answer but I have been busy with my kids

     

    I can confirm that window->takeownership work. I have changed my code to this and I can now create a new window and get the old window destroyed:

     

       if (window->KeyHit(Key::R)) {
        window->takeownership = true;
        if (window->style == Leadwerks::Window::FullScreen) {
    	    System::Print("Go Resizable");
    	    window->Release();
    	    window = Leadwerks::Window::Create("test", 0, 0, 1024, 768, Leadwerks::Window::Resizable);
        } else {
    	    System::Print("Go FullScreen");
    	    window->Release();
    	    window = Leadwerks::Window::Create("test", 0, 0, 1920, 1200, Leadwerks::Window::FullScreen);
        }
        //Create a context
        context = Context::Create(window);
        window->HideMouse();
        window->SetMousePosition(context->GetWidth()/2,context->GetHeight()/2);
    }
    

     

    Thanks

  5. I want to be able to toggle between diffren windows styles (FullScreen and Resizable).

     

    For all examples I have created I have used a new project and only added the if (window->KeyHit(Key::R)) block and I create the window in App::Start() with Leadwerks::Window::Create("test", 0, 0, 1024, 768, Leadwerks::Window::Resizable);

     

    Example one. I can toggle from windowed mode to full screen mode but not back to windowed mode with this code:

     

     

    bool App::Loop()
    {
       //Close the window to end the program
       if (window->Closed()) return false;
    
       //Press escape to end freelook mode
       if (window->KeyHit(Key::Escape))
       {
           if (!freelookmode) return false;
           freelookmode=false;
           window->ShowMouse();
       }
    
       if (freelookmode)
       {
           //Keyboard movement
           float strafe = (window->KeyDown(Key:) - window->KeyDown(Key::A))*Leadwerks::Time::GetSpeed() * 0.05;
           float move = (window->KeyDown(Key::W) - window->KeyDown(Key::S))*Leadwerks::Time::GetSpeed() * 0.05;
           camera->Move(strafe,0,move);
    
           //Get the mouse movement
           float sx = context->GetWidth()/2;
           float sy = context->GetHeight()/2;
           Vec3 mouseposition = window->GetMousePosition();
           float dx = mouseposition.x - sx;
           float dy = mouseposition.y - sy;
    
           //Adjust and set the camera rotation
           camerarotation.x += dy / 10.0;
           camerarotation.y += dx / 10.0;
           camera->SetRotation(camerarotation);
    
           //Move the mouse to the center of the screen
           window->SetMousePosition(sx,sy);
       }
    
       if (window->KeyHit(Key::R)) {
        if (window->style == Leadwerks::Window::FullScreen) {
    	  System::Print("Go Resizable");
          window->Release();
    	  window = Leadwerks::Window::Create("test", 0, 0, 800, 600, Leadwerks::Window::Resizable);
        } else {
    	   System::Print("Go FullScreen");
    	   window->Release();
    	   window = Leadwerks::Window::Create("test", 0, 0, 1920, 1200, Leadwerks::Window::FullScreen);
        }
        //Create a context
           context = Context::Create(window);
        window->HideMouse();
        window->SetMousePosition(context->GetWidth()/2,context->GetHeight()/2);
       }
    
       Leadwerks::Time::Update();
       world->Update();
       world->Render();
       context->Sync(false);
    
       return true;
    }
    

     

    So when I hit R i get in to full screen but when I hit R again I do not get back to windowed mode. When I hit ESC twice I get back my desktop by exiting the application.

     

    Example 2. So to test what happens behind the sceens I changed the if (window->KeyHit(Key::R)) block to this:

     

       if (window->KeyHit(Key::R)) {
        if (window->style == Leadwerks::Window::Titlebar) {
    	    System::Print("Go Resizable");
    	    window->Release();
    	    window = Leadwerks::Window::Create("test", 0, 0, 1024, 768, Leadwerks::Window::Resizable);
        } else {
    	    System::Print("Go other size");
    	    window->Release();
    	    window = Leadwerks::Window::Create("test", 0, 0, 800, 600, Leadwerks::Window::Titlebar);
        }
        //Create a context
        context = Context::Create(window);
        window->HideMouse();
        window->SetMousePosition(context->GetWidth()/2,context->GetHeight()/2);
       }
    

     

    Everytime I hit R I get a new window but the old window is not removed (so I get a large amount os windows).

     

    What am I doing wrong? or is this a bug?

  6. I solved it with this little code change:

     

    window = Leadwerks::Window::Create("test", 0, 0, 1024, 768, Leadwerks::Window::Resizable);
    

     

    The key was setting the style argument of Window::Create() to Leadwerks::Window::Resizable. The Leadwerks C++ template code looks like this:

     

    Leadwerks::Window::Create("branch");
    

     

    The style argument defaults to Leadwerks::Window::Titlebar and that does apparently not play nice with SetLayout in Linux but works well in Windows.

  7. Ok I have done some more research.

     

    A god idea is to read this: http://www.hpc.unimelb.edu.au/nec/g1ae02e/appd.html, and clean out all obsolete stuff like XSetStandardProperties (Pre X11 legacy stuff).

     

    Also XMoveResizeWindow can sometimes be ignored and we end up with no-op: http://tronche.com/gui/x/xlib/window/XMoveResizewindow.html

     

    I think this is some good hints from SDL that can interpreted like this:

    // Apparently, if the X11 Window is set to a 'non-resizable' window, you cannot resize it using the
    // XResizeWindow, thus we must set the size hints to adjust the window size.
    XSizeHints *sizehints = XAllocSizeHints();
    long userhints;
    XGetWMNormalHints(display, data->xwindow, sizehints, &userhints);
    sizehints->min_width = sizehints->max_width = window->w;
    sizehints->min_height = sizehints->max_height = window->h;
    sizehints->flags |= PMinSize | PMaxSize;
    XSetWMNormalHints(display, data->xwindow, sizehints);
    XFree(sizehints);
    // WMs each have their little quirks with that. When you change the
    // size hints, they get a ConfigureNotify event with the
    // WM_NORMAL_SIZE_HINTS Atom. They all save the hints then, but they
    // dont all resize the window right away to enforce the new hints.
    // Some of them resize only after:
    // - A user-initiated move or resize
    // - A code-initiated move or resize
    // - Hiding & showing window (Unmap & map)
    // The following move & resize seems to help a lot of WMs that didn't
    // properly update after the hints were changed. We don't do a
    // hide/show, because there are supposedly subtle problems with doing so
    // and transitioning from windowed to fullscreen in Unity.
    XResizeWindow(display, data->xwindow, window->w, window->h);
    XMoveWindow(display, data->xwindow, window->x, window->y);
    XRaiseWindow(display, data->xwindow);
    

     

    Inspired by X11_SetWindowSize (https://hg.libsdl.org/SDL/file/3331d2f57704/src/video/x11/SDL_x11window.c#l831)

    The comments about Unity in that file is very interesting also since that is the only WM that Leadwerks support.

  8. This is the actual code for SetLayout:

     void Window::SetLayout(const int x, const int y, const int width, const int height)
    {
     XMoveResizeWindow(this->display,this->window,x,y,width,height);
    }

     

    Ok, so you probably need to call XSetWMNormalHints before you call XMoveResizewindow. This is because some window managers may redirect window configuration requests, but ignore the resulting events and pay property changes instead.

     

    Some more info ...

    Page 623 in this book: https://books.google.se/books?id=2uVfJj_4AZgC&printsec=frontcover&source=gbs_ge_summary_r&cad=0#v=onepage&q&f=false

    This man page: http://manpages.ubuntu.com/manpages/saucy/man3/XAllocSizeHints.3.html

    • Upvote 1
  9. I haven't specifically tried that yet but it was already clear that basically none of the windowing features work under Linux. Just takea look at the full screen situation that still doesn't fully work let alone all the other window flags.

    Mmmmm True.

     

    I forgot my specs.

     

    Linux dist:

    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 14.04.2 LTS
    Release:	 14.04
    Codename:	 trusty
    

     

    Graphics card:

    fglrxinfo
    display: :0 screen: 0
    OpenGL vendor string: Advanced Micro Devices, Inc.
    OpenGL renderer string: AMD Radeon HD 5700 Series
    OpenGL version string: 4.3.12798 Compatibility Profile Context 13.35.1005
    

     

    A question. Will this bug be fixed soon or something that will be included when you get in to fixing the Uniform buffers and FBOs mentioned in this blog post: http://www.leadwerks.com/werkspace/blog/1/entry-1427-34-recap-and-beyond/

×
×
  • Create New...