| 6 |
|
#include "BFW_Utility.h" |
| 7 |
|
|
| 8 |
|
#include "Oni.h" |
| 9 |
< |
|
| 9 |
> |
extern HWND onihwnd; |
| 10 |
|
short ONICALL DDrPlatform_Initialize(ONtPlatformData *PlatformData) |
| 11 |
|
{ |
| 12 |
|
WNDCLASSEX WndClass; |
| 13 |
|
RECT Rect; |
| 14 |
|
const int Width = 640, Height = 480; |
| 15 |
+ |
HINSTANCE temp_Instance = PlatformData->Instance; |
| 16 |
|
|
| 17 |
|
PlatformData->Instance = g_Instance; |
| 18 |
|
|
| 22 |
|
WndClass.cbWndExtra = 0; |
| 23 |
|
WndClass.hInstance = PlatformData->Instance; |
| 24 |
|
WndClass.hCursor = LoadCursor(NULL, IDC_ARROW); |
| 25 |
< |
WndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); |
| 26 |
< |
WndClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION); |
| 25 |
> |
WndClass.hIcon = LoadIcon(g_Instance, MAKEINTRESOURCE(103) ); |
| 26 |
> |
WndClass.hIconSm = LoadIcon(g_Instance, MAKEINTRESOURCE(103)); |
| 27 |
|
WndClass.hbrBackground = GetStockObject(BLACK_BRUSH); |
| 28 |
|
WndClass.lpszMenuName = NULL; |
| 29 |
|
WndClass.lpszClassName = "ONI "; |
| 36 |
|
Rect.right = Rect.left + Width; |
| 37 |
|
Rect.bottom = Rect.top + Height; |
| 38 |
|
AdjustWindowRect(&Rect, WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_POPUP | WS_TILEDWINDOW , FALSE); |
| 39 |
< |
PlatformData->Window = CreateWindowEx(0, "ONI ", "ONI ", WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_POPUP | WS_TILEDWINDOW, Rect.left, Rect.top, Rect.right - Rect.left, Rect.bottom - Rect.top, NULL, NULL, PlatformData->Instance, NULL); |
| 40 |
< |
|
| 39 |
> |
PlatformData->Window = CreateWindowEx(0, "ONI ", "ONI ", WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_POPUP | WS_TILEDWINDOW, Rect.left, Rect.top, Rect.right - Rect.left, Rect.bottom - Rect.top, NULL, NULL, PlatformData->Instance, NULL); |
| 40 |
> |
onihwnd = PlatformData->Window; |
| 41 |
|
ShowWindow(PlatformData->Window, SW_SHOWNORMAL); |
| 42 |
|
UpdateWindow(PlatformData->Window); |
| 43 |
|
|
| 45 |
|
|
| 46 |
|
// I dont know why this is needed but Oni doesn't init without it. |
| 47 |
|
ONgPlatformData.Window = PlatformData->Window; |
| 48 |
< |
//ONgPlatformData.Instance = PlatformData->Instance; |
| 48 |
> |
ONgPlatformData.Instance = PlatformData->Instance; |
| 49 |
|
|
| 50 |
|
return 0; |
| 51 |
|
} |