From abc9a756dd118975b151818644ed738dfc09fe2a Mon Sep 17 00:00:00 2001 From: Redacted Date: Thu, 11 Jul 2024 12:40:06 -0400 Subject: [PATCH] aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa --- .gitignore | 6 ++++++ main.cpp | 44 +++++++++++++------------------------------- 2 files changed, 19 insertions(+), 31 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..52c505d --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/.idea +/.cache +/.ccls-cache +/compile_commands.json +/cmake-build-debug +/build diff --git a/main.cpp b/main.cpp index 1c56ece..eb5b498 100644 --- a/main.cpp +++ b/main.cpp @@ -17,60 +17,42 @@ class JUIDevelopmentTestWindow : public ReWindow::RWindow { public: + void initGL() { + gladLoadGL(); + JGL::Update(getSize()); + JGL::InitTextEngine(); + glClearColor(0.f, 0.f, 0.f, 0.f); + } + JUIDevelopmentTestWindow(const std::string& title, int w, int h) : ReWindow::RWindow(title, w, h) {} void OnRefresh(float elapsed) override { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - + JGL::Update(getSize()); JGL::J2D::Begin(); - JGL::J2D::FillRect(JGL::Color3(255,0,0), {0,0}, {50, 50}); + JGL::J2D::FillRect(JGL::Color3(255,0,0), {0,0}, {50, 50}); JGL::J2D::End(); - glSwapBuffers(); } - bool OnResizeRequest(const ReWindow::WindowResizeRequestEvent &e) override { - - } + //bool OnResizeRequest(const ReWindow::WindowResizeRequestEvent &e) override {} + JUIDevelopmentTestWindow() : ReWindow::RWindow() {} }; int main() { - - auto* window = new JUIDevelopmentTestWindow("Test Window", 600, 480); - - - window->setRenderer(RenderingAPI::OPENGL); - - - window->Open(); - - gladLoadGL(); - JGL::InitTextEngine(); - - - - glClearColor(0.f, 0.f, 0.f, 0.f); - glViewport(0,0,600,480); - - - + window->initGL(); window->setFullscreen(false); window->setVsyncEnabled(false); window->setResizable(true); - - - while (window->isAlive()) { window->pollEvents(); window->refresh(); + window->glSwapBuffers(); } - std::cout << "Hello, World!" << std::endl; return 0; }