Ingame "GUI" using SDL and SDL with OpenGL question

Hello (fellow) SDL developers/users,

Currently I’m programming several emulator related projects and at the
moment I only
have 1 issue to resolve and one feature I would like to implent :slight_smile:

First the issue. Based upon the test/testgl.c example source I’ve implented
OpenGL
in my projects so we can benefit from acceleration on several platforms. Yet
the OpenGL
implementation is a lot slower then my SDL rendering code (I’m talking 10% ~
20%),
and that’s on my AMD Athlon Classic 650, 512MB RAM and a nvidia Geforce
3Ti500
64MB videocard. On less speccy systems it gets even worse!

I’m a newbie on OpenGL programming but I think I’m lucky I got this far. I
know/think
that the problem resides in the conversion from my SDL_Surface buffer (where
my
graphics resides and which get’s updated every frame. The buffer is a size
of 240x160)
to my main OpenGL SDL_Surface. For people who are interested in my code, I
uploaded
it to :

http://sdlemu.ngemu.com/src/BoycaGL.cpp

Any help is appreciated. If I resolve this bug I can finally finalize my
SDLEmu library
which would be released under LGPL in the near future. (of course credits
for those
wo find/resolve this problem!)

Then my feature. I think that some people might know the DOS version of
CC64S
emulator (I don’t know if I wrote it correctly but it’s a C64 emu) which had
an in-emu
configuration interface for gfx, sound and diskimage switching. I would like
to implent
such a “GUI” using SDL because of it’s portability (Widget based gui’s seems
to harm
portability in my opinion and gives system dependant GUI code in my
projects).

Do people know if projects/libraries exists with such an in-game/in-emu
configuration
interface and which makes use of SDL? Any links or examples are appreciated!

Thanks in advance!

With kind regards,

Niels Wagenaar

Niels Wagenaar wrote:

Then my feature. I think that some people might know the DOS version of
CC64S
emulator (I don’t know if I wrote it correctly but it’s a C64 emu) which had
an in-emu
configuration interface for gfx, sound and diskimage switching. I would like
to implent
such a “GUI” using SDL because of it’s portability (Widget based gui’s seems
to harm
portability in my opinion and gives system dependant GUI code in my
projects).

Do people know if projects/libraries exists with such an in-game/in-emu
configuration
interface and which makes use of SDL? Any links or examples are appreciated!

Thanks in advance!

With kind regards,

Niels Wagenaar

I’m working on a gui for just this purpose, I have some widgets done and many test prgrams to try.
It’s in active development and should be good enough to get started with, even if it isn’t complete yet,
as I’m still adding more widget types…

But it is made to depend on you for the SDL event loops, and you control every aspect of the screen.
It also has OpenGL and plain SDL support (both using SDL of course), plus a nice flexible font system.

If you are interested grab http://jcatki.no-ip.org/files/JAI-1.0.0.tar.gz

(the version number is always 1.0.0 because I’m lazy, until the release is done, then I’ll start incrementing)
(I’ll anounce it here when it’s officially done, but meanwhile, people can use it…)
read the included READMEs and TODO for what I am doing…also look at the jai_test*.c programs.–
-==-
Jon Atkins
http://jonatkins.org/

First the issue. Based upon the test/testgl.c example source I’ve implented
OpenGL
in my projects so we can benefit from acceleration on several platforms. Yet
the OpenGL
implementation is a lot slower then my SDL rendering code (I’m talking 10% ~
20%),
and that’s on my AMD Athlon Classic 650, 512MB RAM and a nvidia Geforce
3Ti500
64MB videocard. On less speccy systems it gets even worse!

You’re loading the surface to an OpenGL texture just once, right?
It’s slower to continually upload an OpenGL texture than it is to use SDL’s
2D code on most platforms. However, if you can upload the texture once and
then reuse the texture id many times, that will be very fast.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

I think the best you can do when you have to change
the texture is to do a glTexSubImage2D on an existing
texture object (like reusing a surface).

Andrew

— Sam Lantinga wrote:> > First the issue. Based upon the test/testgl.c

example source I’ve implented

OpenGL
in my projects so we can benefit from acceleration
on several platforms. Yet
the OpenGL
implementation is a lot slower then my SDL
rendering code (I’m talking 10% ~
20%),
and that’s on my AMD Athlon Classic 650, 512MB RAM
and a nvidia Geforce
3Ti500
64MB videocard. On less speccy systems it gets
even worse!

You’re loading the surface to an OpenGL texture just
once, right?
It’s slower to continually upload an OpenGL texture
than it is to use SDL’s
2D code on most platforms. However, if you can
upload the texture once and
then reuse the texture id many times, that will be
very fast.

See ya,
-Sam Lantinga, Software Engineer, Blizzard
Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes