Modified CMake to now find and link GLEW
Slight tweaks to how CMake interacts with VS Added small OpenGL testing class which draws over the raycasted image Going to use Gl to start helping with debug / enabling hybrid rendering
This commit is contained in:
29
include/GL_Testing.h
Normal file
29
include/GL_Testing.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <util.hpp>
|
||||
#define GLEW_STATIC
|
||||
#include <GL/glew.h>
|
||||
|
||||
class GL_Testing
|
||||
{
|
||||
public:
|
||||
GL_Testing();
|
||||
~GL_Testing(){};
|
||||
|
||||
|
||||
enum Shader_Type {VERTEX, FRAGMENT};
|
||||
void compile_shader(std::string file_path, Shader_Type t);
|
||||
void create_program();
|
||||
void create_buffers();
|
||||
void draw();
|
||||
|
||||
private:
|
||||
|
||||
GLuint VBO; //raw points
|
||||
GLuint EBO; //link triangles
|
||||
GLuint VAO;
|
||||
GLuint vertex_shader;
|
||||
GLuint fragment_shader;
|
||||
GLuint shader_program;
|
||||
};
|
||||
|
||||
@@ -10,7 +10,6 @@ const double PI = 3.141592653589793238463;
|
||||
const float PI_F = 3.14159265358979f;
|
||||
|
||||
struct Light {
|
||||
#pragma pack(1)
|
||||
sf::Vector4f rgbi;
|
||||
|
||||
// I believe that Vector3's get padded to Vector4's. Give them a non-garbage value
|
||||
@@ -163,7 +162,7 @@ inline std::string read_file(std::string file_name){
|
||||
|
||||
if (!input_file.is_open()){
|
||||
std::cout << file_name << " could not be opened" << std::endl;
|
||||
return nullptr;
|
||||
return "";
|
||||
}
|
||||
|
||||
std::stringstream buf;
|
||||
|
||||
Reference in New Issue
Block a user