aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
This commit is contained in:
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
/.idea
|
||||||
|
/.cache
|
||||||
|
/.ccls-cache
|
||||||
|
/compile_commands.json
|
||||||
|
/cmake-build-debug
|
||||||
|
/build
|
44
main.cpp
44
main.cpp
@@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user