This commit is contained in:
2025-03-22 01:45:25 -05:00
parent 8e81cd81dc
commit 4bd2d6908e
8 changed files with 46 additions and 27 deletions

View File

@@ -1,7 +1,5 @@
#include "RendererOpenGL.h"
#include "pch.hpp"
#define GLEW_STATIC
#include <GL/glew.h>
@@ -11,6 +9,10 @@ namespace Archimedes {
RendererOpenGL::~RendererOpenGL() {}
void RendererOpenGL::init() {
glewInit();
}
void RendererOpenGL::render(std::list<renderCmd*> cmdList, int& w, int& h) {
glViewport(0, 0, w, h);

View File

@@ -13,6 +13,8 @@ namespace Archimedes {
RendererOpenGL();
~RendererOpenGL();
void init();
void render(std::list<renderCmd*>, int&, int&);
};

View File

@@ -6,8 +6,9 @@ namespace Archimedes {
WindowGLFW::WindowGLFW() {
glfwSetErrorCallback([](int e, const char* m){
std::cout << "GLFW Error: " << m << std::endl;
});
std::cout << "GLFW Error: " << m << std::endl;
});
if(!glfwInit()) {
std::cout << "glfwInit failed!\n";
std::abort();
@@ -18,7 +19,7 @@ namespace Archimedes {
glfwTerminate();
std::abort();
}
std::cout << "Window Created!\n";
glfwMakeContextCurrent(w);
glfwSwapInterval(1);
}

View File

@@ -18,7 +18,7 @@ namespace Archimedes {
void getSize(int&, int&);
auto getWindow() { return w; }
GLFWwindow* getWindow() { return w; }
private:
GLFWwindow* w;