Building Leadwerks for Linux and SteamOS

Published October 06, 2013
Advertisement
[color=rgb(0,0,0)][font=arial]Compiling Leadwerks for 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.[/font][/color]

[color=rgb(0,0,0)][font=arial]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.[/font][/color]

[color=rgb(0,0,0)][font=arial]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.[/font][/color]

[color=rgb(0,0,0)][font=arial]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...[/font][/color]

[color=rgb(0,0,136)]int[/color] [color=rgb(102,0,102)]Window[/color][color=rgb(102,102,0)]::[/color][color=rgb(102,0,102)]GetClientWidth[/color][color=rgb(102,102,0)])[/color] [color=rgb(102,102,0)]{[/color] [color=rgb(0,0,136)]return[/color] [color=rgb(0,102,102)]0[/color][color=rgb(102,102,0)];[/color][color=rgb(136,0,0)]/*don't forget to add this later*/[/color] [color=rgb(102,102,0)]}[/color]
[color=rgb(0,0,0)][font=arial]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:[/font][/color]

blogentry-1-0-18890400-1381022754_thumb.png
[color=rgb(0,0,0)][font=arial]Behold, the green square of triumph![/font][/color]

[color=rgb(0,0,0)][font=arial]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.[/font][/color]
0 likes 2 comments

Comments

Shane C
I dub thee the Linux god!
October 08, 2013 01:48 AM
Josh Klint

I am but a man...a man on the path of the penguin..

October 08, 2013 02:58 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement