Files
ReJUI/main.cpp

59 lines
1.6 KiB
C++

/// Josh's User Interface Library
/// A C++20 Library for creating, styling, and rendering of a UI/UX widgets.
/// Developed and Maintained by Josh O'Leary @ Redacted Software.
/// Special Thanks to William Tomasine II and Maxine Hayes.
/// (c) 2024 Redacted Software
/// This work is dedicated to the public domain.
/// @file main.cpp
/// @desc Demo Program Entry Point
/// @edit 2024-07-11
#include <iostream>
#include <JGL/JGL.h>
#include <JUI/Scene.hpp>
#include <rewindow/types/window.h>
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);
JGL::Update(getSize());
JGL::J2D::Begin();
JGL::J2D::FillRect(JGL::Color3(255,0,0), {0,0}, {50, 50});
JGL::J2D::End();
}
//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();
window->initGL();
window->setFullscreen(false);
window->setVsyncEnabled(false);
window->setResizable(true);
while (window->isAlive()) {
window->pollEvents();
window->refresh();
window->glSwapBuffers();
}
return 0;
}