[EDIT] code style guide - toolbox & main

This commit is contained in:
Menno
2021-05-18 11:31:25 +02:00
parent 5047467206
commit 0517f9e897
10 changed files with 20 additions and 65 deletions

View File

@@ -1,5 +1,5 @@
#include "StaticShader.h"
#include "../toolbox/Toolbox.h"
#include "../toolbox/math.h"
namespace shaders
{
@@ -69,7 +69,7 @@ namespace shaders
void StaticShader::loadViewMatrix(entities::Camera& camera) const
{
const glm::mat4 viewMatrix = toolbox::createViewMatrix(camera);
const glm::mat4 viewMatrix = toolbox::CreateViewMatrix(camera);
loadMatrix(location_viewMatrix, viewMatrix);
}

View File

@@ -1,17 +0,0 @@
#version 400 core
// The FragmentShader is run for each pixel in a face on the screen.
// Interpolated textureCoordinates of the vertex (relative to the distance to each vertex)
in vec2 passTextureCoords;
// Final color of the pixel
out vec4 outColor;
// The texture of the model
uniform sampler2D textureSampler;
void main(void)
{
outColor = texture(textureSampler, passTextureCoords);
}

View File

@@ -1,25 +0,0 @@
#version 400 core
// The VertexShader is run for each vertex on the screen.
// Position of the vertex
in vec3 position;
// Coordinates of the texture
in vec2 textureCoords;
// Equal to the textureCoords
out vec2 passTextureCoords;
uniform mat4 modelMatrix;
uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;
void main(void)
{
// Tell OpenGL where to render the vertex
gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.0);
// Pass the textureCoords directly to the fragment shader
passTextureCoords = textureCoords;
}