Begun preparations for Win32 EGL support.

This commit is contained in:
Camilla Berglund
2012-11-27 12:58:59 +01:00
parent 0f0f7f7294
commit b934cdf573
7 changed files with 103 additions and 55 deletions
+12 -46
View File
@@ -1,6 +1,6 @@
//========================================================================
// GLFW - An OpenGL library
// Platform: Win32/WGL
// Platform: Win32
// API version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
@@ -28,8 +28,8 @@
//
//========================================================================
#ifndef _platform_h_
#define _platform_h_
#ifndef _win32_platform_h_
#define _win32_platform_h_
// We don't need all the fancy stuff
@@ -63,11 +63,6 @@
#include <windows.h>
#include <mmsystem.h>
// This path may need to be changed if you build GLFW using your own setup
// We ship and use our own copy of wglext.h since GLFW uses fairly new
// extensions and not all operating systems come with an up-to-date version
#include "../support/GL/wglext.h"
//========================================================================
// Hack: Define things that some windows.h variants don't
@@ -110,10 +105,16 @@ typedef DWORD (WINAPI * TIMEGETTIME_T) (void);
#define _GLFW_WNDCLASSNAME L"GLFW30"
#if defined(_GLFW_WIN32_WGL)
#include "wgl_platform.h"
#elif defined(_GLFW_WIN32_EGL)
#define _GLFW_EGL_NATIVE_WINDOW window->Win32.handle
#define _GLFW_EGL_NATIVE_DISPLAY NULL
#include "egl_platform.h"
#endif
#define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowWin32 Win32
#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextWGL WGL
#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryWin32 Win32
#define _GLFW_PLATFORM_LIBRARY_OPENGL_STATE _GLFWlibraryWGL WGL
//========================================================================
@@ -126,31 +127,6 @@ typedef DWORD (WINAPI * TIMEGETTIME_T) (void);
typedef INT_PTR GLFWintptr;
//------------------------------------------------------------------------
// Platform-specific OpenGL context structure
//------------------------------------------------------------------------
typedef struct _GLFWcontextWGL
{
// Platform specific window resources
HDC DC; // Private GDI device context
HGLRC context; // Permanent rendering context
// Platform specific extensions (context specific)
PFNWGLSWAPINTERVALEXTPROC SwapIntervalEXT;
PFNWGLGETPIXELFORMATATTRIBIVARBPROC GetPixelFormatAttribivARB;
PFNWGLGETEXTENSIONSSTRINGEXTPROC GetExtensionsStringEXT;
PFNWGLGETEXTENSIONSSTRINGARBPROC GetExtensionsStringARB;
PFNWGLCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB;
GLboolean EXT_swap_control;
GLboolean ARB_multisample;
GLboolean ARB_pixel_format;
GLboolean ARB_create_context;
GLboolean ARB_create_context_profile;
GLboolean EXT_create_context_es2_profile;
GLboolean ARB_create_context_robustness;
} _GLFWcontextWGL;
//------------------------------------------------------------------------
// Platform-specific window structure
//------------------------------------------------------------------------
@@ -210,16 +186,6 @@ typedef struct _GLFWlibraryWin32
} _GLFWlibraryWin32;
//------------------------------------------------------------------------
// Platform-specific library global data for WGL
//------------------------------------------------------------------------
typedef struct _GLFWlibraryWGL
{
int dummy;
} _GLFWlibraryWGL;
//========================================================================
// Prototypes for platform specific internal functions
//========================================================================
@@ -244,4 +210,4 @@ void _glfwSetVideoMode(int* width, int* height,
void _glfwRestoreVideoMode(void);
#endif // _platform_h_
#endif // _win32_platform_h_