18 #ifndef INCLUDED_SHADERPROGRAM
19 #define INCLUDED_SHADERPROGRAM
80 const std::map<CStrIntern, int>& vertexIndexes,
const std::map<CStrIntern, frag_index_pair_t>& fragmentIndexes,
88 const std::map<CStrIntern, int>& vertexAttribs,
123 virtual void Reload() = 0;
134 virtual void Bind() = 0;
139 virtual void Unbind() = 0;
160 virtual void Uniform(Binding
id,
float v0,
float v1,
float v2,
float v3) = 0;
166 void Uniform(Binding
id,
int v);
167 void Uniform(Binding
id,
float v);
168 void Uniform(Binding
id,
float v0,
float v1);
183 virtual void VertexPointer(GLint size, GLenum type, GLsizei stride,
void* pointer);
184 virtual void NormalPointer(GLenum type, GLsizei stride,
void* pointer);
185 virtual void ColorPointer(GLint size, GLenum type, GLsizei stride,
void* pointer);
186 virtual void TexCoordPointer(GLenum texture, GLint size, GLenum type, GLsizei stride,
void* pointer);
210 #endif // INCLUDED_SHADERPROGRAM
virtual void Bind()=0
Binds the shader into the GL context.
virtual Binding GetTextureBinding(texture_id_t id)=0
virtual void ColorPointer(GLint size, GLenum type, GLsizei stride, void *pointer)
void BindTexture(texture_id_t id, CTexturePtr tex)
int GetStreamFlags() const
Returns bitset of STREAM_* value, indicating what vertex data streams the vertex shader needs (e...
virtual Binding GetUniformBinding(uniform_id_t id)=0
bool IsValid() const
Returns whether this shader was successfully loaded.
virtual void VertexAttribIPointer(attrib_id_t id, GLint size, GLenum type, GLsizei stride, void *pointer)
virtual ~CShaderProgram()
void UnbindClientStates()
virtual void TexCoordPointer(GLenum texture, GLint size, GLenum type, GLsizei stride, void *pointer)
static CShaderProgram * ConstructARB(const VfsPath &vertexFile, const VfsPath &fragmentFile, const CShaderDefines &defines, const std::map< CStrIntern, int > &vertexIndexes, const std::map< CStrIntern, frag_index_pair_t > &fragmentIndexes, int streamflags)
Construct based on ARB vertex/fragment program files.
void AssertPointersBound()
Checks that all the required vertex attributes have been set.
virtual void Unbind()=0
Unbinds the shader from the GL context.
static CShaderProgram * ConstructFFP(const std::string &id, const CShaderDefines &defines)
Construct an instance of a pre-defined fixed-function pipeline setup.
i64 Handle
`handle' representing a reference to a resource (sound, texture, etc.)
virtual void VertexPointer(GLint size, GLenum type, GLsizei stride, void *pointer)
CShaderProgram(int streamflags)
Represents a mapping of name strings to value strings, for use with #if and #ifdef and similar condit...
virtual void Uniform(Binding id, float v0, float v1, float v2, float v3)=0
Represents a uniform attribute or texture binding.
virtual void NormalPointer(GLenum type, GLsizei stride, void *pointer)
std::pair< int, GLenum > frag_index_pair_t
A compiled vertex+fragment shader program.
static CShaderProgram * ConstructGLSL(const VfsPath &vertexFile, const VfsPath &fragmentFile, const CShaderDefines &defines, const std::map< CStrIntern, int > &vertexAttribs, int streamflags)
Construct based on GLSL vertex/fragment shader files.
shared_ptr< CShaderProgram > CShaderProgramPtr
NONCOPYABLE(CShaderProgram)
bool Active()
Returns whether this uniform attribute is active in the shader.
virtual void VertexAttribPointer(attrib_id_t id, GLint size, GLenum type, GLboolean normalized, GLsizei stride, void *pointer)
shared_ptr< CTexture > CTexturePtr