This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <glm/glm.hpp> | |
#include <glm/gtx/transform.hpp> | |
class ModelMatrix | |
{ | |
public: | |
glm::mat4 GetModel() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile : clang++ main.cpp -o Part_03 -lGL -lSDL2 | |
// | |
#include <iostream> | |
#include <string> | |
#include "Shader.h" | |
#define GL3_PROTOTYPES 1 | |
#include <GL/glew.h> | |
#include <SDL2/SDL.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 330 | |
precision highp float; | |
in vec4 ex_Color; | |
out vec4 fragColor; | |
float rand(vec2 co); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 330 | |
layout(triangles) in; | |
layout(triangle_strip, max_vertices = 100) out; | |
in vec4 color[]; // Output from vertex shader for each vertex | |
out vec4 ex_Color; // Output to fragment shader | |
void MakeEar(vec4 v); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 330 | |
// in_Position was bound to attribute index 0 and in_Color was bound to attribute index 1 | |
in vec4 in_Color; | |
in vec3 in_Position; | |
// We output the ex_Color variable to the next shader in the chain | |
out vec4 color; | |
void main(void) { | |
// Set the position to the one defined in our vertex array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <GL/glew.h> | |
#include <SDL2/SDL.h> | |
#include <string> | |
#include <vector> | |
#include <sstream> | |
#include <fstream> | |
#include <iostream> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 120 | |
// It was expressed that some drivers required this next line to function properly | |
precision highp float; | |
in vec4 ex_Color; | |
void main(void) { | |
gl_FragColor = vec4(ex_Color); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 150 | |
// in_Position was bound to attribute index 0 and in_Color was bound to attribute index 1 | |
attribute vec3 in_Position; | |
attribute vec4 in_Color; | |
// We output the ex_Color variable to the next shader in the chain | |
out vec4 ex_Color; | |
void main(void) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <GL/glew.h> | |
#include <SDL2/SDL.h> | |
#include <string> | |
#include <sstream> | |
#include <fstream> | |
#include <iostream> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Headerphile.com OpenGL Tutorial part 2 | |
// A simple example involving VBOs and a VAO to draw a simple square | |
// Source code is an adaption / simplicication of : https://www.opengl.org/wiki/Tutorial2:_VAOs,_VBOs,_Vertex_and_Fragment_Shaders_(C_/_SDL) | |
// Compile : | |
// clang++ main.cpp -lGL -lGLEW -lSDL2 -std=c++11 -o Test | |
// or | |
// g++ main.cpp -lGL -lGLEW -lSDL2 -std=c++11 -o Test | |
// | |
#include <iostream> |
NewerOlder