|
|
|
@ -712,27 +712,73 @@ void GL_SwapBuffers()
@@ -712,27 +712,73 @@ void GL_SwapBuffers()
|
|
|
|
|
SDL_GL_SwapWindow( host.hWnd ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int GL_SetAttribute( int attr, int val ) |
|
|
|
|
{ |
|
|
|
|
switch( attr ) |
|
|
|
|
{ |
|
|
|
|
#define MAP_REF_API_ATTRIBUTE_TO_SDL( name ) case REF_##name: return SDL_GL_SetAttribute( SDL_##name, val ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_RED_SIZE ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_GREEN_SIZE ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_BLUE_SIZE ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_ALPHA_SIZE ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_DOUBLEBUFFER ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_DEPTH_SIZE ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_STENCIL_SIZE ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_MULTISAMPLEBUFFERS ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_MULTISAMPLESAMPLES ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_ACCELERATED_VISUAL ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_CONTEXT_MAJOR_VERSION ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_CONTEXT_MINOR_VERSION ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_CONTEXT_EGL ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_CONTEXT_FLAGS ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_SHARE_WITH_CURRENT_CONTEXT ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_FRAMEBUFFER_SRGB_CAPABLE ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_CONTEXT_RELEASE_BEHAVIOR ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_CONTEXT_RESET_NOTIFICATION ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_CONTEXT_NO_ERROR ); |
|
|
|
|
case REF_GL_CONTEXT_PROFILE_MASK: |
|
|
|
|
#ifdef SDL_HINT_OPENGL_ES_DRIVER |
|
|
|
|
if (val == REF_GL_CONTEXT_PROFILE_ES) |
|
|
|
|
SDL_SetHint(SDL_HINT_OPENGL_ES_DRIVER, "1"); |
|
|
|
|
#endif // SDL_HINT_OPENGL_ES_DRIVER
|
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
return SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, val ); |
|
|
|
|
#undef MAP_REF_API_ATTRIBUTE_TO_SDL |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return SDL_GL_SetAttribute( (SDL_GLattr)attr, val ); |
|
|
|
|
ASSERT( 0 ); |
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int GL_GetAttribute( int attr, int *val ) |
|
|
|
|
{ |
|
|
|
|
return SDL_GL_GetAttribute( (SDL_GLattr)attr, val ); |
|
|
|
|
switch( attr ) |
|
|
|
|
{ |
|
|
|
|
#define MAP_REF_API_ATTRIBUTE_TO_SDL( name ) case REF_##name: return SDL_GL_GetAttribute( SDL_##name, val ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_RED_SIZE ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_GREEN_SIZE ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_BLUE_SIZE ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_ALPHA_SIZE ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_DOUBLEBUFFER ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_DEPTH_SIZE ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_STENCIL_SIZE ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_MULTISAMPLEBUFFERS ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_MULTISAMPLESAMPLES ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_ACCELERATED_VISUAL ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_CONTEXT_MAJOR_VERSION ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_CONTEXT_MINOR_VERSION ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_CONTEXT_EGL ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_CONTEXT_FLAGS ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_SHARE_WITH_CURRENT_CONTEXT ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_FRAMEBUFFER_SRGB_CAPABLE ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_CONTEXT_RELEASE_BEHAVIOR ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_CONTEXT_RESET_NOTIFICATION ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_CONTEXT_NO_ERROR ); |
|
|
|
|
MAP_REF_API_ATTRIBUTE_TO_SDL( GL_CONTEXT_PROFILE_MASK ); |
|
|
|
|
#undef MAP_REF_API_ATTRIBUTE_TO_SDL |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ASSERT( 0 ); |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifndef EGL_LIB |
|
|
|
|