From 59e6235113a4d933811aa2cf6fdc8282ce394b9d Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 10 Nov 2020 18:46:11 +0800 Subject: *window --- Editor/main.cpp | 76 +++++++++++++++++++++++++-------------------------------- 1 file changed, 33 insertions(+), 43 deletions(-) (limited to 'Editor/main.cpp') diff --git a/Editor/main.cpp b/Editor/main.cpp index 58e5f04..193a52a 100644 --- a/Editor/main.cpp +++ b/Editor/main.cpp @@ -1,43 +1,33 @@ -extern "C" { -#include "wog.h" -} - -#include -#include - -wog_Window * wnd ; - -void* proc(const char *name) { - return wglGetProcAddress(name); -} - -int main(int argc, char* argv[]) { - wnd = wog_createWindow("GameLab" , 800, 600, 500, 500, 0); - wog_show(wnd); - - wog_GLContext* ctx = wog_createGLContext(wnd); - wog_makeCurrent(wnd, ctx); - - //gladLoadGLLoader(proc); - int load = gladLoadGL(); - -// wog_makeCurrent(wnd, ctx); - - while (true) { - wog_Event e; - while (wog_pollEvent(wnd, &e)) { - if (e.type == WOG_ECLOSE) - goto quit; - } - //glViewport(0, 0, 500, 500); - glClearColor(0.16, 0.16, 0.16, 1); - glClear(GL_COLOR_BUFFER_BIT); - glFlush(); - - wog_swapBuffers(wnd); - } - -quit: - - return 0; -} +#include +#include "GUI/EditorWindows.h" + +int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) +{ + RegisterWindowClasses(); + + ContainnerWindow* wnd = new ContainnerWindow(); + + Vector2f min = Vector2f(100, 100); + Vector2f max = Vector2f(700, 700); + wnd->Init(Rectf(400, 400, 500, 500), ContainnerWindow::ShowMode::kShowMainWindow, min, max); + + while (1) + { + MSG msg; + //if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + //{ + // if (msg.message == WM_QUIT) return 0; + // TranslateMessage(&msg); + //} + if (GetMessage(&msg, NULL, 0U, 0U) != 0) + { + //ResetGfxDeviceIfNeeded(); + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + } + + + return 0; +} -- cgit v1.1-26-g67d0 From 6f326b50d86fab5955a37fe317f14888662b055a Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 13 Nov 2020 19:18:49 +0800 Subject: +misc --- Editor/main.cpp | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 Editor/main.cpp (limited to 'Editor/main.cpp') diff --git a/Editor/main.cpp b/Editor/main.cpp deleted file mode 100644 index 193a52a..0000000 --- a/Editor/main.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include "GUI/EditorWindows.h" - -int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) -{ - RegisterWindowClasses(); - - ContainnerWindow* wnd = new ContainnerWindow(); - - Vector2f min = Vector2f(100, 100); - Vector2f max = Vector2f(700, 700); - wnd->Init(Rectf(400, 400, 500, 500), ContainnerWindow::ShowMode::kShowMainWindow, min, max); - - while (1) - { - MSG msg; - //if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - //{ - // if (msg.message == WM_QUIT) return 0; - // TranslateMessage(&msg); - //} - if (GetMessage(&msg, NULL, 0U, 0U) != 0) - { - //ResetGfxDeviceIfNeeded(); - TranslateMessage(&msg); - DispatchMessage(&msg); - } - - } - - - return 0; -} -- cgit v1.1-26-g67d0