From: havoc Date: Thu, 19 Aug 2010 17:44:57 +0000 (+0000) Subject: fix compilation of sdl and server builds when SUPPORTD3D is defined X-Git-Tag: xonotic-v0.1.0preview~230^2~75 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a03b36647e6f8648eb9cec6170b226a707452012;p=xonotic%2Fdarkplaces.git fix compilation of sdl and server builds when SUPPORTD3D is defined git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10407 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/vid_shared.c b/vid_shared.c index fccb1e4a..eb665eed 100644 --- a/vid_shared.c +++ b/vid_shared.c @@ -6,6 +6,15 @@ #include #endif +#ifdef SUPPORTD3D +#include +#ifdef _MSC_VER +#pragma comment(lib, "d3d9.lib") +#endif + +LPDIRECT3DDEVICE9 vid_d3d9dev; +#endif + // global video state viddef_t vid; diff --git a/vid_wgl.c b/vid_wgl.c index fb98973c..832ceb05 100644 --- a/vid_wgl.c +++ b/vid_wgl.c @@ -48,9 +48,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifdef SUPPORTD3D #include -#ifdef _MSC_VER -#pragma comment(lib, "d3d9.lib") -#endif cvar_t vid_dx9 = {CVAR_SAVE, "vid_dx9", "0", "use Microsoft Direct3D9(r) for rendering"}; cvar_t vid_dx9_hal = {CVAR_SAVE, "vid_dx9_hal", "1", "enables hardware rendering (1), otherwise software reference rasterizer (0 - very slow), note that 0 is necessary when using NVPerfHUD (which renders in hardware but requires this option to enable it)"}; @@ -60,19 +57,19 @@ cvar_t vid_dx9_triplebuffer = {CVAR_SAVE, "vid_dx9_triplebuffer", "0", "enables //cvar_t vid_dx11 = {CVAR_SAVE, "vid_dx11", "1", "use Microsoft Direct3D11(r) for rendering"}; D3DPRESENT_PARAMETERS vid_d3dpresentparameters; -#endif -extern HINSTANCE global_hInstance; - -static HINSTANCE gldll; +// we declare this in vid_shared.c because it is required by dedicated server and all clients when SUPPORTD3D is defined +extern LPDIRECT3DDEVICE9 vid_d3d9dev; -#ifdef SUPPORTD3D LPDIRECT3D9 vid_d3d9; -LPDIRECT3DDEVICE9 vid_d3d9dev; D3DCAPS9 vid_d3d9caps; qboolean vid_d3ddevicelost; #endif +extern HINSTANCE global_hInstance; + +static HINSTANCE gldll; + #ifndef WM_MOUSEWHEEL #define WM_MOUSEWHEEL 0x020A #endif