forked from tcobbs/ldview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LDVExtensionsSetup.h
84 lines (74 loc) · 2.98 KB
/
LDVExtensionsSetup.h
1
2
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef __LDVEXTENSIONSSETUP_H__
#define __LDVEXTENSIONSSETUP_H__
#include <CUI/CUIOGLWindow.h>
#include <GL/glext.h>
#include <GL/wglext.h>
#include <TCFoundation/TCTypedValueArray.h>
#include <TCFoundation/TCTypedObjectArray.h>
#include <TCFoundation/TCStlIncludes.h>
typedef TCTypedObjectArray<TCIntArray> TCIntArrayArray;
typedef std::set<std::string> StringSet;
#ifndef GL_MULTISAMPLE_FILTER_HINT_NV
/* NV_multisample_filter_hint */
#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
#endif
class LDVExtensionsSetup : public CUIOGLWindow
{
public:
static void setup(HINSTANCE hInstance);
static bool checkForWGLExtension(char* extension, bool force = false);
static bool haveMultisampleExtension(bool force = false);
static bool havePixelBufferExtension(bool force = false);
static bool havePixelFormatExtension(bool force = false);
//static bool haveVARExtension(bool force = false);
static StringSet &getWglExtensions(void) { return sm_wglExtensions; }
static const char *getWglExtensionsString(void)
{
return sm_wglExtensionsString;
}
static bool haveStencil(void) { return sm_stencilPresent; }
static bool haveAlpha(void) { return sm_alphaPresent; }
static int choosePixelFormat(HDC hdc, GLint customValues[]);
static void printPixelFormats(int *indexes, GLuint count);
static void printPixelFormat(HDC hdc, int index);
static TCIntArray *getFSAAModes(void) { return sm_fsaaModes; }
protected:
LDVExtensionsSetup(HINSTANCE hInstance);
virtual ~LDVExtensionsSetup(void);
virtual BOOL initWindow(void);
virtual void closeWindow(void);
virtual void scanFSAAModes(void);
virtual void recordPixelFormats(void);
static int matchPixelFormat(int *intValues);
static int pixelFormatMatches(int index, int *intValues);
// WGL_EXT_pixel_format
static PFNWGLGETPIXELFORMATATTRIBIVEXTPROC sm_wglGetPixelFormatAttribivARB;
static PFNWGLGETPIXELFORMATATTRIBFVEXTPROC sm_wglGetPixelFormatAttribfvARB;
static PFNWGLCHOOSEPIXELFORMATEXTPROC sm_wglChoosePixelFormatARB;
// WGL_ARB_extensions_string
static PFNWGLGETEXTENSIONSSTRINGARBPROC sm_wglGetExtensionsStringARB;
// WGL_ARB_pbuffer
static PFNWGLCREATEPBUFFERARBPROC sm_wglCreatePbufferARB;
static PFNWGLGETPBUFFERDCARBPROC sm_wglGetPbufferDCARB;
static PFNWGLRELEASEPBUFFERDCARBPROC sm_wglReleasePbufferDCARB;
static PFNWGLDESTROYPBUFFERARBPROC sm_wglDestroyPbufferARB;
static PFNWGLQUERYPBUFFERARBPROC sm_wglQueryPbufferARB;
// WGL_NV_allocate_memory
static PFNWGLALLOCATEMEMORYNVPROC sm_wglAllocateMemoryNV;
static PFNWGLFREEMEMORYNVPROC sm_wglFreeMemoryNV;
static StringSet sm_wglExtensions;
static char *sm_wglExtensionsString;
static bool sm_performedInitialSetup;
static bool sm_stencilPresent;
static bool sm_alphaPresent;
static TCIntArray *sm_fsaaModes;
static TCIntArrayArray *sm_pfIntValues;
static LDVExtensionsSetup *sm_extensionsSetup;
static class LDVExtensionsSetupCleanup
{
public:
~LDVExtensionsSetupCleanup(void);
} sm_extensionsSetupCleanup;
friend class LDVExtensionsSetupCleanup;
};
#endif // __LDVEXTENSIONSSETUP_H__