 |
BARE2D
|
|
Go to the documentation of this file.
27 glDepthRange(0.0f, 1.0f);
65 for(
unsigned int i = 0; i <
m_batches.size(); i++) {
71 glDrawArrays(GL_TRIANGLES, (GLint)
m_batches[i].offset, (GLsizei)
m_batches[i].numVertices);
88 GLint maxDrawBuffers = 0;
89 glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
90 for(
int i = 0; i < maxDrawBuffers; i++) {
void destroy()
Releases necessary memory.
void use()
Activates this shader program for the renderer to use.
void unbind()
Unbinds the vao.
void unuse()
Deactivates this shader program.
void bindTexture(GLenum target, GLenum texture)
Binds a texture to target in the currently active texture slot.
virtual void render()
Actually renders the contents to the screen!
void init()
Initializes the necessary components, combining the VBO and VAO.
virtual void link(std::initializer_list< std::string > attributes)
ShaderProgram * getShader()
void bindFragOutputLocation(std::string outputVariableName, unsigned int location)
A call to glBindFragDataLocation() - Causes an output variable of the fragment shader to output to a ...
virtual void preRender()
Does stuff inside of the render function, within the shader's use.
void bind()
Binds this vertex array object.
virtual void begin()
Clears the necessary vectors, etc. to prepare for draw() calls, etc.
virtual void destroy()
Frees all necessary memory.
void destroy()
Releases all bound objects and deletes any allocated stuff.
void setActiveTexture(GLenum texture)
Sets the active texture "slot". This can be GL_TEXTURE0 to GL_TEXTURE8 (I think. Check the literature...
The ShaderProgram is a GLSL program which combines two shaders - the vertex shader and the fragment s...
void linkShaders(std::initializer_list< std::string > attributes)
Links the compiled shaders together to create a coherent shader program.
static GLContext * getContext()
virtual void initUniforms()
Initializes all uniforms, such as colour attachments, depth attachments, etc.
std::vector< RenderBatch > m_batches
virtual void init()
Initializes all necessary bits of the renderer.
virtual void end()
Creates the renderbatches, does necessary stuff before render() call.
virtual void createRenderBatches()=0
Constructs all of the render batches from data given by, say, draw() calls.