aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

This commit is contained in:
2024-07-11 12:40:06 -04:00
parent 736478d627
commit abc9a756dd
2 changed files with 19 additions and 31 deletions

6
.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
/.idea
/.cache
/.ccls-cache
/compile_commands.json
/cmake-build-debug
/build

View File

@@ -17,60 +17,42 @@
class JUIDevelopmentTestWindow : public ReWindow::RWindow { class JUIDevelopmentTestWindow : public ReWindow::RWindow {
public: 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) {} JUIDevelopmentTestWindow(const std::string& title, int w, int h) : ReWindow::RWindow(title, w, h) {}
void OnRefresh(float elapsed) override { void OnRefresh(float elapsed) override {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW); JGL::Update(getSize());
glLoadIdentity();
JGL::J2D::Begin(); 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(); JGL::J2D::End();
glSwapBuffers();
} }
bool OnResizeRequest(const ReWindow::WindowResizeRequestEvent &e) override { //bool OnResizeRequest(const ReWindow::WindowResizeRequestEvent &e) override {}
JUIDevelopmentTestWindow() : ReWindow::RWindow() {}
}
}; };
int main() int main()
{ {
auto* window = new JUIDevelopmentTestWindow("Test Window", 600, 480); auto* window = new JUIDevelopmentTestWindow("Test Window", 600, 480);
window->setRenderer(RenderingAPI::OPENGL); window->setRenderer(RenderingAPI::OPENGL);
window->Open(); window->Open();
window->initGL();
gladLoadGL();
JGL::InitTextEngine();
glClearColor(0.f, 0.f, 0.f, 0.f);
glViewport(0,0,600,480);
window->setFullscreen(false); window->setFullscreen(false);
window->setVsyncEnabled(false); window->setVsyncEnabled(false);
window->setResizable(true); window->setResizable(true);
while (window->isAlive()) { while (window->isAlive()) {
window->pollEvents(); window->pollEvents();
window->refresh(); window->refresh();
window->glSwapBuffers();
} }
std::cout << "Hello, World!" << std::endl;
return 0; return 0;
} }