Home SwipEout – Python + OpenGL ES 2.0 On The N950 And N900

SwipEout – Python + OpenGL ES 2.0 On The N950 And N900

This articles from Thp On Maemo
Last weekend I’ve been toying around with Open GL ES 2.0 on the N950 after finding a nice Xlib-based Python example on the web for the N900. I modified the code a bit, replaced the Xlib code with a QGLWidget from QtOpenGL (via PySide), which makes the setup a lot easier and (apart from API differences of GL ES 2.0 and Desktop GL) allows me to test the prototype on my normal computer as well.
After I got the hang of it, I decided to come up with some fancy 90s-style hover racing game (only texturing, no lighting), or at least parts of it – right now, the small hovercraft just runs around the track and you can shift it left and right via the touchscreen and switching between normal and bird’s view by pressing any hardware key.
 
As for the GL ES bindings (this is the interesting/useful part to developers who want to access the GL ES 2.0 API from Python), I put together a naive header-to-ctypes binding generator for the GL ES 2.0 API which you can run on “gl2.h” from the Qt SDK’s Madde sysroot (too lazy to search for a working binding generator that surely exists somewhere out there already) – or just grab the generated “gles2.py” from the SwipEout source tarball. The result? Video it yourself.
 
You can grab the source code and miscellaneous files from the SwipEout website. The code was tested on the N900 and N950, you only need Python, PIL (python-imaging), PySide and the Open GL ES 2.0 libraries (libGLESv2.so) installed. Removing the PIL dependency and replacing it with Qt-based texture loading is left as an exercise for the reader. Enjoy 🙂
Source Thp On Maemo

About ReadWrite’s Editorial Process

The ReadWrite Editorial policy involves closely monitoring the tech industry for major developments, new product launches, AI breakthroughs, video game releases and other newsworthy events. Editors assign relevant stories to staff writers or freelance contributors with expertise in each particular topic area. Before publication, articles go through a rigorous round of editing for accuracy, clarity, and to ensure adherence to ReadWrite's style guidelines.

Get the biggest tech headlines of the day delivered to your inbox

    By signing up, you agree to our Terms and Privacy Policy. Unsubscribe anytime.

    Tech News

    Explore the latest in tech with our Tech News. We cut through the noise for concise, relevant updates, keeping you informed about the rapidly evolving tech landscape with curated content that separates signal from noise.

    In-Depth Tech Stories

    Explore tech impact in In-Depth Stories. Narrative data journalism offers comprehensive analyses, revealing stories behind data. Understand industry trends for a deeper perspective on tech's intricate relationships with society.

    Expert Reviews

    Empower decisions with Expert Reviews, merging industry expertise and insightful analysis. Delve into tech intricacies, get the best deals, and stay ahead with our trustworthy guide to navigating the ever-changing tech market.