Nvidia cards not yet supported, Nvidia drivers are so gosh darn strict

This commit is contained in:
Ben
2019-03-02 21:07:00 +00:00
parent 2b900c9b1f
commit 8a860bcd7f
16 changed files with 165650 additions and 165639 deletions

View File

@@ -68,7 +68,7 @@ void Camera::moveCamera() {
glm::mat4 mat = getViewMatrix();
//row major
glm::vec3 forward(mat[0][2], mat[1][2], mat[2][2]);
glm::vec3 strafe( mat[0][0], mat[1][0], mat[2][0]);
glm::vec3 strafe (mat[0][0], mat[1][0], mat[2][0]);
//forward vector must be negative to look forward.
//read :http://in2gpu.com/2015/05/17/view-matrix/

View File

@@ -1,7 +1,11 @@
#ifndef SMHENGINE_SRC_CAMERA_H_
#define SMHENGINE_SRC_CAMERA_H_
#if _WIN32
#include <SDL.h>
#else
#include <SDL2/SDL.h>
#endif
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>

View File

@@ -11,6 +11,7 @@
#include <logger.h>
#include "display.h"
#include "camera.h"
#include "shader.h"
#include "model.h"
@@ -38,12 +39,15 @@ int main (int argc, char** argv) {
SDL_Event e;
while (!display.isClosed) {
camera.moveCamera();
while (SDL_PollEvent(&e)) {
camera.handleMouse(e);
if (e.type == SDL_QUIT || e.key.keysym.sym == SDLK_ESCAPE)
if (e.type == SDL_QUIT)
display.isClosed = true;
if (e.key.keysym.sym == SDLK_t) {
SDL_SetRelativeMouseMode(SDL_GetRelativeMouseMode() == SDL_TRUE ? SDL_FALSE : SDL_TRUE);
}
camera.handleMouse(e);
}
const Uint8* state = SDL_GetKeyboardState(NULL);
@@ -57,11 +61,12 @@ int main (int argc, char** argv) {
}
mesh.bind();
mesh.render(shader, camera);`
mesh.render(shader, camera);
mesh.unbind();
display.update();
}
return 0;
}

View File

@@ -1,4 +1,5 @@
#include "mesh.h"
#include "camera.h"
Mesh::Mesh() {

View File

@@ -13,10 +13,11 @@
#include <tiny_obj_loader.h>
#include <logger.h>
#include "camera.h"
#include "shader.h"
#include "./util/util.h"
class Camera;
// Not in use yet
// Will be used as a vector, enabling
// the use of strides when sending the