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
This commit is contained in:
gregory.hainaut 2013-01-04 23:02:48 +00:00
parent 5e4bae5f5d
commit c5a6b07b30
2 changed files with 13 additions and 8 deletions

View File

@ -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);
}

View File

@ -123,6 +123,10 @@ using namespace std;
#ifdef _WINDOWS
#include <GL/gl.h>
#include <GL/glext.h>
#include <GL/wglext.h>
#include <hash_map>
#include <hash_set>