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 "graphics/opengl/texture.h" 30 #include "math/matrix4.h" 78 virtual void setColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a) = 0;
86 inline void drawTexture(
const Texture &texture,
const GLfloat *coordinates,
const GLfloat *texcoords) {
87 drawTextureInternal(texture, coordinates, texcoords);
91 drawTextureInternal(texture, coordinates, texture.
getTexCoords());
94 inline void drawTexture(
const Texture &texture, GLfloat x, GLfloat y, GLfloat w, GLfloat h) {
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 Texture &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
uint getHeight() const
Definition: texture.h:123
int16 right
Definition: rect.h:146
Definition: framebuffer.h:38
uint getWidth() const
Definition: texture.h:118
Definition: renderbuffer.h:27
int16 left
Definition: rect.h:145
virtual void activateInternal()
void drawTexture(const Texture &texture, const GLfloat *coordinates, const GLfloat *texcoords)
Definition: pipeline.h:86
const GLfloat * getTexCoords() const
Definition: texture.h:138
virtual void deactivateInternal()
virtual void setColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a)=0
Definition: pipeline.h:42