123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #ifndef DIRECTRENDERER_H
- #define DIRECTRENDERER_H
- #include "client/engine/Wrapper.h"
- #include "client/math/Matrix3D.h"
- #include "client/engine/Texture.h"
- #include "client/engine/Utils.h"
- using namespace std;
- class DirectRenderer
- {
- public:
- DirectRenderer();
- DirectRenderer(const DirectRenderer& orig);
- virtual ~DirectRenderer();
-
- void drawRectangle(float minX, float minY, float maxX, float maxY, float tMinX, float tMinY, float tMaxX, float tMaxY, IntColor c);
- void drawRectangle(float minX, float minY, float maxX, float maxY, IntColor c);
- void drawRectangle(float minX, float minY, float maxX, float maxY, float tMinX, float tMinY, float tMaxX, float tMaxY);
-
- float drawString(float x, float y, bool shadow, string& s);
- void getStringSize(float& width, float& height, string& s);
-
- private:
- float addString(float x, float y, int& index, float* data, const IntColor* color, string& s);
-
- static const int FONTS_LENGTH = 3;
- Texture FONTS[FONTS_LENGTH]
- {
- Texture("resources/font8x8.png"), Texture("resources/font16x16.png"), Texture("resources/font24x24.png")
- };
-
- static const char COLOR_CHAR = '&';
- static const unsigned int FONT_SIZE = 8;
- static const unsigned int LINE_STEP = 1;
- static const unsigned int SHADOW_STEP = 1;
- static const unsigned int MAX_STRING_LENGTH = 1024;
-
- static const int OBJECT_LENGTH = 96;
- static const int BUFFER_LENGTH = 256 * 1024 * OBJECT_LENGTH;
- GLuint vba = 0;
- GLuint vbo = 0;
- unsigned int offset = BUFFER_LENGTH - OBJECT_LENGTH;
- };
- #endif
|