Nvidia cards not yet supported, Nvidia drivers are so gosh darn strict
This commit is contained in:
@@ -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/
|
||||
|
||||
@@ -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>
|
||||
|
||||
13
src/main.cpp
13
src/main.cpp
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "mesh.h"
|
||||
#include "camera.h"
|
||||
|
||||
Mesh::Mesh() {
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user