pull/6/head
E. Almqvist 2 years ago
parent 1cd7922454
commit a5064ab471
  1. 6
      src/renderer.cpp
  2. 4
      src/window.cpp

@ -72,7 +72,7 @@ namespace Renderer {
// Scene
Scene::Scene(Window* win) {
window = win;
window = win;
}
Scene::Scene(Window* win, std::vector<RenderObject*> ROs) : Scene(win) {
@ -95,7 +95,7 @@ namespace Renderer {
glClearColor(0.1f, 0.1f, 0.1f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
for ( RenderObject *ro: renderObjects )
for ( RenderObject *ro: renderObjects )
ro->render(*camera);
// Record the last frame
@ -125,7 +125,7 @@ namespace Renderer {
}
// RenderObject
RenderObject::RenderObject(std::vector<float> verts, std::vector<unsigned int> indices)
RenderObject::RenderObject(std::vector<float> verts, std::vector<unsigned int> indices)
: shader(VERT_SHADER_SRC_FILE, FRAG_SHADER_SRC_FILE) {
vertsVec = verts;
indicesVec = indices;

@ -14,7 +14,7 @@ Window::Window(const char* title, unsigned int w, unsigned int h) : Window(title
}
void Window::spawn() {
glfwInit();
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
@ -31,8 +31,6 @@ void Window::spawn() {
}
void Window::updateSize(int w, int h) {
// int w, h;
// glfwGetWindowSize(win, &w, &h);
_width = w;
_height = h;
glViewport(0, 0, w, h);

Loading…
Cancel
Save