Fix so our demo apps can be compile with vs, this mean we can now using our demo...
authorMagnus Olsen <magnus@greatlord.com>
Fri, 15 Jun 2007 14:46:18 +0000 (14:46 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Fri, 15 Jun 2007 14:46:18 +0000 (14:46 +0000)
svn path=/trunk/; revision=27190

rosapps/demos/ddraw/main.cpp

index f71be27..b393aa7 100644 (file)
@@ -1,9 +1,11 @@
 #include <windows.h>
+#include <ddrawi.h>
 #include <ddraw.h>
 
 LPDIRECTDRAW7 DirectDraw = NULL;
 LPDIRECTDRAWSURFACE7 FrontBuffer = NULL;
 LPDIRECTDRAWCLIPPER Clipper = NULL;
+LPDDRAWI_DIRECTDRAW_INT This = NULL;
 
 PCHAR DDErrorString (HRESULT hResult);
 LONG WINAPI WndProc (HWND hwnd, UINT message, UINT wParam, LONG lParam);
@@ -26,6 +28,8 @@ bool Init (HWND hwnd)
                return 0;
        }
 
+    This = (LPDDRAWI_DIRECTDRAW_INT)DirectDraw;
+
        // Set Fullscreen or windowed mode
        OutputDebugString("=> DDraw->SetCooperativeLevel\n");
 
@@ -143,7 +147,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
 {
        MSG msg;  
        WNDCLASS wndclass; 
-
+       HWND hwnd;
        Fullscreen = MessageBox(0, "Do you want to me to run in Fullscreen ?", 0, MB_YESNO) == IDYES;
 
        // Create windnow
@@ -160,19 +164,27 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
 
        RegisterClass(&wndclass);    
 
-       HWND hwnd = CreateWindow("DDrawDemo", 
-                         "ReactOS DirectDraw Demo", 
 #ifdef USE_CLIPPER
+       hwnd = CreateWindow("DDrawDemo", 
+                         "ReactOS DirectDraw Demo", 
                                                 Fullscreen ? WS_POPUP : WS_OVERLAPPEDWINDOW,
+                                                CW_USEDEFAULT, 
+                                                CW_USEDEFAULT,
+                                                800, 
+                                                600,     
+                                                NULL, NULL, 
+                                                hInst, NULL);
 #else
-                                                WS_POPUP,
-#endif 
-                                    CW_USEDEFAULT, 
+       hwnd = CreateWindow("DDrawDemo", 
+                         "ReactOS DirectDraw Demo", 
+                         WS_POPUP,
+                                                CW_USEDEFAULT, 
                                                 CW_USEDEFAULT,
-                         800, 
-                         600,     
-                         NULL, NULL, 
+                                                800, 
+                                                600,     
+                                                NULL, NULL, 
                                                 hInst, NULL);
+#endif
 
        // Inizalize Ddraw
        if(Init(hwnd))