Tried something

This commit is contained in:
andreja6
2018-04-22 15:05:45 -07:00
parent 49c117d5d7
commit f0fffa71d4

View File

@@ -19,6 +19,7 @@
#if G3D_VER < 61000
#error Requires G3D 6.10
#endif
HWND hwnd;
static const float VNUM = 0.01F;
static std::string title = "";
static const std::string VERSION = "PRE-ALPHA ";
@@ -711,9 +712,65 @@ App::~App() {
delete applet;
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
int main(int argc, char** argv) {
//_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
//_CrtSetBreakAlloc(1279);
//Create container window
char className[] = "classContainerHWND";
WNDCLASSEX wc;
HINSTANCE hInstance = GetModuleHandle(NULL);
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = 0;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wc.lpszMenuName = NULL;
wc.lpszClassName = className;
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
if (!RegisterClassEx (&wc))
{
MessageBox(NULL, "Window registration failed! Please make sure your computer supports Win32 graphical components!", "Error! Cannot start Dynamica!", MB_ICONEXCLAMATION | MB_OK);
return -1;
}
hwnd = CreateWindowEx(
WS_EX_CLIENTEDGE,
className,
"Container Window",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,NULL, NULL, hInstance, NULL);
if(hwnd == NULL)
{
MessageBox(NULL, "Window Creation Failed! Please make sure your computer supports Win32 graphical components!", "Error! Cannot start Dynamica!", MB_ICONEXCLAMATION | MB_OK);
return -2;
}
ShowWindow(hwnd, SW_SHOW);
UpdateWindow(hwnd);
GAppSettings settings;
if(getOSVersion() > 5.0)
settings.window.defaultIconFilename = GetFileInPath("/content/images/rico.png");