| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "SkRefCnt.h" | 9 #include "SkRefCnt.h" |
| 10 | 10 |
| 11 #ifndef SkWGL_DEFINED | 11 #ifndef SkWGL_DEFINED |
| 12 #define SkWGL_DEFINED | 12 #define SkWGL_DEFINED |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * Working with WGL extensions can be a pain. Among the reasons is that You must | 15 * Working with WGL extensions can be a pain. Among the reasons is that You must |
| 16 * have a GL context to get the proc addresses, but you want to use the procs to | 16 * have a GL context to get the proc addresses, but you want to use the procs to |
| 17 * create a context in the first place. So you have to create a dummy GL ctx to | 17 * create a context in the first place. So you have to create a dummy GL ctx to |
| 18 * get the proc addresses. | 18 * get the proc addresses. |
| 19 * | 19 * |
| 20 * This file helps by providing SkCreateWGLInterface(). It returns a struct of | 20 * This file helps by providing SkCreateWGLInterface(). It returns a struct of |
| 21 * function pointers that it initializes. It also has a helper function to query | 21 * function pointers that it initializes. It also has a helper function to query |
| 22 * for WGL extensions. It handles the fact that wglGetExtensionsString is itself | 22 * for WGL extensions. It handles the fact that wglGetExtensionsString is itself |
| 23 * an extension. | 23 * an extension. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #if !defined(WIN32_LEAN_AND_MEAN) | 26 #if !defined(WIN32_LEAN_AND_MEAN) |
| 27 #define WIN32_LEAN_AND_MEAN | 27 #define WIN32_LEAN_AND_MEAN |
| 28 #define SK_LOCAL_LEAN_AND_MEAN | 28 #define SK_LOCAL_LEAN_AND_MEAN |
| 29 #endif | 29 #endif |
| 30 #include <Windows.h> | 30 #include <windows.h> |
| 31 #if defined(SK_LOCAL_LEAN_AND_MEAN) | 31 #if defined(SK_LOCAL_LEAN_AND_MEAN) |
| 32 #undef WIN32_LEAN_AND_MEAN | 32 #undef WIN32_LEAN_AND_MEAN |
| 33 #undef SK_LOCAL_LEAN_AND_MEAN | 33 #undef SK_LOCAL_LEAN_AND_MEAN |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 #define SK_WGL_DRAW_TO_WINDOW 0x2001 | 36 #define SK_WGL_DRAW_TO_WINDOW 0x2001 |
| 37 #define SK_WGL_ACCELERATION 0x2003 | 37 #define SK_WGL_ACCELERATION 0x2003 |
| 38 #define SK_WGL_SUPPORT_OPENGL 0x2010 | 38 #define SK_WGL_SUPPORT_OPENGL 0x2010 |
| 39 #define SK_WGL_DOUBLE_BUFFER 0x2011 | 39 #define SK_WGL_DOUBLE_BUFFER 0x2011 |
| 40 #define SK_WGL_COLOR_BITS 0x2014 | 40 #define SK_WGL_COLOR_BITS 0x2014 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 /** | 107 /** |
| 108 * Helper to create an OpenGL context for a DC using WGL. Configs with a sample
count >= to | 108 * Helper to create an OpenGL context for a DC using WGL. Configs with a sample
count >= to |
| 109 * msaaSampleCount are preferred but if none is available then a context with a
lower sample count | 109 * msaaSampleCount are preferred but if none is available then a context with a
lower sample count |
| 110 * (including non-MSAA) will be created. If preferCoreProfile is true but a core
profile cannot be | 110 * (including non-MSAA) will be created. If preferCoreProfile is true but a core
profile cannot be |
| 111 * created then a compatible profile context will be created. | 111 * created then a compatible profile context will be created. |
| 112 */ | 112 */ |
| 113 HGLRC SkCreateWGLContext(HDC dc, int msaaSampleCount, bool preferCoreProfile); | 113 HGLRC SkCreateWGLContext(HDC dc, int msaaSampleCount, bool preferCoreProfile); |
| 114 | 114 |
| 115 #endif | 115 #endif |
| OLD | NEW |