mirror of https://github.com/PCSX2/pcsx2.git
gsdx-ogl: LINUX-ONLY * Fix context creation. Get opengl working with nvidia graphics cards.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4984 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
afdb2dadc3
commit
e6057b765f
|
@ -52,7 +52,7 @@
|
|||
// glBindBufferBase(GL_UNIFORM_BUFFER, block_binding_point, some_buffer_object);
|
||||
// glUniformBlockBinding(program, block_index, block_binding_point);
|
||||
|
||||
|
||||
//#define LOUD_DEBUGGING
|
||||
GSDeviceOGL::GSDeviceOGL()
|
||||
: m_free_window(false)
|
||||
, m_window(NULL)
|
||||
|
@ -179,6 +179,11 @@ bool GSDeviceOGL::Create(GSWnd* wnd)
|
|||
// ****************************************************************
|
||||
// convert
|
||||
// ****************************************************************
|
||||
|
||||
// There isn't a default VAO in newer versions of OpenGL, so create one.
|
||||
unsigned int vao = 0;
|
||||
glGenVertexArrays(1,&vao);
|
||||
glBindVertexArray(vao);
|
||||
|
||||
GSInputLayout il_convert[2] =
|
||||
{
|
||||
|
@ -1206,7 +1211,7 @@ void GSDeviceOGL::DebugOutputToFile(unsigned int source, unsigned int type, unsi
|
|||
else if(type == GL_DEBUG_TYPE_OTHER_ARB)
|
||||
strcpy(debType, "Other");
|
||||
else
|
||||
strcpy(debType, "UNKNOW");
|
||||
strcpy(debType, "UNKNOWN");
|
||||
|
||||
if(severity == GL_DEBUG_SEVERITY_HIGH_ARB)
|
||||
strcpy(debSev, "High");
|
||||
|
@ -1215,7 +1220,9 @@ void GSDeviceOGL::DebugOutputToFile(unsigned int source, unsigned int type, unsi
|
|||
else if(severity == GL_DEBUG_SEVERITY_LOW_ARB)
|
||||
strcpy(debSev, "Low");
|
||||
|
||||
//fprintf(stderr,"Type:%s\tID:%d\tSeverity:%s\tMessage:%s\n", debType,id,debSev,message);
|
||||
#ifdef LOUD_DEBUGGING
|
||||
fprintf(stderr,"Type:%s\tID:%d\tSeverity:%s\tMessage:%s\n", debType,id,debSev,message);
|
||||
#endif
|
||||
|
||||
FILE* f = fopen("Debug.txt","a");
|
||||
if(f)
|
||||
|
|
|
@ -338,15 +338,26 @@ bool GSWnd::Attach(void* handle, bool managed)
|
|||
if (m_renderer != 2) {
|
||||
m_XDisplay = XOpenDisplay(NULL);
|
||||
|
||||
// Get visual information
|
||||
int attrListDbl[] = { GLX_RGBA, GLX_DOUBLEBUFFER,
|
||||
GLX_RED_SIZE, 8,
|
||||
GLX_GREEN_SIZE, 8,
|
||||
GLX_BLUE_SIZE, 8,
|
||||
GLX_DEPTH_SIZE, 24,
|
||||
None
|
||||
};
|
||||
|
||||
if ( !m_XDisplay )
|
||||
{
|
||||
fprintf( stderr, "Failed to open X display\n" );
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Get visual information
|
||||
static int attrListDbl[] =
|
||||
{
|
||||
GLX_X_RENDERABLE , True,
|
||||
GLX_DRAWABLE_TYPE , GLX_WINDOW_BIT,
|
||||
GLX_RENDER_TYPE , GLX_RGBA_BIT,
|
||||
GLX_RED_SIZE , 8,
|
||||
GLX_GREEN_SIZE , 8,
|
||||
GLX_BLUE_SIZE , 8,
|
||||
GLX_DEPTH_SIZE , 24,
|
||||
GLX_DOUBLEBUFFER , True,
|
||||
None
|
||||
};
|
||||
|
||||
PFNGLXCHOOSEFBCONFIGPROC glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC) glXGetProcAddress((GLubyte *) "glXChooseFBConfig");
|
||||
int fbcount = 0;
|
||||
GLXFBConfig *fbc = glXChooseFBConfig(m_XDisplay, DefaultScreen(m_XDisplay), attrListDbl, &fbcount);
|
||||
|
@ -364,7 +375,7 @@ bool GSWnd::Attach(void* handle, bool managed)
|
|||
// FIXME : Request a debug context to ease opengl development
|
||||
// Note: don't support deprecated feature (pre openg 3.1)
|
||||
GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB | GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
|
||||
0
|
||||
None
|
||||
};
|
||||
m_context = glXCreateContextAttribsARB(m_XDisplay, fbc[0], 0, true, context_attribs);
|
||||
XSync( m_XDisplay, false);
|
||||
|
@ -382,7 +393,6 @@ bool GSWnd::Attach(void* handle, bool managed)
|
|||
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue