// Dark GDK - The Game Creators - www.thegamecreators.com

/*	===========================================================================
	Source File: Windows.cpp
	Created: 12/13/2014
	===========================================================================	*/

// whenever using Dark GDK you must ensure you include the header file
// DarkGDK.h - replaced by DarkGDKWindow.h
#include "DarkGDKWindow.h"

// helper that gets rid of 'unused variable' warnings.
#define UNUSED_VAR(x) {x;}

DWORD DisplayMode = 4;
        // 0 - hidden
        // 1 = windowed
        // 2 = crash ... should be desktop fullscreen?
        // 3 = exclusive fullscreen
        // 4 = fullscreen

DWORD DisplayWidth = 800;	// 640x480 fullscreen window
DWORD DisplayHeight = 600;
DWORD DisplayDepth = 32;	// only used for fullscreen-exclusive
char  ApplicationTitle[] = "Alliance";

// first required function
bool DarkGDKStart(void)
{
    // you can do startup stuff here
    return true;
}
// second required function
void DarkGDKInit(DWORD* pdwDisplayType, DWORD* pdwWidth, DWORD* pdwHeight, DWORD* pdwDepth, HINSTANCE* phInstance, LPSTR* ppApplicationName,HWND* ppParentHWND, DWORD* pdwInExStyle, DWORD* pdwInStyle)
{
	// initial window state
    *pdwDisplayType = DisplayMode;

    // override window sizes (does NOT set the display resolution)
    // use these to set the resolution when in windowed mode
    if (DisplayMode == 1) {
        *pdwWidth = DisplayWidth;
        *pdwHeight = DisplayHeight;
    }

    // override display depth
    // use this to set the depth when in full-screen exclusive mode
    if (DisplayMode == 3) {
        *pdwDepth = DisplayDepth;
    }

    // window title
    *ppApplicationName = ApplicationTitle;

    // set the parent window if needed
    UNUSED_VAR(*ppParentHWND);

    // use these to affect the window style of the GDK window.
    // didn't try too hard, but couldn't get these working.
    UNUSED_VAR(pdwInExStyle);
    UNUSED_VAR(pdwInStyle);

    // set the application instance - should never really need to use this
    UNUSED_VAR(*phInstance);
}
// third and final required function
int DarkGDKEnd(void)
{
    // don't bother filling this in as this function doesn't appear to get called.
    return 0;
}