1
0
Fork 0

Program is not a resource (temporary)

This commit is contained in:
Meoweg 2015-11-13 11:20:00 +00:00
parent cef70d5c0f
commit 0e108e00f3
3 changed files with 6 additions and 6 deletions

View File

@ -72,7 +72,7 @@ int main()
glfwSetKeyCallback(on_key); glfwSetKeyCallback(on_key);
emscripten_set_mousemove_callback(nullptr, nullptr, false, on_em_mousemove); emscripten_set_mousemove_callback(nullptr, nullptr, false, on_em_mousemove);
const Program *program = store.load<Program>("textured"); const Program *program = new Program("textured");
program->use(); program->use();
mvp_uniform = program->get_uniform_location("mvp"); mvp_uniform = program->get_uniform_location("mvp");

View File

@ -9,7 +9,7 @@ const std::string Program::filename(const std::string &name)
return "/data/shaders/" + name; return "/data/shaders/" + name;
} }
Program::Program(__attribute__((unused)) Store &store, const std::string &name) Program::Program(const std::string &name)
{ {
const std::string path = filename(name) + '/'; const std::string path = filename(name) + '/';

View File

@ -1,20 +1,20 @@
#ifndef _PROGRAM_HPP_ #ifndef _PROGRAM_HPP_
#define _PROGRAM_HPP_ #define _PROGRAM_HPP_
#include "resource.hpp"
#include "gl.hpp" #include "gl.hpp"
#include <string> #include <string>
struct Program: struct Program
Resource
{ {
RESOURCE(Program) Program(const std::string &name);
void use() const; void use() const;
GLuint get_uniform_location(const GLchar *name) const; GLuint get_uniform_location(const GLchar *name) const;
private: private:
static const std::string filename(const std::string &name);
GLuint _id; GLuint _id;
}; };