gsdx-ogl-wnd: fix compilation error on linux

git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5634 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut 2013-05-18 16:19:23 +00:00
parent b8e36b44af
commit dce89ff1a0
3 changed files with 15 additions and 4 deletions

View File

@ -87,6 +87,7 @@ PFNGLUNMAPBUFFERPROC glUnmapBuffer = NULL;
PFNGLUSEPROGRAMSTAGESPROC glUseProgramStages = NULL;
PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer = NULL;
PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer = NULL;
PFNGLTEXSTORAGE2DPROC glTexStorage2D = NULL;
namespace GLLoader {
@ -179,6 +180,7 @@ namespace GLLoader {
GL_LOADFN(glUseProgramStages);
GL_LOADFN(glVertexAttribIPointer);
GL_LOADFN(glVertexAttribPointer);
GL_LOADFN(glTexStorage2D);
}
bool check_gl_supported_extension() {
@ -187,6 +189,7 @@ namespace GLLoader {
bool found_GL_ARB_separate_shader_objects = false;
bool found_GL_ARB_shading_language_420pack = false;
bool found_GL_ARB_texture_storage = false;
fprintf(stderr, "DEBUG: check_gl_supported_extension\n");
if (glGetStringi && max_ext) {
@ -198,18 +201,25 @@ namespace GLLoader {
if (ext.compare("GL_ARB_shading_language_420pack") == 0) {
found_GL_ARB_shading_language_420pack = true;
}
if (ext.compare("GL_ARB_texture_storage") == 0) {
found_GL_ARB_texture_storage = true;
}
fprintf(stderr, "EXT: %s\n", ext.c_str());
}
}
if ( !found_GL_ARB_separate_shader_objects) {
if (!found_GL_ARB_separate_shader_objects) {
fprintf(stderr, "GL_ARB_separate_shader_objects is not supported\n");
return false;
}
if ( !found_GL_ARB_shading_language_420pack) {
if (!found_GL_ARB_shading_language_420pack) {
fprintf(stderr, "GL_ARB_shading_language_420pack is not supported\n");
//return false;
}
if (!found_GL_ARB_texture_storage) {
fprintf(stderr, "GL_ARB_texture_storage is not supported\n");
return false;
}
return true;
}

View File

@ -113,6 +113,7 @@ extern PFNGLUNMAPBUFFERPROC glUnmapBuffer;
extern PFNGLUSEPROGRAMSTAGESPROC glUseProgramStages;
extern PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
extern PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer;
extern PFNGLTEXSTORAGE2DPROC glTexStorage2D;
namespace GLLoader {
bool check_gl_version(uint32 major, uint32 minor);

View File

@ -68,7 +68,7 @@ bool GSWndOGL::CreateContext(int major, int minor)
// Install a dummy handler to handle gracefully (aka not segfault) the support of GL version
int (*oldHandler)(Display*, XErrorEvent*) = XSetErrorHandler(&ctxErrorHandler);
// Be sure the handler is installed
XSync( m_XDisplay, false);
XSync( m_NativeDisplay, false);
// Create a context
int context_attribs[] =
@ -88,7 +88,7 @@ bool GSWndOGL::CreateContext(int major, int minor)
XSetErrorHandler(oldHandler);
// Get latest error
XSync( m_XDisplay, false);
XSync( m_NativeDisplay, false);
if (!m_context || ctxError) {
fprintf(stderr, "Failed to create the opengl context. Check your drivers support openGL %d.%d. Hint: opensource drivers don't\n", major, minor );