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-10-24 15:28:37 +00:00
|
|
|
#include "platform.h"
|
2013-07-17 03:41:39 +00:00
|
|
|
#include <Eigen/Dense>
|
2012-10-24 15:28:37 +00:00
|
|
|
#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.).
|
2013-08-18 17:17:24 +00:00
|
|
|
//Renderer_draw_gl.cpp has most of the higher-level functions and wrappers.
|
|
|
|
//Renderer_init_*.cpp has platform-specific renderer initialziation/deinitialziation code. (e.g. the Raspberry Pi sets up dispmanx/OpenGL ES)
|
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-07-10 11:29:43 +00:00
|
|
|
//doesn't do anything right now
|
2013-04-12 02:59:19 +00:00
|
|
|
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
|
|
|
|
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
|
|
|
|
2013-07-10 11:29:43 +00:00
|
|
|
void pushClipRect(Eigen::Vector2i pos, Eigen::Vector2i dim);
|
2013-06-14 15:48:13 +00:00
|
|
|
void popClipRect();
|
2013-06-02 22:33:49 +00:00
|
|
|
|
2013-07-10 11:29:43 +00:00
|
|
|
void setMatrix(float* mat);
|
|
|
|
void setMatrix(const Eigen::Affine3f& transform);
|
|
|
|
|
2012-10-17 18:21:56 +00:00
|
|
|
void drawRect(int x, int y, int w, int h, unsigned int color);
|
2012-07-19 01:14:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|