Files
ReJUI/main.cpp
2024-07-11 12:30:11 -04:00

77 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:
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::J2D::Begin();
JGL::J2D::FillRect(JGL::Color3(255,0,0), {0,0}, {50, 50});
JGL::J2D::End();
glSwapBuffers();
}
bool OnResizeRequest(const ReWindow::WindowResizeRequestEvent &e) override {
}
};
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->setFullscreen(false);
window->setVsyncEnabled(false);
window->setResizable(true);
while (window->isAlive()) {
window->pollEvents();
window->refresh();
}
std::cout << "Hello, World!" << std::endl;
return 0;
}