mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-07 17:29:36 +00:00
Merge branch 'master' into windows
This commit is contained in:
@@ -595,9 +595,13 @@ void GLMDisplayInfo::PopulateModes( void )
|
||||
// Add double of everything also - Retina proofing hopefully.
|
||||
m_modes->AddToTail( new GLMDisplayMode( w * 2, h * 2, 0 ) );
|
||||
}
|
||||
|
||||
m_modes->AddToTail( new GLMDisplayMode( w, w * ((float)m_info.m_displayPixelHeight/m_info.m_displayPixelWidth), 0 ) );
|
||||
}
|
||||
}
|
||||
|
||||
m_modes->AddToTail( new GLMDisplayMode( m_info.m_displayPixelWidth / 2, m_info.m_displayPixelHeight / 2, 0 ) );
|
||||
|
||||
m_modes->Sort( DisplayModeSortFunction );
|
||||
|
||||
// remove dupes.
|
||||
|
||||
@@ -206,7 +206,7 @@ GLMRendererInfo::GLMRendererInfo( GLMRendererInfoFields *info )
|
||||
kCGLPFADoubleBuffer, kCGLPFANoRecovery, kCGLPFAAccelerated,
|
||||
kCGLPFADepthSize, 0,
|
||||
kCGLPFAColorSize, 32,
|
||||
kCGLPFARendererID, info->m_rendererID,
|
||||
kCGLPFARendererID, (unsigned int)info->m_rendererID,
|
||||
0
|
||||
};
|
||||
|
||||
@@ -859,7 +859,7 @@ void GLMDisplayDB::PopulateRenderers( void )
|
||||
{
|
||||
// grab the OS version
|
||||
|
||||
long vMajor = 0; long vMinor = 0; long vMinorMinor = 0;
|
||||
SInt32 vMajor = 0; SInt32 vMinor = 0; SInt32 vMinorMinor = 0;
|
||||
|
||||
OSStatus gestalt_err = 0;
|
||||
gestalt_err = Gestalt(gestaltSystemVersionMajor, &vMajor);
|
||||
@@ -1374,7 +1374,7 @@ bool GLMDisplayDB::GetModeInfo( int rendererIndex, int displayIndex, int modeInd
|
||||
{
|
||||
int modeIndex=0;
|
||||
number = (CFNumberRef)CFDictionaryGetValue(curModeDict, kCGDisplayMode);
|
||||
CFNumberGetValue(number, kCFNumberLongType, &modeIndex);
|
||||
CFNumberGetValue(number, kCFNumberIntType, &modeIndex);
|
||||
|
||||
// grab the width and height, I am unclear on whether this is the displayed FB width or the display device width.
|
||||
int screenWidth=0;
|
||||
@@ -1382,11 +1382,11 @@ bool GLMDisplayDB::GetModeInfo( int rendererIndex, int displayIndex, int modeInd
|
||||
int refreshHz=0;
|
||||
|
||||
number = (CFNumberRef)CFDictionaryGetValue(curModeDict, kCGDisplayWidth);
|
||||
CFNumberGetValue(number, kCFNumberLongType, &screenWidth);
|
||||
CFNumberGetValue(number, kCFNumberIntType, &screenWidth);
|
||||
number = (CFNumberRef)CFDictionaryGetValue(curModeDict, kCGDisplayHeight);
|
||||
CFNumberGetValue(number, kCFNumberLongType, &screenHeight);
|
||||
CFNumberGetValue(number, kCFNumberIntType, &screenHeight);
|
||||
number = (CFNumberRef)CFDictionaryGetValue(curModeDict, kCGDisplayRefreshRate);
|
||||
CFNumberGetValue(number, kCFNumberLongType, &refreshHz);
|
||||
CFNumberGetValue(number, kCFNumberIntType, &refreshHz);
|
||||
|
||||
GLMPRINTF(( "-D- GLMDisplayDB::GetModeInfo sees mode-index=%d, width=%d, height=%d on CGID %08x (display index %d on rendererindex %d)",
|
||||
modeIndex,
|
||||
@@ -1574,7 +1574,7 @@ void GLMDisplayInfo::PopulateModes( void )
|
||||
|
||||
void GLMDisplayInfo::Dump( int which )
|
||||
{
|
||||
GLMPRINTF(("\n #%d: GLMDisplayInfo @ %08x, cg-id=%08x display-mask=%08x pixwidth=%d pixheight=%d", which, (int)this, m_info.m_cgDisplayID, m_info.m_glDisplayMask, m_info.m_displayPixelWidth, m_info.m_displayPixelHeight ));
|
||||
GLMPRINTF(("\n #%d: GLMDisplayInfo @ %08x, cg-id=%08x display-mask=%08x pixwidth=%d pixheight=%d", which, (int)(intp)this, m_info.m_cgDisplayID, m_info.m_glDisplayMask, m_info.m_displayPixelWidth, m_info.m_displayPixelHeight ));
|
||||
|
||||
FOR_EACH_VEC( *m_modes, i )
|
||||
{
|
||||
|
||||
+24
-2
@@ -19,7 +19,9 @@
|
||||
|
||||
#include "tier1/utllinkedlist.h"
|
||||
#include "tier1/convar.h"
|
||||
#ifdef TOGLES
|
||||
#include <EGL/egl.h>
|
||||
#endif
|
||||
|
||||
// NOTE: This has to be the last file included! (turned off below, since this is included like a header)
|
||||
#include "tier0/memdbgon.h"
|
||||
@@ -63,10 +65,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 +602,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