Program is not a resource (temporary)
This commit is contained in:
parent
cef70d5c0f
commit
0e108e00f3
|
@ -72,7 +72,7 @@ int main()
|
|||
glfwSetKeyCallback(on_key);
|
||||
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();
|
||||
|
||||
mvp_uniform = program->get_uniform_location("mvp");
|
||||
|
|
|
@ -9,7 +9,7 @@ const std::string Program::filename(const std::string &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) + '/';
|
||||
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
#ifndef _PROGRAM_HPP_
|
||||
#define _PROGRAM_HPP_
|
||||
|
||||
#include "resource.hpp"
|
||||
#include "gl.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
struct Program:
|
||||
Resource
|
||||
struct Program
|
||||
{
|
||||
RESOURCE(Program)
|
||||
Program(const std::string &name);
|
||||
|
||||
void use() const;
|
||||
GLuint get_uniform_location(const GLchar *name) const;
|
||||
|
||||
private:
|
||||
static const std::string filename(const std::string &name);
|
||||
|
||||
GLuint _id;
|
||||
};
|
||||
|
||||
|
|
Reference in New Issue