Jump to content
  • entries
    943
  • comments
    5,899
  • views
    924,384

Linux Graphics


Josh

5,487 views

 Share

Compiling Leadwerks on Linux using the Code::Blocks IDE wasn't very hard. I particularly like the way Code::Blocks handles files in projects. Instead of creating your own "fake" file system in the project explorer, you just add the folder or files you want, and they are organized in a hierarchy that matches the file system.

 

I found the X windowing system to be extremely easy to work with. I've implemented windowed OpenGL contexts on Windows, OSX, iOS, and Android, and Linux was by far the most straightforward and simple.

 

One problem I ran into was that some Leadwerks classes conflict with Linux classes. Our Windows, Font, and Time classes match other classes in the Linux headers. I got around this by prefixing the classes with the "Leadwerks::" namespace, but some better solution should be found.

 

Upon my first attempt to run Leadwerks, all I got was a blue screen. I fell back from OpenGL 4 to OpenGL 2 and started playing with the OpenGL matrix commands (a relic of the fixed-function pipeline I never even use anymore). When I called glOrtho() with the context width and height, I produced an OpenGL INVALID_VALUE error. From there it wasn't hard to figure out the cause...

 

int Window::GetClientWidth) { return 0;/*don't forget to add this later*/ }

 

Once I implemented the missing function, everything worked fine. So I am pleased to unveil the very first screenshot in the history of the universe of Leadwerks running in Linux using OpenGL 4:

 

blogentry-1-0-18890400-1381022754_thumb.png

Behold, the green square of triumph!

 

Though this is a simple example, we have a full 3D engine with deferred lighting and a really unique terrain system, so I don't think it will be long now before we can start showing off some great Linux graphics. Linux has the fastest possible performance for 3D rendering, so it will be interesting to see what we can do with it.

  • Upvote 7
 Share

10 Comments


Recommended Comments

I'd like to set it up with LLVM and Valve's new debugger. The GCC debugger is unfortunately unusable.

Link to comment

I haven't had any problems using a Notify() (SDL_MessageBox) function in GNU C++ as debugging too. Usually debug code behaves differently then release code (often debug code does not show the error at all), so there is no point debugging something different than what is having the problem.

Link to comment

I wouldn't say so, because that's what most game developers do: they add a debug hug (which actually was also in LE2 built-in into Framewerk), so they can see the behaviour of different variables in difference scenarios and over longer time. Can't do that by looking at single-step debug code.

Link to comment

I know you like making absurd assertions, but they can be damaging to the reader who is unfamiliar with the subject and doesn't know any better.

Link to comment

If you do a google search on "how to debug games", the first answer is this:

http://en.wikipedia.org/wiki/Debug_menu

 

There are some really nice benefits of using a in-game debug menu:

1) You can debug the game even with rarely occuring bugs, when the remote user sends you a screenshot of the menu (or presses some button to send the error report to you).

2) You have the same debug menu on every platform, and don't need to setup complicated debuggers for mobile and other platforms.

3) You can be sure that you are debugging the same code which caused the error, and not some debug compiled version which lacks usually of all compiler optimizations and other settings which often prevent the bug to occur.

Link to comment

I think the user should only debug his own game code related bugs, and rest assured that the engine is bug free smile.png

 

Yes, for engine level debugging such LLVM debugger is better than gdb, but that's what unit tests are invented for also.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...