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>
2013-06-02 19:34:50 +00:00
# include "Vector2.h"
2012-10-24 15:28:37 +00:00
# include "platform.h"
# include GLHEADER
//#include "Font.h"
2012-07-19 16:13:27 +00:00
class GuiComponent ;
2012-10-24 15:28:37 +00:00
class Font ;
2012-07-19 16:13:27 +00:00
2012-09-07 21:44:07 +00:00
//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.
2012-07-19 01:14:17 +00:00
namespace Renderer
{
2012-08-29 18:53:53 +00:00
bool init ( int w , int h ) ;
void deinit ( ) ;
2012-07-20 01:08:29 +00:00
2013-04-12 02:59:19 +00:00
//just takes care of default font init/deinit right now
void onInit ( ) ;
void onDeinit ( ) ;
2012-07-20 01:08:29 +00:00
unsigned int getScreenWidth ( ) ;
unsigned int getScreenHeight ( ) ;
2012-07-19 16:13:27 +00:00
2013-04-10 17:29:07 +00:00
enum FontSize { SMALL , MEDIUM , LARGE , FONT_SIZE_COUNT } ;
2012-10-24 15:28:37 +00:00
Font * getDefaultFont ( FontSize size ) ;
2012-10-17 18:21:56 +00:00
void buildGLColorArray ( GLubyte * ptr , unsigned int color , unsigned int vertCount ) ;
2012-08-02 01:43:55 +00:00
2013-06-02 19:34:50 +00:00
//graphics commands
2012-08-29 18:53:53 +00:00
void swapBuffers ( ) ;
2013-06-02 19:34:50 +00:00
void translatef ( float x , float y ) ;
void translate ( Vector2i offset ) ;
2012-10-17 18:21:56 +00:00
void drawRect ( int x , int y , int w , int h , unsigned int color ) ;
2012-10-24 15:28:37 +00:00
void drawText ( std : : string text , int x , int y , unsigned int color , Font * font ) ;
void drawCenteredText ( std : : string text , int xOffset , int y , unsigned int color , Font * font ) ;
void drawWrappedText ( std : : string text , int xStart , int yStart , int xLen , unsigned int color , Font * font ) ;
2012-07-19 01:14:17 +00:00
}
# endif