User avatar
hippie403
Posts: 32
Joined: Fri Aug 09, 2019 12:45 pm

Hardware 3D for old SDL1.2 program

Mon Sep 23, 2019 6:09 am

Just for a laugh I compiled an old SDL1.2 program I used to work on (OpenFly Flight Sim Toolkit engine) on a Pi running Raspbian Buster. Needed little work to get it compiling and running (just a few changes due to compilers being a bit more fussy these days). It does run but it looks like it is using Mesa software drivers. I was wondering how to get it using the Pi's OpenGL ES hardware support. I know this could be complex but a few pointers would help, I was mainly working on the simulation code not the Open GL graphics stuff. We used to run it on Windows and Linux back in the day on old graphics hardware like 3DFX Voodo 2 and Pentium 200.

User avatar
Gavinmc42
Posts: 4294
Joined: Wed Aug 28, 2013 3:31 am

Re: Hardware 3D for old SDL1.2 program

Mon Sep 23, 2019 7:18 am

FlightGear will run on Pi4's.
It uses OpenGL and it is based on OpenSceneGraph and a bunch of other dependencies.
OpenSceneGraph will build for Android too and use OpenGLES.
There is a Cessna in the OpenSceneGraph examples that works, even a version on fire ;)

Linux Air Combat Sim will build and run and then crash ;)
This is based on the GL-117 simulator.

Pi3D had some Python demo code with a Pitts Special.
Those are just the ones I have looked at.

While the Pi4 hardware is OpenGLES3.2 capable, currently the driver software is only around 3.0 with some 3.1 extensions
On Buster it is using the Mesa OpenGL driver.
Older VC4 Pi's are using OpenGLES2.1

Looking at SDL games the UI is normally done by the SDL code but the Graphics is OpenGLxx
Android games will be the closest to OpenGLES but most PC type ones are generally OpenGL.

Depending on your code it might just work.
I have compiled SDL2 code as well.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
hippie403
Posts: 32
Joined: Fri Aug 09, 2019 12:45 pm

Re: Hardware 3D for old SDL1.2 program

Tue Sep 24, 2019 12:35 am

I am such a Pi n00b, turns out I needed dtoverlay=vc4-fkms-v3d in /boot/config.txt to get Mesa to use the hardware driver. OpenFly is now running at 60fps on a simple FST project compared to 15fps with the software driver. It locks up after a while, I suspect it is leaking memory like a sieve but that is another story.

User avatar
Gavinmc42
Posts: 4294
Joined: Wed Aug 28, 2013 3:31 am

Re: Hardware 3D for old SDL1.2 program

Tue Sep 24, 2019 2:57 am

60fps :D
Yep fake kms at the moment, too messy to go into those reasons.
Screenshot please.

A lot of those older games were before OpenGL shaders came out in hardware.
The VC6 in the Pi4's have the new shaders, even compute shaders apparently.
The latest Mesa 19.3 I think has the 3.1 compute shaders now, dom't think I have seen a demo yet.
But there are shadertoys examples for the normal shaders.

For flight sims, terrain, water and clouds made in the shaders have got my attention.
WebGL shader demos are cool too.
Kodelife is a realtime shader editor, it just works in 32bit Buster and 64bit Gentoo64.
No idea how to use it yet, shaders are magic Harry Potter stuff.

How hard can the VC6 be pushed and what can be done with compute shaders?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “OpenGLES”