The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL2 and GLES 1 on the desktop
D B
Guest

Hi,

I had converted (or so I thought) my game (Bitfighter) to use GLES 1,
the subset of OpenGL 1 that it has traditionally used. I know it is
old and outdated and we have great plans to add an abstraction layer
for GLES 2. But in the meantime, I'd like to get GLES 1 to properly
work - apparently it doesn't work on some devices like RPi and ODROID,
and it just shows a black screen. It otherwise compiles just find
with SDL2.

In order to debug this, I've been compiling and linking the game with
SDL2 and libGLESv1_CM on my desktop Linux system (openSUSE 13.2
x86_64), which is part of the Mesa project providing GLES1 support on
the desktop. I launch the game using the standard SDL_CreateWindow()
and SDL_GL_CreateContext() calls. Doing this, even when linking to
the GLES1 libraries results in a glGetString() version of "3.0 Mesa
10.3.7" and the game shows a black screen.

I've traced the black screen down to glOrtho not working with the GL
context I have. Figuring I don't have an ES context I added this code
to explicitly try and grab one (before window creation):

SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);

But using this results in an SDL error of "Could not create GL context".

Is there a way to get a proper GLES 1 context on my desktop system so
I can further debug?

Thanks!
David
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org