Tried something
This commit is contained in:
57
main.cpp
57
main.cpp
@@ -19,6 +19,7 @@
|
|||||||
#if G3D_VER < 61000
|
#if G3D_VER < 61000
|
||||||
#error Requires G3D 6.10
|
#error Requires G3D 6.10
|
||||||
#endif
|
#endif
|
||||||
|
HWND hwnd;
|
||||||
static const float VNUM = 0.01F;
|
static const float VNUM = 0.01F;
|
||||||
static std::string title = "";
|
static std::string title = "";
|
||||||
static const std::string VERSION = "PRE-ALPHA ";
|
static const std::string VERSION = "PRE-ALPHA ";
|
||||||
@@ -711,9 +712,65 @@ App::~App() {
|
|||||||
delete applet;
|
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) {
|
int main(int argc, char** argv) {
|
||||||
//_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
|
//_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
|
||||||
//_CrtSetBreakAlloc(1279);
|
//_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;
|
GAppSettings settings;
|
||||||
if(getOSVersion() > 5.0)
|
if(getOSVersion() > 5.0)
|
||||||
settings.window.defaultIconFilename = GetFileInPath("/content/images/rico.png");
|
settings.window.defaultIconFilename = GetFileInPath("/content/images/rico.png");
|
||||||
|
|||||||
Reference in New Issue
Block a user