22 #ifndef BACKENDS_GRAPHICS_OPENGL_PIPELINES_PIPELINE_H 23 #define BACKENDS_GRAPHICS_OPENGL_PIPELINES_PIPELINE_H 25 #include "graphics/opengl/system_headers.h" 26 #include "graphics/opengl/texture.h" 28 #include "math/matrix4.h" 81 virtual void setColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a) = 0;
89 inline void drawTexture(
const Texture &texture,
const GLfloat *coordinates,
const GLfloat *texcoords) {
90 drawTextureInternal(texture, coordinates, texcoords);
94 drawTextureInternal(texture, coordinates, texture.
getTexCoords());
97 inline void drawTexture(
const Texture &texture, GLfloat x, GLfloat y, GLfloat w, GLfloat h) {
98 const GLfloat coordinates[4*2] = {
104 drawTextureInternal(texture, coordinates, texture.
getTexCoords());
108 const GLfloat coordinates[4*2] = {
118 if (tw == 0 || th == 0) {
123 const GLfloat texcoords[4*2] = {
124 (float)clip.
left / tw, (
float)clip.top / th,
125 (float)clip.
right / tw, (
float)clip.top / th,
126 (float)clip.
left / tw, (
float)clip.bottom / th,
127 (float)clip.
right / tw, (
float)clip.bottom / th
130 drawTextureInternal(texture, coordinates, texcoords);
154 virtual void drawTextureInternal(
const Texture &texture,
const GLfloat *coordinates,
const GLfloat *texcoords) = 0;
156 bool isActive()
const {
return activePipeline ==
this; }
Framebuffer * setFramebuffer(Framebuffer *framebuffer)
T left
Definition: rect.h:170
virtual void setProjectionMatrix(const Math::Matrix4 &projectionMatrix)=0
uint getHeight() const
Definition: texture.h:140
Definition: framebuffer.h:38
uint getWidth() const
Definition: texture.h:135
T right
Definition: rect.h:171
static void disable()
Definition: pipeline.h:45
Definition: renderbuffer.h:27
virtual void activateInternal()
void drawTexture(const Texture &texture, const GLfloat *coordinates, const GLfloat *texcoords)
Definition: pipeline.h:89
const GLfloat * getTexCoords() const
Definition: texture.h:155
virtual void deactivateInternal()
virtual void setColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a)=0
Definition: pipeline.h:40