1 | /* $Id: switcher.h 40587 2012-03-23 09:08:44Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VBox D3D8/9 dll switcher
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2009 Oracle Corporation
|
---|
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 |
|
---|
19 | #ifndef ___CROPENGL_SWITCHER_H_
|
---|
20 | #define ___CROPENGL_SWITCHER_H_
|
---|
21 |
|
---|
22 | typedef BOOL (APIENTRY *DrvValidateVersionProc)(DWORD version);
|
---|
23 |
|
---|
24 | #define SW_FILLPROC(dispatch, hdll, name) \
|
---|
25 | dispatch.p##name = ((hdll) != NULL) ? (name##Proc) GetProcAddress((hdll), #name) : vbox##name##Stub;
|
---|
26 |
|
---|
27 | #define SW_DISPINIT(dispatch) \
|
---|
28 | { \
|
---|
29 | if (!dispatch.initialized) \
|
---|
30 | { \
|
---|
31 | InitD3DExports(dispatch.vboxName, dispatch.msName); \
|
---|
32 | dispatch.initialized = 1; \
|
---|
33 | } \
|
---|
34 | }
|
---|
35 |
|
---|
36 | #define SW_CHECKRET(dispatch, func, failret) \
|
---|
37 | { \
|
---|
38 | SW_DISPINIT(dispatch) \
|
---|
39 | if (!dispatch.p##func) \
|
---|
40 | return failret; \
|
---|
41 | }
|
---|
42 |
|
---|
43 | #define SW_CHECKCALL(dispatch, func) \
|
---|
44 | { \
|
---|
45 | SW_DISPINIT(dispatch) \
|
---|
46 | if (!dispatch.p##func) return; \
|
---|
47 | }
|
---|
48 |
|
---|
49 | extern BOOL IsVBox3DEnabled(void);
|
---|
50 | extern BOOL CheckOptions(void);
|
---|
51 | extern void FillD3DExports(HANDLE hDLL);
|
---|
52 | extern void InitD3DExports(const char *vboxName, const char *msName);
|
---|
53 |
|
---|
54 | #endif /* #ifndef ___CROPENGL_SWITCHER_H_ */
|
---|