ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/Daodan_Win32.c
(Generate patch)

Comparing Daodan/src/Daodan_Win32.c (file contents):
Revision 322 by rossy, Fri May 15 11:45:19 2009 UTC vs.
Revision 323 by rossy, Sun May 17 12:19:35 2009 UTC

# Line 0 | Line 1
1 + #include <windows.h>
2 +
3 + #include "Daodan.h"
4 + #include "Daodan_Win32.h"
5 +
6 + #include "Oni.h"
7 +
8 + short ONICALL DDrPlatform_Initialize(ONtPlatformData *PlatformData)
9 + {
10 +        WNDCLASSEX WndClass;
11 +        RECT Rect;
12 +        const int Width = 640, Height = 480;
13 +
14 +        PlatformData->Instance = g_Instance;
15 +
16 +        WndClass.cbSize = sizeof(WndClass);
17 +        WndClass.style = WS_OVERLAPPED | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | CS_VREDRAW | CS_HREDRAW | CS_OWNDC;
18 +        WndClass.cbClsExtra = 0;
19 +        WndClass.cbWndExtra = 0;
20 +        WndClass.hInstance = PlatformData->Instance;
21 +        WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
22 +        WndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
23 +        WndClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
24 +        WndClass.hbrBackground = GetStockObject(BLACK_BRUSH);
25 +        WndClass.lpszMenuName = NULL;
26 +        WndClass.lpszClassName = "ONI ";
27 +        WndClass.lpfnWndProc = ONrPlatform_WindowProc;
28 +
29 +        RegisterClassEx(&WndClass);
30 +        
31 +        Rect.left = (GetSystemMetrics(SM_CXSCREEN) / 2) - (Width / 2);
32 +        Rect.top = (GetSystemMetrics(SM_CYSCREEN) / 2) - (Height / 2);
33 +        Rect.right = Rect.left + Width;
34 +        Rect.bottom = Rect.top + Height;
35 +        AdjustWindowRect(&Rect, WndClass.style, FALSE);
36 +
37 +        PlatformData->Window = CreateWindowEx(0, "ONI ", "ONI ", WS_POPUP, Rect.left, Rect.top, Rect.right - Rect.left, Rect.bottom - Rect.top, NULL, NULL, PlatformData->Instance, NULL);
38 +        ShowWindow(PlatformData->Window, SW_SHOWNORMAL);
39 +        UpdateWindow(PlatformData->Window);
40 +
41 +        ShowCursor(FALSE);
42 +
43 +        return 0;
44 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)