mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-07 17:29:36 +00:00
togles: gamma fix, optimize texture convertation
This commit is contained in:
+22
-2
@@ -63,10 +63,16 @@ static void *l_egl = NULL;
|
||||
static void *l_gles = NULL;
|
||||
|
||||
typedef void *(*t_glGetProcAddress)( const char * );
|
||||
t_glGetProcAddress _glGetProcAddress;
|
||||
|
||||
typedef EGLBoolean (*t_eglBindAPI)(EGLenum api);
|
||||
typedef EGLBoolean (*t_eglInitialize)(EGLDisplay display, EGLint *major, EGLint *minor);
|
||||
typedef EGLDisplay (*t_eglGetDisplay)(NativeDisplayType native_display);
|
||||
typedef char const *(*t_eglQueryString)(EGLDisplay display, EGLint name);
|
||||
|
||||
t_eglBindAPI _eglBindAPI;
|
||||
t_glGetProcAddress _glGetProcAddress;
|
||||
t_eglInitialize _eglInitialize;
|
||||
t_eglGetDisplay _eglGetDisplay;
|
||||
t_eglQueryString _eglQueryString;
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -594,11 +600,25 @@ InitReturnVal_t CSDLMgr::Init()
|
||||
l_gles = dlopen("libGLESv3.so", RTLD_LAZY);
|
||||
|
||||
if( l_egl )
|
||||
{
|
||||
_glGetProcAddress = (t_glGetProcAddress)dlsym(l_egl, "eglGetProcAddress");
|
||||
}
|
||||
|
||||
SET_GL_ATTR(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
|
||||
SET_GL_ATTR(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
|
||||
SET_GL_ATTR(SDL_GL_CONTEXT_MINOR_VERSION, 0);
|
||||
|
||||
_eglInitialize = (t_eglInitialize)dlsym(l_egl, "eglInitialize");
|
||||
_eglGetDisplay = (t_eglGetDisplay)dlsym(l_egl, "eglGetDisplay");
|
||||
_eglQueryString = (t_eglQueryString)dlsym(l_egl, "eglQueryString");
|
||||
|
||||
if( _eglInitialize && _eglInitialize && _eglQueryString)
|
||||
{
|
||||
EGLDisplay display = _eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
if( _eglInitialize(display, NULL, NULL) != -1
|
||||
&& strstr(_eglQueryString(display, EGL_EXTENSIONS) ,"EGL_KHR_gl_colorspace") )
|
||||
SET_GL_ATTR(SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1)
|
||||
}
|
||||
#elif ANDROID
|
||||
bool m_bOGL = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user