mirror of https://github.com/PCSX2/pcsx2.git
zzogl: fixed crash at startup for Intel (and probably nvidia too). Opengl3 and 2 don't support the same set of attributes
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5440 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
972aa02c11
commit
059346b5f2
|
@ -208,7 +208,7 @@ bool GLWindow::CreateContextGL(int major, int minor)
|
||||||
if (!NativeDisplay) return false;
|
if (!NativeDisplay) return false;
|
||||||
|
|
||||||
// Get visual information
|
// Get visual information
|
||||||
static int attrListDbl[] =
|
int attrListDbl[] =
|
||||||
{
|
{
|
||||||
GLX_X_RENDERABLE , True,
|
GLX_X_RENDERABLE , True,
|
||||||
GLX_DRAWABLE_TYPE , GLX_WINDOW_BIT,
|
GLX_DRAWABLE_TYPE , GLX_WINDOW_BIT,
|
||||||
|
@ -221,9 +221,22 @@ bool GLWindow::CreateContextGL(int major, int minor)
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Attribute are very sensible to the various implementation (intel, nvidia, amd)
|
||||||
|
// Nvidia and Intel doesn't support previous attributes for opengl2.0
|
||||||
|
int attrListDbl_2_0[] =
|
||||||
|
{
|
||||||
|
GLX_RGBA,
|
||||||
|
GLX_DOUBLEBUFFER,
|
||||||
|
GLX_RED_SIZE, 8,
|
||||||
|
GLX_GREEN_SIZE, 8,
|
||||||
|
GLX_BLUE_SIZE, 8,
|
||||||
|
GLX_DEPTH_SIZE, 24,
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
// Only keep for older card but NVIDIA and AMD both drop the support of those cards
|
// Only keep for older card but NVIDIA and AMD both drop the support of those cards
|
||||||
if (major <= 2) {
|
if (major <= 2) {
|
||||||
XVisualInfo *vi = glXChooseVisual(NativeDisplay, DefaultScreen(NativeDisplay), attrListDbl);
|
XVisualInfo *vi = glXChooseVisual(NativeDisplay, DefaultScreen(NativeDisplay), attrListDbl_2_0);
|
||||||
if (vi == NULL) return NULL;
|
if (vi == NULL) return NULL;
|
||||||
|
|
||||||
glxContext = glXCreateContext(NativeDisplay, vi, NULL, GL_TRUE);
|
glxContext = glXCreateContext(NativeDisplay, vi, NULL, GL_TRUE);
|
||||||
|
@ -411,6 +424,7 @@ void GLWindow::SwapGLBuffers()
|
||||||
void GLWindow::InitVsync(bool extension)
|
void GLWindow::InitVsync(bool extension)
|
||||||
{
|
{
|
||||||
#ifdef GLX_API
|
#ifdef GLX_API
|
||||||
|
vsync_supported = false;
|
||||||
if (extension) {
|
if (extension) {
|
||||||
swapinterval = (_PFNSWAPINTERVAL)GetProcAddress("glXSwapInterval");
|
swapinterval = (_PFNSWAPINTERVAL)GetProcAddress("glXSwapInterval");
|
||||||
|
|
||||||
|
@ -425,10 +439,7 @@ void GLWindow::InitVsync(bool extension)
|
||||||
vsync_supported = true;
|
vsync_supported = true;
|
||||||
} else {
|
} else {
|
||||||
ZZLog::Error_Log("No support for SwapInterval (framerate clamped to monitor refresh rate),");
|
ZZLog::Error_Log("No support for SwapInterval (framerate clamped to monitor refresh rate),");
|
||||||
vsync_supported = false;
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
vsync_supported = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -441,7 +452,7 @@ void GLWindow::SetVsync(bool enable)
|
||||||
eglSwapInterval(eglDisplay, enable);
|
eglSwapInterval(eglDisplay, enable);
|
||||||
#endif
|
#endif
|
||||||
#ifdef GLX_API
|
#ifdef GLX_API
|
||||||
if (vsync_supported) {
|
if (vsync_supported && swapinterval) {
|
||||||
swapinterval(enable);
|
swapinterval(enable);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue