ES-DE/src/Renderer.h
Aloshi 80740a2bd0 Fixed tiling being super slow.
See changelog.txt (September 7) for a list of everything.
2012-09-07 16:44:07 -05:00

41 lines
1.3 KiB
C++

#ifndef _RENDERER_H_
#define _RENDERER_H_
#include <vector>
#include <string>
#include "Font.h"
class GuiComponent;
//The Renderer provides several higher-level functions for drawing (rectangles, text, etc.).
//Defined in multiple files - Renderer.cpp has the GuiComponent stuff, Renderer_draw_* includes renderer-specific drawing implementations, and Renderer_init_* includes renderer-specific init/deinit.
namespace Renderer
{
void registerComponent(GuiComponent* comp);
void unregisterComponent(GuiComponent* comp);
void deleteAll();
bool init(int w, int h);
void onInit();
void deinit();
void onDeinit();
void render();
unsigned int getScreenWidth();
unsigned int getScreenHeight();
enum FontSize { SMALL, MEDIUM, LARGE };
int getFontHeight(FontSize size); //sometimes font size is needed before fonts have been loaded; this takes care of that
void buildGLColorArray(GLubyte* ptr, int color, unsigned int vertCount);
//drawing commands
void swapBuffers();
void drawRect(int x, int y, int w, int h, int color);
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);
}
#endif