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());
107 inline void drawTexture(
const Texture &texture, GLfloat x, GLfloat y, GLfloat w, GLfloat h,
const Common::Rect &clip) {
108 const GLfloat coordinates[4*2] = {
115 const uint tw = texture.getWidth(),
116 th = texture.getHeight();
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; }
Definition: framebuffer.h:38
Definition: pipeline.h:40
static void disable()
Definition: pipeline.h:45
virtual void setProjectionMatrix(const Math::Matrix4 &projectionMatrix)=0
virtual void deactivateInternal()
Framebuffer * setFramebuffer(Framebuffer *framebuffer)
void drawTexture(const Texture &texture, const GLfloat *coordinates, const GLfloat *texcoords)
Definition: pipeline.h:89
virtual void setColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a)=0
virtual void activateInternal()