Go to the source code of this file.
◆ SK_ERROR_INVALID_PROFILE
#define SK_ERROR_INVALID_PROFILE 0x2096 |
◆ SK_ERROR_INVALID_VERSION
#define SK_ERROR_INVALID_VERSION 0x2095 |
◆ SK_WGL_ACCELERATION
#define SK_WGL_ACCELERATION 0x2003 |
◆ SK_WGL_ALPHA_BITS
#define SK_WGL_ALPHA_BITS 0x201B |
◆ SK_WGL_BLUE_BITS
#define SK_WGL_BLUE_BITS 0x2019 |
◆ SK_WGL_COLOR_BITS
#define SK_WGL_COLOR_BITS 0x2014 |
◆ SK_WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT
#define SK_WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 |
◆ SK_WGL_CONTEXT_CORE_PROFILE_BIT
#define SK_WGL_CONTEXT_CORE_PROFILE_BIT 0x00000001 |
◆ SK_WGL_CONTEXT_DEBUG_BIT
#define SK_WGL_CONTEXT_DEBUG_BIT 0x0001 |
◆ SK_WGL_CONTEXT_ES2_PROFILE_BIT
#define SK_WGL_CONTEXT_ES2_PROFILE_BIT 0x00000004 |
◆ SK_WGL_CONTEXT_FLAGS
#define SK_WGL_CONTEXT_FLAGS 0x2094 |
◆ SK_WGL_CONTEXT_FORWARD_COMPATIBLE_BIT
#define SK_WGL_CONTEXT_FORWARD_COMPATIBLE_BIT 0x0002 |
◆ SK_WGL_CONTEXT_LAYER_PLANE
#define SK_WGL_CONTEXT_LAYER_PLANE 0x2093 |
◆ SK_WGL_CONTEXT_MAJOR_VERSION
#define SK_WGL_CONTEXT_MAJOR_VERSION 0x2091 |
◆ SK_WGL_CONTEXT_MINOR_VERSION
#define SK_WGL_CONTEXT_MINOR_VERSION 0x2092 |
◆ SK_WGL_CONTEXT_PROFILE_MASK
#define SK_WGL_CONTEXT_PROFILE_MASK 0x9126 |
◆ SK_WGL_DOUBLE_BUFFER
#define SK_WGL_DOUBLE_BUFFER 0x2011 |
◆ SK_WGL_DRAW_TO_WINDOW
#define SK_WGL_DRAW_TO_WINDOW 0x2001 |
Working with WGL extensions can be a pain. Among the reasons is that you must have a GL context to get the proc addresses, but you want to use the procs to create a context in the first place. So you have to create a placeholder GL ctx to get the proc addresses.
This file helps by providing SkCreateWGLInterface(). It returns a struct of function pointers that it initializes. It also has a helper function to query for WGL extensions. It handles the fact that wglGetExtensionsString is itself an extension.
Definition at line 25 of file SkWGL.h.
◆ SK_WGL_FULL_ACCELERATION
#define SK_WGL_FULL_ACCELERATION 0x2027 |
◆ SK_WGL_GREEN_BITS
#define SK_WGL_GREEN_BITS 0x2017 |
◆ SK_WGL_RED_BITS
#define SK_WGL_RED_BITS 0x2015 |
◆ SK_WGL_SAMPLE_BUFFERS
#define SK_WGL_SAMPLE_BUFFERS 0x2041 |
◆ SK_WGL_SAMPLES
#define SK_WGL_SAMPLES 0x2042 |
◆ SK_WGL_STENCIL_BITS
#define SK_WGL_STENCIL_BITS 0x2023 |
◆ SK_WGL_SUPPORT_OPENGL
#define SK_WGL_SUPPORT_OPENGL 0x2010 |
◆ SkWGLContextRequest
Enumerator |
---|
kGLPreferCoreProfile_SkWGLContextRequest | Requests to create core profile context if possible, otherwise compatibility profile.
|
kGLPreferCompatibilityProfile_SkWGLContextRequest | Requests to create compatibility profile context if possible, otherwise core profile.
|
kGLES_SkWGLContextRequest | Requests to create GL ES profile context.
|
Definition at line 119 of file SkWGL.h.
119 {
120
121
123
124
126
128};
@ kGLES_SkWGLContextRequest
@ kGLPreferCompatibilityProfile_SkWGLContextRequest
@ kGLPreferCoreProfile_SkWGLContextRequest
◆ DECLARE_HANDLE()
DECLARE_HANDLE |
( |
HPBUFFER |
| ) |
|
◆ SkCreateWGLContext()
HGLRC SkCreateWGLContext |
( |
HDC |
dc, |
|
|
int |
msaaSampleCount, |
|
|
bool |
deepColor, |
|
|
SkWGLContextRequest |
context, |
|
|
HGLRC |
shareContext = nullptr |
|
) |
| |
Helper to create an OpenGL context for a DC using WGL. Configs with a sample count >= to msaaSampleCount are preferred but if none is available then a context with a lower sample count (including non-MSAA) will be created. If msaaSampleCount is 1 then this will fail if a non-msaa context cannot be created. If preferCoreProfile is true but a core profile cannot be created then a compatible profile context will be created.