source: trunk/src/shader.h @ 668

Last change on this file since 668 was 668, checked in by sam, 11 years ago

Protect the Shader constructor and provide a static creation method that
will let us cache shaders.

File size: 858 bytes
Line 
1//
2// Lol Engine
3//
4// Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://sam.zoy.org/projects/COPYING.WTFPL for more details.
9//
10
11//
12// The Shader class
13// ----------------
14//
15
16#if !defined __DH_SHADER_H__
17#define __DH_SHADER_H__
18
19class ShaderData;
20
21class Shader
22{
23public:
24    static Shader *Create(char const *vert, char const *frag);
25    static void Destroy(Shader *shader);
26
27    int GetAttribLocation(char const *attr) const;
28    int GetUniformLocation(char const *uni) const;
29
30    void Bind() const;
31
32protected:
33    Shader(char const *vert, char const *frag);
34    ~Shader();
35
36private:
37    ShaderData *data;
38};
39
40#endif // __DH_SHADER_H__
41
Note: See TracBrowser for help on using the repository browser.