1 | /** @file
|
---|
2 | *
|
---|
3 | * VirtualBox Windows NT/2000/XP guest OpenGL ICD
|
---|
4 | *
|
---|
5 | * ICD entry points.
|
---|
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 |
|
---|
23 | /*
|
---|
24 | * Mesa 3-D graphics library
|
---|
25 | * Version: 6.1
|
---|
26 | *
|
---|
27 | * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
---|
28 | *
|
---|
29 | * Permission is hereby granted, free of charge, to any person obtaining a
|
---|
30 | * copy of this software and associated documentation files (the "Software"),
|
---|
31 | * to deal in the Software without restriction, including without limitation
|
---|
32 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
---|
33 | * and/or sell copies of the Software, and to permit persons to whom the
|
---|
34 | * Software is furnished to do so, subject to the following conditions:
|
---|
35 | *
|
---|
36 | * The above copyright notice and this permission notice shall be included
|
---|
37 | * in all copies or substantial portions of the Software.
|
---|
38 | *
|
---|
39 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
---|
40 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
41 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
---|
42 | * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
---|
43 | * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
44 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
45 | */
|
---|
46 |
|
---|
47 | /*
|
---|
48 | * File name: icd.c
|
---|
49 | * Author: Gregor Anich
|
---|
50 | *
|
---|
51 | * ICD (Installable Client Driver) interface.
|
---|
52 | * Based on the windows GDI/WGL driver.
|
---|
53 | */
|
---|
54 |
|
---|
55 | #include "VBoxOGL.h"
|
---|
56 |
|
---|
57 | #define GL_FUNC(func) gl##func
|
---|
58 |
|
---|
59 | static ICDTABLE icdTable = { 336, {
|
---|
60 | #define ICD_ENTRY(func) (PROC)GL_FUNC(func),
|
---|
61 | #include "VBoxICDList.h"
|
---|
62 | #undef ICD_ENTRY
|
---|
63 | } };
|
---|
64 |
|
---|
65 |
|
---|
66 |
|
---|
67 | PROC APIENTRY DrvGetProcAddress(LPCSTR lpszProc)
|
---|
68 | {
|
---|
69 | PROC pfnProc = GetProcAddress(hDllVBoxOGL, lpszProc);
|
---|
70 | if (pfnProc == NULL)
|
---|
71 | DbgPrintf(("DrvGetProcAddress %s FAILED\n", lpszProc));
|
---|
72 | else
|
---|
73 | DbgPrintf(("DrvGetProcAddress %s\n", lpszProc));
|
---|
74 |
|
---|
75 | return pfnProc;
|
---|
76 | }
|
---|
77 |
|
---|
78 | /* Test export for directly linking with vboxogl.dll */
|
---|
79 | PROC WINAPI wglGetProcAddress(LPCSTR lpszProc)
|
---|
80 | {
|
---|
81 | return DrvGetProcAddress(lpszProc);
|
---|
82 | }
|
---|
83 |
|
---|
84 | BOOL APIENTRY DrvValidateVersion(DWORD version)
|
---|
85 | {
|
---|
86 | DbgPrintf(("DrvValidateVersion %x -> always TRUE\n", version));
|
---|
87 | return TRUE;
|
---|
88 | }
|
---|
89 |
|
---|
90 |
|
---|
91 | PICDTABLE APIENTRY DrvSetContext(HDC hdc, HGLRC hglrc, void *callback)
|
---|
92 | {
|
---|
93 | NOREF(callback);
|
---|
94 |
|
---|
95 | /* Note: we ignore the callback parameter here */
|
---|
96 | VBOX_OGL_GEN_SYNC_OP2(DrvSetContext, hdc, hglrc);
|
---|
97 | return &icdTable;
|
---|
98 | }
|
---|
99 |
|
---|
100 | /* Test export for directly linking with vboxogl.dll */
|
---|
101 | BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
|
---|
102 | {
|
---|
103 | DrvSetContext(hdc, hglrc, NULL);
|
---|
104 | return TRUE;
|
---|
105 | }
|
---|