fix windows build

add the GL include (back) to Base.props
use a similar technique to GLX.cpp (by Sonic) in WGL.cpp to get
wglSwapIntervalEXT without the WGLEW check

Conflicts:
	Source/Core/VideoBackends/OGL/OGL.vcxproj
	Source/Core/VideoBackends/OGL/OGL.vcxproj.filters
	Source/VSProps/Base.props
This commit is contained in:
Jack Frost 2013-12-31 00:03:49 +01:00 committed by degasus
parent 10bd61a9d2
commit f4bd7bdef0
5 changed files with 131 additions and 2 deletions

View File

@ -14,9 +14,13 @@
static HDC hDC = NULL; // Private GDI Device Context
static HGLRC hRC = NULL; // Permanent Rendering Context
// typedef from wglext.h
typedef BOOL(WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
static PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL;
void cInterfaceWGL::SwapInterval(int Interval)
{
if (WGLEW_EXT_swap_control)
if (wglSwapIntervalEXT)
wglSwapIntervalEXT(Interval);
else
ERROR_LOG(VIDEO, "No support for SwapInterval (framerate clamped to monitor refresh rate).");
@ -71,6 +75,7 @@ bool cInterfaceWGL::Create(void *&window_handle)
Host_SysMessage("failed to create window");
return false;
}
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)GLInterface->GetProcAddress("wglSwapIntervalEXT");
// Show the window
EmuWindow::Show();
@ -97,7 +102,7 @@ bool cInterfaceWGL::Create(void *&window_handle)
0, 0, 0 // Layer Masks Ignored
};
GLuint PixelFormat; // Holds The Results After Searching For A Match
int PixelFormat; // Holds The Results After Searching For A Match
if (!(hDC=GetDC(EmuWindow::GetWnd()))) {
PanicAlert("(1) Can't create an OpenGL Device context. Fail.");

View File

@ -5,7 +5,9 @@
#include "GLExtensions.h"
#include "Log.h"
#if defined(__linux__)
#include <dlfcn.h>
#endif
#include <unordered_map>
// gl_1_2

View File

@ -2,6 +2,9 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
#include <GL/gl.h>
#include <GL/glext.h>
#ifndef GLAPIENTRY
#define GLAPIENTRY
#endif

View File

@ -44,6 +44,7 @@
<PropertyGroup Label="UserMacros" />
<ItemGroup>
<ClCompile Include="FramebufferManager.cpp" />
<ClCompile Include="GLExtensions\GLExtensions.cpp" />
<ClCompile Include="GLUtil.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="NativeVertexFormat.cpp" />
@ -63,6 +64,34 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="FramebufferManager.h" />
<ClInclude Include="GLExtensions\ARB_blend_func_extended.h" />
<ClInclude Include="GLExtensions\ARB_buffer_storage.h" />
<ClInclude Include="GLExtensions\ARB_debug_output.h" />
<ClInclude Include="GLExtensions\ARB_draw_elements_base_vertex.h" />
<ClInclude Include="GLExtensions\ARB_ES2_compatibility.h" />
<ClInclude Include="GLExtensions\ARB_framebuffer_object.h" />
<ClInclude Include="GLExtensions\ARB_get_program_binary.h" />
<ClInclude Include="GLExtensions\ARB_map_buffer_range.h" />
<ClInclude Include="GLExtensions\ARB_sampler_objects.h" />
<ClInclude Include="GLExtensions\ARB_sample_shading.h" />
<ClInclude Include="GLExtensions\ARB_sync.h" />
<ClInclude Include="GLExtensions\ARB_uniform_buffer_object.h" />
<ClInclude Include="GLExtensions\ARB_vertex_array_object.h" />
<ClInclude Include="GLExtensions\ARB_viewport_array.h" />
<ClInclude Include="GLExtensions\GLExtensions.h" />
<ClInclude Include="GLExtensions\gl_1_1.h" />
<ClInclude Include="GLExtensions\gl_1_2.h" />
<ClInclude Include="GLExtensions\gl_1_3.h" />
<ClInclude Include="GLExtensions\gl_1_4.h" />
<ClInclude Include="GLExtensions\gl_1_5.h" />
<ClInclude Include="GLExtensions\gl_2_0.h" />
<ClInclude Include="GLExtensions\gl_3_0.h" />
<ClInclude Include="GLExtensions\gl_3_1.h" />
<ClInclude Include="GLExtensions\gl_3_2.h" />
<ClInclude Include="GLExtensions\gl_common.h" />
<ClInclude Include="GLExtensions\KHR_debug.h" />
<ClInclude Include="GLExtensions\NV_framebuffer_multisample_coverage.h" />
<ClInclude Include="GLExtensions\NV_primitive_restart.h" />
<ClInclude Include="Globals.h" />
<ClInclude Include="GLUtil.h" />
<ClInclude Include="main.h" />

View File

@ -13,6 +13,9 @@
<Filter Include="Render">
<UniqueIdentifier>{696df73b-378e-4399-8f21-999b65d78dcd}</UniqueIdentifier>
</Filter>
<Filter Include="GLExtensions">
<UniqueIdentifier>{4366f285-ded5-48c9-9464-03fb46174526}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="NativeVertexFormat.cpp">
@ -54,6 +57,9 @@
<ClCompile Include="main.cpp" />
<ClCompile Include="SamplerCache.cpp" />
<ClCompile Include="stdafx.cpp" />
<ClCompile Include="GLExtensions\GLExtensions.cpp">
<Filter>GLExtensions</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="VertexManager.h">
@ -94,6 +100,90 @@
<ClInclude Include="SamplerCache.h" />
<ClInclude Include="VideoBackend.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="GLExtensions\ARB_blend_func_extended.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\ARB_buffer_storage.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\ARB_debug_output.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\ARB_draw_elements_base_vertex.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\ARB_ES2_compatibility.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\ARB_framebuffer_object.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\ARB_get_program_binary.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\ARB_map_buffer_range.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\ARB_sample_shading.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\ARB_sampler_objects.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\ARB_sync.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\ARB_uniform_buffer_object.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\ARB_vertex_array_object.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\ARB_viewport_array.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\gl_1_1.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\gl_1_2.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\gl_1_3.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\gl_1_4.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\gl_1_5.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\gl_2_0.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\gl_3_0.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\gl_3_1.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\gl_3_2.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\gl_common.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\GLExtensions.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\NV_framebuffer_multisample_coverage.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\NV_primitive_restart.h">
<Filter>GLExtensions</Filter>
</ClInclude>
<ClInclude Include="GLExtensions\KHR_debug.h">
<Filter>GLExtensions</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Text Include="CMakeLists.txt" />