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 |
|
---|
41 | uint8_t *pLastParam;
|
---|
42 | uint32_t cbLastParam;
|
---|
43 |
|
---|
44 | #ifdef VBOX_OGL_DEBUG_WINDOW_OUTPUT
|
---|
45 | HWND hwnd;
|
---|
46 | HDC hdc;
|
---|
47 | #endif
|
---|
48 | } VBOXOGLCTX, *PVBOXOGLCTX;
|
---|
49 |
|
---|
50 |
|
---|
51 | #ifndef __WIN__
|
---|
52 | typedef uint32_t DWORD;
|
---|
53 | typedef uint16_t WORD;
|
---|
54 | typedef uint8_t BYTE;
|
---|
55 | typedef BYTE BOOL;
|
---|
56 | typedef RTGCUINTPTR HANDLE;
|
---|
57 | typedef HANDLE HDC;
|
---|
58 | typedef HANDLE HGLRC;
|
---|
59 | typedef uint32_t UINT;
|
---|
60 | typedef uint32_t COLORREF;
|
---|
61 |
|
---|
62 | typedef struct
|
---|
63 | {
|
---|
64 | WORD nSize;
|
---|
65 | WORD nVersion;
|
---|
66 | DWORD dwFlags;
|
---|
67 | BYTE iPixelType;
|
---|
68 | BYTE cColorBits;
|
---|
69 | BYTE cRedBits;
|
---|
70 | BYTE cRedShift;
|
---|
71 | BYTE cGreenBits;
|
---|
72 | BYTE cGreenShift;
|
---|
73 | BYTE cBlueBits;
|
---|
74 | BYTE cBlueShift;
|
---|
75 | BYTE cAlphaBits;
|
---|
76 | BYTE cAlphaShift;
|
---|
77 | BYTE cAccumBits;
|
---|
78 | BYTE cAccumRedBits;
|
---|
79 | BYTE cAccumGreenBits;
|
---|
80 | BYTE cAccumBlueBits;
|
---|
81 | BYTE cAccumAlphaBits;
|
---|
82 | BYTE cDepthBits;
|
---|
83 | BYTE cStencilBits;
|
---|
84 | BYTE cAuxBuffers;
|
---|
85 | BYTE iLayerType;
|
---|
86 | BYTE bReserved;
|
---|
87 | DWORD dwLayerMask;
|
---|
88 | DWORD dwVisibleMask;
|
---|
89 | DWORD dwDamageMask;
|
---|
90 | } PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
|
---|
91 |
|
---|
92 | typedef struct
|
---|
93 | {
|
---|
94 | WORD nSize;
|
---|
95 | WORD nVersion;
|
---|
96 | DWORD dwFlags;
|
---|
97 | BYTE iPixelType;
|
---|
98 | BYTE cColorBits;
|
---|
99 | BYTE cRedBits;
|
---|
100 | BYTE cRedShift;
|
---|
101 | BYTE cGreenBits;
|
---|
102 | BYTE cGreenShift;
|
---|
103 | BYTE cBlueBits;
|
---|
104 | BYTE cBlueShift;
|
---|
105 | BYTE cAlphaBits;
|
---|
106 | BYTE cAlphaShift;
|
---|
107 | BYTE cAccumBits;
|
---|
108 | BYTE cAccumRedBits;
|
---|
109 | BYTE cAccumGreenBits;
|
---|
110 | BYTE cAccumBlueBits;
|
---|
111 | BYTE cAccumAlphaBits;
|
---|
112 | BYTE cDepthBits;
|
---|
113 | BYTE cStencilBits;
|
---|
114 | BYTE cAuxBuffers;
|
---|
115 | BYTE iLayerPlane;
|
---|
116 | BYTE bReserved;
|
---|
117 | COLORREF crTransparent;
|
---|
118 | } LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, LPLAYERPLANEDESCRIPTOR;
|
---|
119 |
|
---|
120 | #endif
|
---|
121 |
|
---|
122 | void vboxglDrvReleaseContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
123 | void vboxglDrvCreateContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
124 | void vboxglDrvDeleteContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
125 | void vboxglDrvCopyContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
126 | void vboxglDrvSetContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
127 | void vboxglDrvCreateLayerContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
128 | void vboxglDrvShareLists(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
129 | void vboxglDrvDescribeLayerPlane(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
130 | void vboxglDrvSetLayerPaletteEntries(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
131 | void vboxglDrvGetLayerPaletteEntries(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
132 | void vboxglDrvRealizeLayerPalette(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
133 | void vboxglDrvSwapLayerBuffers(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
134 | void vboxglDrvDescribePixelFormat(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
135 | void vboxglDrvSetPixelFormat(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
136 | void vboxglDrvSwapBuffers(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer);
|
---|
137 |
|
---|
138 | #endif /* __VBOXGLWIN__H */
|
---|