1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox OpenGL windows helper functions
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License as published by the Free Software Foundation,
|
---|
13 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
14 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
15 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * If you received this file as part of a commercial VirtualBox
|
---|
18 | * distribution, then only the terms of your commercial VirtualBox
|
---|
19 | * license agreement apply instead of the previous paragraph.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef __VBOXGLWIN__H
|
---|
23 | #define __VBOXGLWIN__H
|
---|
24 |
|
---|
25 | #include <iprt/types.h>
|
---|
26 |
|
---|
27 | #ifdef __WIN__
|
---|
28 | #define VBOX_OGL_DEBUG_WINDOW_OUTPUT
|
---|
29 | #endif
|
---|
30 |
|
---|
31 | #ifdef VBOX_OGL_DEBUG_WINDOW_OUTPUT
|
---|
32 | #define VBOX_OGL_GUEST_TO_HOST_HDC(a) pClient->hdc
|
---|
33 | #else
|
---|
34 | #define VBOX_OGL_GUEST_TO_HOST_HDC(a) a
|
---|
35 | #endif
|
---|
36 |
|
---|
37 | typedef struct
|
---|
38 | {
|
---|
39 | uint64_t lastretval;
|
---|
40 | uint32_t ulLastError;
|
---|
41 |
|
---|
42 | bool fHasLastError;
|
---|
43 |
|
---|
44 | uint8_t *pLastParam;
|
---|
45 | uint32_t cbLastParam;
|
---|
46 |
|
---|
47 | #ifdef VBOX_OGL_DEBUG_WINDOW_OUTPUT
|
---|
48 | HWND hwnd;
|
---|
49 | HDC hdc;
|
---|
50 | #endif
|
---|
51 | } VBOXOGLCTX, *PVBOXOGLCTX;
|
---|
52 |
|
---|
53 |
|
---|
54 | #ifndef __WIN__
|
---|
55 |
|
---|
56 | typedef uint32_t DWORD;
|
---|
57 | typedef uint16_t WORD;
|
---|
58 | typedef uint8_t BYTE;
|
---|
59 | typedef BYTE BOOL;
|
---|
60 | typedef RTGCUINTPTR HANDLE;
|
---|
61 | typedef HANDLE HDC;
|
---|
62 | typedef HANDLE HGLRC;
|
---|
63 | typedef uint32_t UINT;
|
---|
64 | typedef uint32_t COLORREF;
|
---|
65 | typedef void VOID;
|
---|
66 | typedef void * LPVOID;
|
---|
67 | typedef int16_t SHORT;
|
---|
68 | typedef uint16_t USHORT;
|
---|
69 | typedef int64_t INT64;
|
---|
70 | typedef int32_t INT32;
|
---|
71 | typedef float FLOAT; /* ??? */
|
---|
72 |
|
---|
73 | #define DECLARE_HANDLE(a) typedef HANDLE a
|
---|
74 | #define WINAPI
|
---|
75 |
|
---|
76 | typedef struct
|
---|
77 | {
|
---|
78 | WORD nSize;
|
---|
79 | WORD nVersion;
|
---|
80 | DWORD dwFlags;
|
---|
81 | BYTE iPixelType;
|
---|
82 | BYTE cColorBits;
|
---|
83 | BYTE cRedBits;
|
---|
84 | BYTE cRedShift;
|
---|
85 | BYTE cGreenBits;
|
---|
86 | BYTE cGreenShift;
|
---|
87 | BYTE cBlueBits;
|
---|
88 | BYTE cBlueShift;
|
---|
89 | BYTE cAlphaBits;
|
---|
90 | BYTE cAlphaShift;
|
---|
91 | BYTE cAccumBits;
|
---|
92 | BYTE cAccumRedBits;
|
---|
93 | BYTE cAccumGreenBits;
|
---|
94 | BYTE cAccumBlueBits;
|
---|
95 | BYTE cAccumAlphaBits;
|
---|
96 | BYTE cDepthBits;
|
---|
97 | BYTE cStencilBits;
|
---|
98 | BYTE cAuxBuffers;
|
---|
99 | BYTE iLayerType;
|
---|
100 | BYTE bReserved;
|
---|
101 | DWORD dwLayerMask;
|
---|
102 | DWORD dwVisibleMask;
|
---|
103 | DWORD dwDamageMask;
|
---|
104 | } PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
|
---|
105 |
|
---|
106 | typedef struct
|
---|
107 | {
|
---|
108 | WORD nSize;
|
---|
109 | WORD nVersion;
|
---|
110 | DWORD dwFlags;
|
---|
111 | BYTE iPixelType;
|
---|
112 | BYTE cColorBits;
|
---|
113 | BYTE cRedBits;
|
---|
114 | BYTE cRedShift;
|
---|
115 | BYTE cGreenBits;
|
---|
116 | BYTE cGreenShift;
|
---|
117 | BYTE cBlueBits;
|
---|
118 | BYTE cBlueShift;
|
---|
119 | BYTE cAlphaBits;
|
---|
120 | BYTE cAlphaShift;
|
---|
121 | BYTE cAccumBits;
|
---|
122 | BYTE cAccumRedBits;
|
---|
123 | BYTE cAccumGreenBits;
|
---|
124 | BYTE cAccumBlueBits;
|
---|
125 | BYTE cAccumAlphaBits;
|
---|
126 | BYTE cDepthBits;
|
---|
127 | BYTE cStencilBits;
|
---|
128 | BYTE cAuxBuffers;
|
---|
129 | BYTE iLayerPlane;
|
---|
130 | BYTE bReserved;
|
---|
131 | COLORREF crTransparent;
|
---|
132 | } LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, LPLAYERPLANEDESCRIPTOR;
|
---|
133 |
|
---|
134 | #endif
|
---|
135 |
|
---|
136 | void vboxglDrvReleaseContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
137 | void vboxglDrvCreateContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
138 | void vboxglDrvDeleteContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
139 | void vboxglDrvCopyContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
140 | void vboxglDrvSetContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
141 | void vboxglDrvCreateLayerContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
142 | void vboxglDrvShareLists(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
143 | void vboxglDrvDescribeLayerPlane(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
144 | void vboxglDrvSetLayerPaletteEntries(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
145 | void vboxglDrvGetLayerPaletteEntries(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
146 | void vboxglDrvRealizeLayerPalette(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
147 | void vboxglDrvSwapLayerBuffers(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
148 | void vboxglDrvDescribePixelFormat(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
149 | void vboxglDrvSetPixelFormat(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
150 | void vboxglDrvSwapBuffers(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
151 |
|
---|
152 |
|
---|
153 | RTUINTPTR vboxDrvIsExtensionAvailable(char *pszExtFunctionName);
|
---|
154 |
|
---|
155 | #endif /* __VBOXGLWIN__H */
|
---|