2012-07-19 01:14:17 +00:00
|
|
|
#ifndef _RENDERER_H_
|
|
|
|
#define _RENDERER_H_
|
|
|
|
|
|
|
|
#include <vector>
|
2012-07-20 01:08:29 +00:00
|
|
|
#include <string>
|
2012-08-29 18:53:53 +00:00
|
|
|
#include "Font.h"
|
2012-07-19 16:13:27 +00:00
|
|
|
|
|
|
|
class GuiComponent;
|
|
|
|
|
2012-07-19 01:14:17 +00:00
|
|
|
namespace Renderer
|
|
|
|
{
|
|
|
|
void registerComponent(GuiComponent* comp);
|
|
|
|
void unregisterComponent(GuiComponent* comp);
|
2012-07-22 21:15:55 +00:00
|
|
|
void deleteAll();
|
2012-07-19 01:14:17 +00:00
|
|
|
|
2012-08-29 18:53:53 +00:00
|
|
|
bool init(int w, int h);
|
|
|
|
void deinit();
|
2012-07-19 16:13:27 +00:00
|
|
|
|
2012-08-29 18:53:53 +00:00
|
|
|
void render();
|
2012-07-20 01:08:29 +00:00
|
|
|
|
|
|
|
unsigned int getScreenWidth();
|
|
|
|
unsigned int getScreenHeight();
|
2012-07-19 16:13:27 +00:00
|
|
|
|
2012-08-02 01:43:55 +00:00
|
|
|
enum FontSize { SMALL, MEDIUM, LARGE };
|
|
|
|
int getFontHeight(FontSize size); //sometimes font size is needed before fonts have been loaded; this takes care of that
|
2012-08-29 18:53:53 +00:00
|
|
|
void buildGLColorArray(GLubyte* ptr, int color, unsigned int vertCount);
|
2012-08-02 01:43:55 +00:00
|
|
|
|
2012-07-19 16:13:27 +00:00
|
|
|
//drawing commands
|
2012-08-29 18:53:53 +00:00
|
|
|
void swapBuffers();
|
2012-07-19 16:13:27 +00:00
|
|
|
void drawRect(int x, int y, int w, int h, int color);
|
2012-08-02 01:43:55 +00:00
|
|
|
void drawText(std::string text, int x, int y, int color, FontSize fontsize = MEDIUM);
|
|
|
|
void drawCenteredText(std::string text, int xOffset, int y, int color, FontSize fontsize = MEDIUM);
|
|
|
|
void drawWrappedText(std::string text, int xStart, int yStart, int xLen, int color, FontSize fontsize = MEDIUM);
|
2012-07-19 01:14:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|