Yeah, the immediate mode stuff is painful.? I actually ended up writing
my own renderer, because even trying to render a few tens of thousands
of elements with the SDL API was hurting my frame rate, and I’m running
on really good hardware.
Unfortunately, what I came up with would be rather difficult to implement
in SDL, because it involves a multimap and there’s no good library support
for that in plain C.? But it’s quite possible to add a lot of optimization to the
rendering system with a minimal amount of code if you have a good
multimap available.________________________________
From: Scott Percival
To: SDL Development List
Sent: Tuesday, August 28, 2012 6:35 PM
Subject: Re: [SDL] libSDL2.0 questions
Yep, that codebase looks like fixed-function GL with a heavy
sprinkling of immediate mode. Good luck, man!
It’s going to be a real wrench to rewrite most of that, so if you’re
going to go ahead and move from fixed-function to shaders, you might
as well make sure it’s done to the GL ES 2.0 spec. Remember that
desktop GL 2.0 will let you get away with murder, and you don’t want a
second uphill slog to port everything to mobile.
The latest hg of SDL2 shouldn’t have trouble creating a GL ES context
on the Pi, but when building you need to point out that the Broadcom
graphics libs and headers are ghetto’d off in /opt/vc. Try building
SDL2 again with the following:
…/configure CFLAGS="-I/opt/vc/include
-I/opt/vc/include/interface/vcos/pthreads" LDFLAGS="-L/opt/vc/lib"
Make sure that the “checking for OpenGL ES (EGL) support” test returns a yes.
I’ll have a stab at porting my ES-ready SDL app to the Raspberry Pi
later tonight and report back. I’m really hoping that the only
Pi-specific thing that needs to be added is a call to bcm_host_init().
It won’t be true, but hey! Hoping!
On Tue, Aug 28, 2012 at 1:06 PM, Nathaniel Stenzel wrote:
Ok. I am building using a Raspberry Pi at the moment. I see make files for
other things, but not this. It seems I need to link against source code in
/opt/vc/. This includes calling bcm_host_init() from bcm_host.h before
initializing the video so that I have OpenGL stuff available. Unfortunately,
I have always sucked at modifying makefiles and have no clue right now about
how to add this stuff to the search paths.
More info on that stuff here: http://elinux.org/RPi_VideoCore_APIs
The game I want to compile is called Eternal Lands. It plays on
Mac/Linux/Windows, but the game is hoping to expand to other devices and I
think that SDL2.0 will help with that. It uses a cmake build system. Source
can be looked at here: https://github.com/xaphier/Eternal-Lands
That Eternal Lands code link is specifically for the branch that the guy
that is working on the 3D rewrites is working in. He does have alot of work
ahead of him since the game does have a bunch of static functions and
OpenGL1.0 specific things that do not work with OpenGL2.0. I figured that I
could try to help him out some and help port it to the Raspberry Pi and then
work on helping port it to the Android operating system later. It is a big
project to say the least.
I suppose the first step is to get SDL2.0 to recognize the OpenGL ES 2.0
features that are on my Raspberry Pi. I imagine I should read this
README.porting file in the repository. Any further advice would be greatly
appreciated.
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org