work on renderer

This commit is contained in:
2026-02-08 17:29:56 -06:00
parent f277dee1f7
commit 086e5f5126
5 changed files with 128 additions and 37 deletions

View File

@@ -1,7 +1,5 @@
#if WINDOW == 1
#ifndef WINDOW_GLFW
#define WINDOW_GLFW
#ifdef WINDOW_GLFW
#undef WINDOW_GLFW
#include "pch.hpp"
@@ -30,11 +28,13 @@ namespace Archimedes {
std::cout << "glfwInit failed!\n";
std::abort();
}
#if RENDRER == 1
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
#endif
if(renderer) {
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
}
window = glfwCreateWindow(640, 480, "Archimedes", NULL, NULL);
if(!w) {
@@ -134,5 +134,3 @@ namespace Archimedes {
}
#endif
#endif

View File

@@ -1,7 +1,5 @@
#if WINDOW == 2
#ifndef WINDOW_SDL3
#define WINDOW_SDL3
#ifdef WINDOW_SDL3
#undef WINDOW_SDL3
#include "pch.hpp"
@@ -9,7 +7,7 @@
#include <SDL3/SDL.h>
#if RENDERER == 2
#if RENDERER == 1
#include <SDL3/SDL_opengl.h>
@@ -136,7 +134,7 @@ namespace Archimedes {
while(SDL_PollEvent(&e));
}
WindowSDL3* getWindowImpl() { return this; };
WindowSDL3* getWindowImpl() override { return this; };
#if RENDERER == 1
void restoreContext() { SDL_GL_MakeCurrent(window, gl_context); }
@@ -167,5 +165,3 @@ namespace Archimedes {
}
#endif
#endif