1 /* User-based primary surface driver
3 * Copyright 2000 TransGaming Technologies Inc.
13 #include "debugtools.h"
14 #include "ddraw_private.h"
16 DEFAULT_DEBUG_CHANNEL(ddraw);
18 static LRESULT WINAPI DirectDrawSurface_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
20 void DirectDrawSurface_RegisterClass(void)
23 memset(&wc, 0, sizeof(wc));
24 wc.lpfnWndProc = DirectDrawSurface_WndProc;
25 wc.cbWndExtra = sizeof(IDirectDrawSurfaceImpl*);
26 wc.hCursor = (HCURSOR)IDC_ARROWA;
27 wc.lpszClassName = "WINE_DDRAW";
31 void DirectDrawSurface_UnregisterClass(void)
33 UnregisterClassA("WINE_DDRAW", 0);
36 static LRESULT WINAPI DirectDrawSurface_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
38 IDirectDrawSurfaceImpl *This;
41 This = (IDirectDrawSurfaceImpl *)GetWindowLongA(hwnd, 0);
43 HWND window = This->ddraw_owner->window;
49 case WM_WINDOWPOSCHANGING:
50 case WM_WINDOWPOSCHANGED:
54 /* since we're pretending fullscreen,
55 * let's not pass these on to the app */
56 ret = DefWindowProcA(hwnd, msg, wParam, lParam);
61 case WM_MOUSEACTIVATE:
68 dc = BeginPaint(hwnd, &ps);
69 /* call User_copy_to_screen? */
75 ret = window ? SendMessageA(window, msg, wParam, lParam)
76 : DefWindowProcA(hwnd, msg, wParam, lParam);
79 if (msg == WM_CREATE) {
80 CREATESTRUCTA *cs = (CREATESTRUCTA *)lParam;
81 This = (IDirectDrawSurfaceImpl *)cs->lpCreateParams;
82 SetWindowLongA(hwnd, 0, (LONG)This);
84 ret = DefWindowProcA(hwnd, msg, wParam, lParam);