wgl_context.h 3.58 KB
Newer Older
1
//========================================================================
2
// GLFW 3.1 WGL - www.glfw.org
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//------------------------------------------------------------------------
// Copyright (c) 2002-2006 Marcus Geelnard
// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//    claim that you wrote the original software. If you use this software
//    in a product, an acknowledgment in the product documentation would
//    be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not
//    be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source
//    distribution.
//
//========================================================================

28
29
#ifndef _glfw3_wgl_context_h_
#define _glfw3_wgl_context_h_
30
31
32
33

// 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
34
#include "../deps/GL/wglext.h"
35

Camilla Berglund's avatar
Camilla Berglund committed
36
37
38
#define _GLFW_PLATFORM_FBCONFIG                 int             wgl
#define _GLFW_PLATFORM_CONTEXT_STATE            _GLFWcontextWGL wgl
#define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE    _GLFWlibraryWGL wgl
39
40


Camilla Berglund's avatar
Camilla Berglund committed
41
42
// WGL-specific per-context data
//
43
44
typedef struct _GLFWcontextWGL
{
45
    HDC       dc;              // Private GDI device context
46
    HGLRC     context;         // Permanent rendering context
47
    int       interval;
48

Camilla Berglund's avatar
Camilla Berglund committed
49
    // WGL extensions (context specific)
50
    PFNWGLSWAPINTERVALEXTPROC           SwapIntervalEXT;
51
    PFNWGLGETPIXELFORMATATTRIBIVARBPROC GetPixelFormatAttribivARB;
52
53
54
55
56
    PFNWGLGETEXTENSIONSSTRINGEXTPROC    GetExtensionsStringEXT;
    PFNWGLGETEXTENSIONSSTRINGARBPROC    GetExtensionsStringARB;
    PFNWGLCREATECONTEXTATTRIBSARBPROC   CreateContextAttribsARB;
    GLboolean                           EXT_swap_control;
    GLboolean                           ARB_multisample;
57
    GLboolean                           ARB_framebuffer_sRGB;
58
    GLboolean                           EXT_framebuffer_sRGB;
59
60
61
62
63
    GLboolean                           ARB_pixel_format;
    GLboolean                           ARB_create_context;
    GLboolean                           ARB_create_context_profile;
    GLboolean                           EXT_create_context_es2_profile;
    GLboolean                           ARB_create_context_robustness;
64
    GLboolean                           ARB_context_flush_control;
Camilla Berglund's avatar
Camilla Berglund committed
65

66
67
68
} _GLFWcontextWGL;


Camilla Berglund's avatar
Camilla Berglund committed
69
70
// WGL-specific global data
//
71
72
typedef struct _GLFWlibraryWGL
{
Camilla Berglund's avatar
Camilla Berglund committed
73
    // opengl32.dll (for glfwGetProcAddress)
74
75
76
    struct {
        HINSTANCE   instance;
    } opengl32;
77
78
79
80

} _GLFWlibraryWGL;


81
82
83
int _glfwInitContextAPI(void);
void _glfwTerminateContextAPI(void);
int _glfwCreateContext(_GLFWwindow* window,
84
                       const _GLFWctxconfig* ctxconfig,
85
86
87
                       const _GLFWfbconfig* fbconfig);
void _glfwDestroyContext(_GLFWwindow* window);
int _glfwAnalyzeContext(const _GLFWwindow* window,
88
                        const _GLFWctxconfig* ctxconfig,
89
90
                        const _GLFWfbconfig* fbconfig);

91
#endif // _glfw3_wgl_context_h_