12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #ifndef RENDERER_H
- #define RENDERER_H
- #include "math/MatrixStack.h"
- #include "rendering/ColorRenderer.h"
- #include "rendering/FontRenderer.h"
- #include "rendering/Shader.h"
- class Renderer final {
- Shader& shader;
- bool texture;
- bool color;
- MatrixStack<10> stack;
- FontRenderer fontRenderer;
- ColorRenderer colorRenderer;
- public:
- Renderer(Shader& shader);
- void pop();
- void push();
- void update();
- Renderer& scale(float sx, float sy);
- Renderer& scale(float s);
- Renderer& translate(float tx, float ty);
- Renderer& translateX(float tx);
- Renderer& translateY(float ty);
- Renderer& translateTo(float tx, float ty);
- Renderer& rotate(float degrees);
- void setStringSize(int size);
- float drawString(float x, float y, const char* text);
- void drawTriangle(const ColorRenderer::Vertex& v1,
- const ColorRenderer::Vertex& v2,
- const ColorRenderer::Vertex& v3);
- void drawTriangle(float x1, float y1, float x2, float y2, float x3,
- float y3, Color4 color);
- void drawRectangle(const Vector2& pos, const Vector2& size, Color4 color);
- private:
- void setTextureMode(bool b);
- void setColorMode(bool b);
- };
- #endif
|