1 | /* $Id: switcher.h 20508 2009-06-12 12:48:23Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VBox D3D8/9 dll switcher
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2009 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef ___CROPENGL_SWITCHER_H_
|
---|
24 | #define ___CROPENGL_SWITCHER_H_
|
---|
25 |
|
---|
26 | typedef BOOL (APIENTRY *DrvValidateVersionProc)(DWORD version);
|
---|
27 |
|
---|
28 | #define SW_FILLPROC(dispatch, hdll, name) \
|
---|
29 | dispatch.p##name = (name##Proc) GetProcAddress(hdll, #name);
|
---|
30 |
|
---|
31 | #define SW_DISPINIT(dispatch) \
|
---|
32 | { \
|
---|
33 | if (!dispatch.initialized) \
|
---|
34 | { \
|
---|
35 | InitD3DExports(dispatch.vboxName, dispatch.msName); \
|
---|
36 | dispatch.initialized = 1; \
|
---|
37 | } \
|
---|
38 | }
|
---|
39 |
|
---|
40 | #define SW_CHECKRET(dispatch, func, failret) \
|
---|
41 | { \
|
---|
42 | SW_DISPINIT(dispatch) \
|
---|
43 | if (!dispatch.p##func) \
|
---|
44 | return failret; \
|
---|
45 | }
|
---|
46 |
|
---|
47 | #define SW_CHECKCALL(dispatch, func) \
|
---|
48 | { \
|
---|
49 | SW_DISPINIT(dispatch) \
|
---|
50 | if (!dispatch.p##func) return; \
|
---|
51 | }
|
---|
52 |
|
---|
53 | extern BOOL IsVBox3DEnabled(void);
|
---|
54 | extern BOOL CheckOptions(void);
|
---|
55 | extern void FillD3DExports(HANDLE hDLL);
|
---|
56 | extern void InitD3DExports(const char *vboxName, const char *msName);
|
---|
57 |
|
---|
58 | #endif /* #ifndef ___CROPENGL_SWITCHER_H_ */
|
---|