Skip to content
Snippets Groups Projects
Commit cf3edaf5 authored by Pascal Engeler's avatar Pascal Engeler
Browse files

Switched shader loading to .ini loaded paths

parent 054bff31
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@
#include <shader.hpp>
#include <metadata_manager.hpp>
#include <material.hpp>
#include <INIReader.h>
Layer::Layer(std::string name, std::string filename, float zOffset, Material mat): _name(name), _zOffset(zOffset) {
//read data from file into vertex buffer, element buffer
......@@ -106,8 +107,9 @@ Layer::Layer(std::string name, std::string filename, float zOffset, Material mat
glBindBuffer(GL_ARRAY_BUFFER, 0);
//setup shader
std::string vertFile = std::string(SHADER_LOC) + std::string("objectShader.vert");
std::string fragFile = std::string(SHADER_LOC) + std::string("objectShader.frag");
INIReader inireader("config.ini");
std::string vertFile = inireader.GetString("paths", "pathShaders", "NONE") + std::string("objectShader.vert");
std::string fragFile = inireader.GetString("paths", "pathShaders", "NONE") + std::string("objectShader.frag");
_shader = Shader(vertFile.c_str(), fragFile.c_str());
_shader.use();
_shader.setFloat("z_offset", _zOffset);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment