22 #ifndef BACKENDS_GRAPHICS_OPENGL_PIPELINES_PIPELINE_H 23 #define BACKENDS_GRAPHICS_OPENGL_PIPELINES_PIPELINE_H 25 #include "graphics/opengl/system_headers.h" 27 #include "backends/graphics/opengl/framebuffer.h" 28 #include "backends/graphics/opengl/texture.h" 30 #include "math/matrix4.h" 78 virtual void setColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a) = 0;
87 drawTextureInternal(texture, coordinates, texcoords);
91 drawTextureInternal(texture, coordinates, texture.
getTexCoords());
95 const GLfloat coordinates[4*2] = {
101 drawTextureInternal(texture, coordinates, texture.
getTexCoords());
105 const GLfloat coordinates[4*2] = {
115 if (tw == 0 || th == 0) {
120 const GLfloat texcoords[4*2] = {
121 (float)clip.
left / tw, (
float)clip.top / th,
122 (float)clip.
right / tw, (
float)clip.top / th,
123 (float)clip.
left / tw, (
float)clip.bottom / th,
124 (float)clip.
right / tw, (
float)clip.bottom / th
127 drawTextureInternal(texture, coordinates, texcoords);
151 virtual void drawTextureInternal(
const GLTexture &texture,
const GLfloat *coordinates,
const GLfloat *texcoords) = 0;
153 bool isActive()
const {
return activePipeline ==
this; }
Framebuffer * setFramebuffer(Framebuffer *framebuffer)
virtual void setProjectionMatrix(const Math::Matrix4 &projectionMatrix)=0
int16 right
Definition: rect.h:146
Definition: framebuffer.h:38
const GLfloat * getTexCoords() const
Definition: texture.h:140
uint getWidth() const
Definition: texture.h:120
Definition: renderbuffer.h:27
int16 left
Definition: rect.h:145
virtual void activateInternal()
void drawTexture(const GLTexture &texture, const GLfloat *coordinates, const GLfloat *texcoords)
Definition: pipeline.h:86
virtual void deactivateInternal()
virtual void setColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a)=0
uint getHeight() const
Definition: texture.h:125
Definition: pipeline.h:42