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
|
42
main.cpp
42
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::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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user