SDL Forum Index
SDL
Simple DirectMedia Layer Forums
Reply to topic
Can't get a GLES context on Tegra devices
EternalLands


Joined: 01 Dec 2016
Posts: 16
Reply with quote
I started porting my game on Android, using SDL2 and gl4es (https://github.com/ptitSeb/gl4es) which is a very nice library which will emulate a GL 1.x context on GLES.

In either case, everything works very well on most of the Android devices, except for Nexus 7 2012 (and possibly other Tegra ones), where it fails to create a suitable context. I don't have any Tegra device, so I can't test things directly, but I was wondering if there is anything obviously wrong with my settings:

(values for rgb are 8 for each)
Code:

   SDL_GL_SetAttribute( SDL_GL_RED_SIZE, rgb_size[0] );
   SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, rgb_size[1] );
   SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, rgb_size[2] );

   SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 0 );
   SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 24 );
   SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 8 );
   SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );

   el_gl_window = SDL_CreateWindow("Eternal Lands", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 1, 1, SDL_WINDOW_OPENGL|SDL_WINDOW_FULLSCREEN_DESKTOP|SDL_WINDOW_ALLOW_HIGHDPI);
   if(!el_gl_window)
       {
         LOG_ERROR("%s: %s\n", fail_opengl_mode, SDL_GetError());
         SDL_Quit();
         exit(1);
       }
View user's profileSend private messageVisit poster's website
EternalLands


Joined: 01 Dec 2016
Posts: 16
Reply with quote
oh, and I forgot to mention, I am trying to get a GLES 1.x context, I commented out the GLES 2 stuff in SDL
View user's profileSend private messageVisit poster's website
EternalLands


Joined: 01 Dec 2016
Posts: 16
Reply with quote
Well, it turns out it was the depth buffer. For some reason, at least some Tegra devices didn't like 24 bits. It works fine with 16 though.
View user's profileSend private messageVisit poster's website
Can't get a GLES context on Tegra devices
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic