summaryrefslogtreecommitdiff
path: root/Editor/main.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-11-10 18:46:11 +0800
committerchai <chaifix@163.com>2020-11-10 18:46:11 +0800
commit59e6235113a4d933811aa2cf6fdc8282ce394b9d (patch)
tree12410a230c5339ca88be6842c0dc811d5c6ec0ba /Editor/main.cpp
parentf0807fc44dde14531759306317611bab87c8fccf (diff)
*window
Diffstat (limited to 'Editor/main.cpp')
-rw-r--r--Editor/main.cpp76
1 files changed, 33 insertions, 43 deletions
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 <glad/glad.h>
-#include <windows.h>
-
-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 <windows.h>
+#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;
+}