2017-10-31 17:12:50 +00:00
|
|
|
#pragma once
|
|
|
|
#ifndef ES_CORE_RENDERER_H
|
|
|
|
#define ES_CORE_RENDERER_H
|
2012-07-19 01:14:17 +00:00
|
|
|
|
2017-11-01 22:21:10 +00:00
|
|
|
#include "math/Vector2i.h"
|
2012-10-24 15:28:37 +00:00
|
|
|
#include "platform.h"
|
|
|
|
#include GLHEADER
|
2012-07-19 16:13:27 +00:00
|
|
|
|
2012-10-24 15:28:37 +00:00
|
|
|
class Font;
|
2017-11-01 22:21:10 +00:00
|
|
|
class GuiComponent;
|
|
|
|
class Transform4x4f;
|
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
|
|
|
|
{
|
2017-12-01 17:42:27 +00:00
|
|
|
bool init();
|
2012-08-29 18:53:53 +00:00
|
|
|
void deinit();
|
2012-07-20 01:08:29 +00:00
|
|
|
|
2017-12-01 17:42:27 +00:00
|
|
|
unsigned int getWindowWidth();
|
|
|
|
unsigned int getWindowHeight();
|
2012-07-20 01:08:29 +00:00
|
|
|
unsigned int getScreenWidth();
|
|
|
|
unsigned int getScreenHeight();
|
2017-12-01 17:42:27 +00:00
|
|
|
unsigned int getScreenOffsetX();
|
|
|
|
unsigned int getScreenOffsetY();
|
2018-01-18 17:30:00 +00:00
|
|
|
unsigned int getScreenRotate();
|
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
|
|
|
|
2017-10-28 20:24:35 +00:00
|
|
|
void pushClipRect(Vector2i pos, Vector2i dim);
|
2013-06-14 15:48:13 +00:00
|
|
|
void popClipRect();
|
2013-06-02 22:33:49 +00:00
|
|
|
|
2017-10-28 20:24:35 +00:00
|
|
|
void setMatrix(const Transform4x4f& transform);
|
2013-07-10 11:29:43 +00:00
|
|
|
|
2014-03-01 21:02:44 +00:00
|
|
|
void drawRect(int x, int y, int w, int h, unsigned int color, GLenum blend_sfactor = GL_SRC_ALPHA, GLenum blend_dfactor = GL_ONE_MINUS_SRC_ALPHA);
|
2014-03-19 20:03:23 +00:00
|
|
|
void drawRect(float x, float y, float w, float h, unsigned int color, GLenum blend_sfactor = GL_SRC_ALPHA, GLenum blend_dfactor = GL_ONE_MINUS_SRC_ALPHA);
|
2012-07-19 01:14:17 +00:00
|
|
|
}
|
|
|
|
|
2017-10-31 17:12:50 +00:00
|
|
|
#endif // ES_CORE_RENDERER_H
|