OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GraphicsHandleWin32.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef OSGVIEWER_GRAPHICSHANDLEWIN32
15 #define OSGVIEWER_GRAPHICSHANDLEWIN32 1
16 
17 #include <osgViewer/Export>
18 
19 #ifndef _WIN32_WINNT
20 #define _WIN32_WINNT 0x0500
21 #endif
22 #include <windows.h>
23 
24 namespace osgViewer
25 {
26 
32 {
33  public:
34 
36  _hwnd(0),
37  _hdc(0),
38  _hglrc(0) {}
39 
41  inline void setHWND(HWND hwnd) { _hwnd = hwnd; }
42 
44  inline HWND getHWND() const { return _hwnd; }
45 
47  inline void setHDC(HDC hdc) { _hdc = hdc; }
48 
50  inline HDC getHDC() const { return _hdc; }
51 
53  inline void setWGLContext(HGLRC hglrc) { _hglrc = hglrc; }
54 
56  inline HGLRC getWGLContext() const { return _hglrc; }
57 
58  protected:
59 
60  HWND _hwnd;
61  HDC _hdc;
62  HGLRC _hglrc;
63 
64 };
65 
66 }
67 
68 
69 // Definitions required to create an OpenGL pixel format, from the WGL_ARB_pixel_format specification document.
70 // See http://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt
71 
72 #ifndef WGL_ARB_pixel_format
73 #define WGL_ARB_pixel_format 1
74 #define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
75 #define WGL_DRAW_TO_WINDOW_ARB 0x2001
76 #define WGL_DRAW_TO_BITMAP_ARB 0x2002
77 #define WGL_ACCELERATION_ARB 0x2003
78 #define WGL_NEED_PALETTE_ARB 0x2004
79 #define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
80 #define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
81 #define WGL_SWAP_METHOD_ARB 0x2007
82 #define WGL_NUMBER_OVERLAYS_ARB 0x2008
83 #define WGL_NUMBER_UNDERLAYS_ARB 0x2009
84 #define WGL_TRANSPARENT_ARB 0x200A
85 #define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
86 #define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
87 #define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
88 #define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
89 #define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
90 #define WGL_SHARE_DEPTH_ARB 0x200C
91 #define WGL_SHARE_STENCIL_ARB 0x200D
92 #define WGL_SHARE_ACCUM_ARB 0x200E
93 #define WGL_SUPPORT_GDI_ARB 0x200F
94 #define WGL_SUPPORT_OPENGL_ARB 0x2010
95 #define WGL_DOUBLE_BUFFER_ARB 0x2011
96 #define WGL_STEREO_ARB 0x2012
97 #define WGL_PIXEL_TYPE_ARB 0x2013
98 #define WGL_COLOR_BITS_ARB 0x2014
99 #define WGL_RED_BITS_ARB 0x2015
100 #define WGL_RED_SHIFT_ARB 0x2016
101 #define WGL_GREEN_BITS_ARB 0x2017
102 #define WGL_GREEN_SHIFT_ARB 0x2018
103 #define WGL_BLUE_BITS_ARB 0x2019
104 #define WGL_BLUE_SHIFT_ARB 0x201A
105 #define WGL_ALPHA_BITS_ARB 0x201B
106 #define WGL_ALPHA_SHIFT_ARB 0x201C
107 #define WGL_ACCUM_BITS_ARB 0x201D
108 #define WGL_ACCUM_RED_BITS_ARB 0x201E
109 #define WGL_ACCUM_GREEN_BITS_ARB 0x201F
110 #define WGL_ACCUM_BLUE_BITS_ARB 0x2020
111 #define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
112 #define WGL_DEPTH_BITS_ARB 0x2022
113 #define WGL_STENCIL_BITS_ARB 0x2023
114 #define WGL_AUX_BUFFERS_ARB 0x2024
115 #define WGL_NO_ACCELERATION_ARB 0x2025
116 #define WGL_GENERIC_ACCELERATION_ARB 0x2026
117 #define WGL_FULL_ACCELERATION_ARB 0x2027
118 #define WGL_SWAP_EXCHANGE_ARB 0x2028
119 #define WGL_SWAP_COPY_ARB 0x2029
120 #define WGL_SWAP_UNDEFINED_ARB 0x202A
121 #define WGL_TYPE_RGBA_ARB 0x202B
122 #define WGL_TYPE_COLORINDEX_ARB 0x202C
123 #define WGL_SAMPLE_BUFFERS_ARB 0x2041
124 #define WGL_SAMPLES_ARB 0x2042
125 #endif
126 
127 #endif
#define OSGVIEWER_EXPORT
Definition: Export.h:40