Author: mbosma
Date: Sun Jun 10 15:42:58 2007
New Revision: 27110
URL:
http://svn.reactos.org/svn/reactos?rev=27110&view=rev
Log:
- some rearrangement
- tests for GetPrivateData, SetPrivateData, FreePrivateData of IDirectDrawSurface
Added:
trunk/rostests/dxtest/ddraw/DDraw/
- copied from r27104, trunk/rostests/dxtest/ddraw/tests/
trunk/rostests/dxtest/ddraw/Surface/
trunk/rostests/dxtest/ddraw/Surface/overlay.cpp (with props)
trunk/rostests/dxtest/ddraw/helper.cpp (with props)
Removed:
trunk/rostests/dxtest/ddraw/tests/
Modified:
trunk/rostests/dxtest/ddraw/DDraw/CreateDDraw.cpp
trunk/rostests/dxtest/ddraw/ddraw.rbuild
trunk/rostests/dxtest/ddraw/testlist.cpp
Modified: trunk/rostests/dxtest/ddraw/DDraw/CreateDDraw.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/dxtest/ddraw/DDraw/Create…
==============================================================================
--- trunk/rostests/dxtest/ddraw/DDraw/CreateDDraw.cpp (original)
+++ trunk/rostests/dxtest/ddraw/DDraw/CreateDDraw.cpp Sun Jun 10 15:42:58 2007
@@ -421,29 +421,3 @@
return TRUE;
}
-
-
-LONG WINAPI BasicWindowProc (HWND hwnd, UINT message, UINT wParam, LONG lParam)
-{
- switch (message)
- {
- case WM_DESTROY:
- {
- PostQuitMessage (0);
- return 0;
- } break;
- }
-
- return DefWindowProc (hwnd, message, wParam, lParam);
-}
-
-HWND CreateBasicWindow (VOID)
-{
- WNDCLASS wndclass = {0};
- wndclass.lpfnWndProc = BasicWindowProc;
- wndclass.hInstance = GetModuleHandle(NULL);
- wndclass.lpszClassName = "DDrawTest";
- RegisterClass(&wndclass);
-
- return CreateWindow("DDrawTest", "ReactOS DirectDraw Test",
WS_POPUP, 0, 0, 10, 10, NULL, NULL, GetModuleHandle(NULL), NULL);
-}
Added: trunk/rostests/dxtest/ddraw/Surface/overlay.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/dxtest/ddraw/Surface/over…
==============================================================================
--- trunk/rostests/dxtest/ddraw/Surface/overlay.cpp (added)
+++ trunk/rostests/dxtest/ddraw/Surface/overlay.cpp Sun Jun 10 15:42:58 2007
@@ -1,0 +1,7 @@
+//AddOverlayDirtyRect
+//EnumOverlayZOrders
+//GetOverlayPosition
+//SetOverlayPosition
+//UpdateOverlay
+//UpdateOverlayDisplay
+//UpdateOverlayZOrder
Propchange: trunk/rostests/dxtest/ddraw/Surface/overlay.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/rostests/dxtest/ddraw/Surface/overlay.cpp
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: trunk/rostests/dxtest/ddraw/ddraw.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/dxtest/ddraw/ddraw.rbuild…
==============================================================================
--- trunk/rostests/dxtest/ddraw/ddraw.rbuild (original)
+++ trunk/rostests/dxtest/ddraw/ddraw.rbuild Sun Jun 10 15:42:58 2007
@@ -9,5 +9,6 @@
<library>ddraw</library>
<library>dxguid</library>
<file>ddraw_test.cpp</file>
+ <file>helper.cpp</file>
<file>testlist.cpp</file>
</module>
Added: trunk/rostests/dxtest/ddraw/helper.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/dxtest/ddraw/helper.cpp?r…
==============================================================================
--- trunk/rostests/dxtest/ddraw/helper.cpp (added)
+++ trunk/rostests/dxtest/ddraw/helper.cpp Sun Jun 10 15:42:58 2007
@@ -1,0 +1,74 @@
+#include "ddrawtest.h"
+
+LONG WINAPI BasicWindowProc (HWND hwnd, UINT message, UINT wParam, LONG lParam)
+{
+ switch (message)
+ {
+ case WM_DESTROY:
+ {
+ PostQuitMessage (0);
+ return 0;
+ } break;
+ }
+
+ return DefWindowProc (hwnd, message, wParam, lParam);
+}
+
+HWND CreateBasicWindow (VOID)
+{
+ WNDCLASS wndclass = {0};
+ wndclass.lpfnWndProc = BasicWindowProc;
+ wndclass.hInstance = GetModuleHandle(NULL);
+ wndclass.lpszClassName = "DDrawTest";
+ RegisterClass(&wndclass);
+
+ return CreateWindow("DDrawTest", "ReactOS DirectDraw Test",
WS_POPUP, 0, 0, 10, 10, NULL, NULL, GetModuleHandle(NULL), NULL);
+}
+
+
+BOOL CreateSurface(LPDIRECTDRAWSURFACE7* pSurface)
+{
+ LPDIRECTDRAW7 DirectDraw;
+ LPDIRECTDRAWSURFACE7 Surface;
+ HWND hwnd;
+
+ // Create DDraw Object
+ if (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw7, NULL) != DD_OK)
+ {
+ printf("ERROR: Failed to set up ddraw\n");
+ return FALSE;
+ }
+
+ if(!( hwnd = CreateBasicWindow() ))
+ {
+ printf("ERROR: Failed to create window\n");
+ DirectDraw->Release();
+ return FALSE;
+ }
+
+ if (DirectDraw->SetCooperativeLevel (hwnd, DDSCL_NORMAL) != DD_OK)
+ {
+ printf("ERROR: Could not set cooperative level\n");
+ DirectDraw->Release();
+ return 0;
+ }
+
+ // Creat Surface
+ DDSURFACEDESC2 Desc = { 0 };
+ Desc.dwHeight = 200;
+ Desc.dwWidth = 200;
+ Desc.dwSize = sizeof (DDSURFACEDESC2);
+ Desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
+ Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
+
+ if(DirectDraw->CreateSurface(&Desc, &Surface, NULL) != DD_OK)
+ {
+ printf("ERROR: Faild to create Surface\n");
+ return FALSE;
+ }
+
+ DirectDraw->Release();
+
+ *pSurface = Surface;
+ return TRUE;
+}
Propchange: trunk/rostests/dxtest/ddraw/helper.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/rostests/dxtest/ddraw/helper.cpp
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: trunk/rostests/dxtest/ddraw/testlist.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/dxtest/ddraw/testlist.cpp…
==============================================================================
--- trunk/rostests/dxtest/ddraw/testlist.cpp (original)
+++ trunk/rostests/dxtest/ddraw/testlist.cpp Sun Jun 10 15:42:58 2007
@@ -5,14 +5,14 @@
#include "debug.cpp"
/* include the tests */
-#include "tests/CreateDDraw.cpp"
-#include "tests/DisplayModes.cpp"
-#include "tests/CreateSurface.cpp"
+#include "DDraw/CreateDDraw.cpp"
+#include "DDraw/DisplayModes.cpp"
+#include "DDraw/CreateSurface.cpp"
+#include "Surface/private_data.cpp"
/* The List of tests */
TEST TestList[] =
{
-
{ "IDirectDraw: COM Stuff", Test_CreateDDraw },
{ "IDirectDraw: GetDeviceIdentifier", Test_GetDeviceIdentifier },
{ "IDirectDraw: Display Frequency", Test_GetMonitorFrequency },
@@ -21,6 +21,7 @@
{ "IDirectDraw: GetFourCC", Test_GetFourCCCodes },
{ "IDirectDraw: Cooperative Levels", Test_SetCooperativeLevel },
{ "IDirectDraw: CreateSurface", Test_CreateSurface },
+ { "IDirectDrawSurface: Private Data", Test_PrivateData },
};
/* The function that gives us the number of tests */