Allow setting vsync.

This commit is contained in:
2024-01-21 13:04:45 -05:00
parent 842866600a
commit 62b2beff93
4 changed files with 7 additions and 7 deletions

View File

@@ -32,7 +32,7 @@ file(COPY "cfg" DESTINATION "${PROJECT_BINARY_DIR}")
CPMAddPackage(
NAME ReWindow
URL https://git.redacted.cc/Redacted/ReWindow/archive/vA0.2.2.zip
URL https://git.redacted.cc/Redacted/ReWindow/archive/vA0.2.5.zip
)
CPMAddPackage(

View File

@@ -38,6 +38,11 @@ public:
void initGL();
void debugInfo() const;
void loadConfig();
Engine() {
window = new(RWindow);
world = new(World);
}
};
inline auto* engine = new(Engine);

View File

@@ -19,7 +19,6 @@ float Engine::getGLVersion()
void Engine::initGL()
{
world = new(World);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
//glOrtho(-1.0f, 1.0f, -1.0f, 1.0f, -0.5f, 0.5f);

View File

@@ -8,13 +8,11 @@
void Render::pre_render() {
// NO
if (engine->frameCount == 0) {
engine->window = new(RWindow);
engine->window->init(RenderingAPI::OPENGL, "Re: 3D", 1152, 864);
engine->window->init(RenderingAPI::OPENGL, "Re: 3D", 1152, 864, false);
engine->window->setFlag(RWindowFlags::RESIZABLE, false);
engine->initGL();
engine->loadConfig();
auto* camera = new Camera();
//engine->world->addEntity(camera);
camera->SetPos({0.0f, -2.0f, -5.0f});
camera->angle.y = 0.0f;
camera->sMove.load("assets/scriptedMove/default.smov");
@@ -22,13 +20,11 @@ void Render::pre_render() {
auto *skybox = new Skybox();
skybox->draw = true;
//engine->world->addEntity(skybox);
skybox->SetParent(engine->world);
auto *player = new Player();
player->angle = {0, 0, 0};
player->SetPos({0,-2,0});
player->draw = true;
//engine->world->addEntity(player);
player->SetParent(engine->world);
}
//std::cout << engine->frameCount << std::endl;