]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix compilation of sdl and server builds when SUPPORTD3D is defined
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 19 Aug 2010 17:44:57 +0000 (17:44 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 19 Aug 2010 17:44:57 +0000 (17:44 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10407 d7cf8633-e32d-0410-b094-e92efae38249

vid_shared.c
vid_wgl.c

index fccb1e4ab61a46b73cec3c676de238181bfcaf63..eb665eedc6c39abf013ba86b5bcabc54260f7829 100644 (file)
@@ -6,6 +6,15 @@
 #include <Cg/cgGL.h>
 #endif
 
+#ifdef SUPPORTD3D
+#include <d3d9.h>
+#ifdef _MSC_VER
+#pragma comment(lib, "d3d9.lib")
+#endif
+
+LPDIRECT3DDEVICE9 vid_d3d9dev;
+#endif
+
 // global video state
 viddef_t vid;
 
index fb98973c15116f187f61aeabb0559bf853157181..832ceb05466ee099989d552b5f7c216044251257 100644 (file)
--- 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 <d3d9.h>
-#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