ES-DE/es-core/src/Renderer.h

44 lines
1.3 KiB
C
Raw Normal View History

#pragma once
#ifndef ES_CORE_RENDERER_H
#define ES_CORE_RENDERER_H
2017-11-01 22:21:10 +00:00
#include "math/Vector2i.h"
#include "platform.h"
#include GLHEADER
class Font;
2017-11-01 22:21:10 +00:00
class GuiComponent;
class Transform4x4f;
//The Renderer provides several higher-level functions for drawing (rectangles, text, etc.).
//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)
namespace Renderer
{
bool init();
void deinit();
unsigned int getWindowWidth();
unsigned int getWindowHeight();
unsigned int getScreenWidth();
unsigned int getScreenHeight();
unsigned int getScreenOffsetX();
unsigned int getScreenOffsetY();
2018-01-18 17:30:00 +00:00
unsigned int getScreenRotate();
void buildGLColorArray(GLubyte* ptr, unsigned int color, unsigned int vertCount);
//graphics commands
void swapBuffers();
void pushClipRect(Vector2i pos, Vector2i dim);
void popClipRect();
void setMatrix(const Transform4x4f& transform);
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);
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);
}
#endif // ES_CORE_RENDERER_H