From c5a6b07b30d98aa3513bda9d09fdcd1e89dcde40 Mon Sep 17 00:00:00 2001 From: "gregory.hainaut" Date: Fri, 4 Jan 2013 23:02:48 +0000 Subject: [PATCH] gsdx-ogl-wnd: * fix C compilation issue Remain 2 issues with VCS: 1/ need to add 3rdparty dir as include dir (zzogl seem to import common\vsprops\3rdpartyDeps.props) 2/ need to add opengl32.lib as additional lib git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5503 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSWndWGL.cpp | 17 +++++++++-------- plugins/GSdx/stdafx.h | 4 ++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/plugins/GSdx/GSWndWGL.cpp b/plugins/GSdx/GSWndWGL.cpp index 36815e2080..118e3326d6 100644 --- a/plugins/GSdx/GSWndWGL.cpp +++ b/plugins/GSdx/GSWndWGL.cpp @@ -56,10 +56,10 @@ bool GSWndWGL::CreateContext(int major, int minor) // 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, WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_DEBUG_BIT_ARB, - None + 0 }; - PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)wglGetProcAddress((const GLubyte*) "wglCreateContextAttribsARB"); + PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)wglGetProcAddress("wglCreateContextAttribsARB"); if (!wglCreateContextAttribsARB) return false; HGLRC context30 = wglCreateContextAttribsARB(m_NativeDisplay, NULL, context_attribs); @@ -176,7 +176,7 @@ void GSWndWGL::Detach() // The window still need to be closed DetachContext(); - if (m_context) wglContext(m_context); + if (m_context) wglDeleteContext(m_context); CloseWGLDisplay(); } @@ -209,19 +209,19 @@ bool GSWndWGL::OpenWGLDisplay() if (!(m_NativeDisplay = GetDC(m_NativeWindow))) { - MessageBox(NULL, L"(1) Can't Create A GL Device Context.", L"ERROR", MB_OK | MB_ICONEXCLAMATION); + MessageBox(NULL, "(1) Can't Create A GL Device Context.", "ERROR", MB_OK | MB_ICONEXCLAMATION); return false; } if (!(PixelFormat = ChoosePixelFormat(m_NativeDisplay, &pfd))) { - MessageBox(NULL, L"(2) Can't Find A Suitable PixelFormat.", L"ERROR", MB_OK | MB_ICONEXCLAMATION); + MessageBox(NULL, "(2) Can't Find A Suitable PixelFormat.", "ERROR", MB_OK | MB_ICONEXCLAMATION); return false; } if (!SetPixelFormat(m_NativeDisplay, PixelFormat, &pfd)) { - MessageBox(NULL, L"(3) Can't Set The PixelFormat.", L"ERROR", MB_OK | MB_ICONEXCLAMATION); + MessageBox(NULL, "(3) Can't Set The PixelFormat.", "ERROR", MB_OK | MB_ICONEXCLAMATION); return false; } @@ -232,7 +232,7 @@ void GSWndWGL::CloseWGLDisplay() { if (m_NativeDisplay && !ReleaseDC(m_NativeWindow, m_NativeDisplay)) // Are We Able To Release The DC { - MessageBox(NULL, L"Release Device Context Failed.", L"SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION); + MessageBox(NULL, "Release Device Context Failed.", "SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION); m_NativeDisplay = NULL; // Set DC To NULL } } @@ -300,13 +300,14 @@ GSVector4i GSWndWGL::GetClientRect() } //TODO: check extensions supported or not +//FIXME : extension allocation void GSWndWGL::SetVSync(bool enable) { // m_swapinterval uses an integer as parameter // 0 -> disable vsync // n -> wait n frame //if (m_swapinterval) m_swapinterval((int)enable); - wglSwapIntervalEXT(!enable); + // wglSwapIntervalEXT(!enable); } diff --git a/plugins/GSdx/stdafx.h b/plugins/GSdx/stdafx.h index b3a6a0d098..5155c286ab 100644 --- a/plugins/GSdx/stdafx.h +++ b/plugins/GSdx/stdafx.h @@ -123,6 +123,10 @@ using namespace std; #ifdef _WINDOWS + #include + #include + #include + #include #include