The Render class contains helper methods for rendering 2D shapes.
More...
#include <Render.h>
|
Vector2 | getResolution () |
|
void | drawColoredQuad (float x, float y, float w, float h, Vector4 color, float rotation=0) |
| Draws a colored quad without texture to the screen. More...
|
|
void | drawTexturedQuad (float x, float y, float w, float h, int texture, float rotation=0) |
| Draws a textured quad to the screen. More...
|
|
void | drawTexturedQuad (float x, float y, float w, float h, int texture, float rotation, Vector2 scale) |
| Draws a textured quad to the screen. More...
|
|
void | drawTexturedQuad (float x, float y, float w, float h, int texture, float rotation, Vector2 scale, Vector2 flip) |
| Draws a textured quad to the screen. More...
|
|
void | drawTexturedQuad (float x, float y, float w, float h, int texture, float rotation, Vector2 scale, Vector2 flip, Vector4 texcoords) |
| Draws a textured quad to the screen. More...
|
|
void | drawText (OText *text, float x, float y, float rotation=0) |
| Draws a text object to the screen in 2D. More...
|
|
void | set2D (float w, float h) |
| Sets a 2D viewport with the given width and height. More...
|
|
void | loadShader (const char *vert, const char *frag, unsigned int *fx) |
| Loads, compiles and links a GLSL shader. More...
|
|
OText * | createText (const char *font, float size) |
| Creates a new text object. More...
|
|
| Render () |
|
The Render class contains helper methods for rendering 2D shapes.
All elements can be rendered directly to the screen or to a texture.
- Bug:
- Should be implemented in Neo::RenderingContext!
- Author
- Yannick Pflanzer
Neo2D::Render::Render |
( |
| ) |
|
OText* Neo2D::Render::createText |
( |
const char * |
font, |
|
|
float |
size |
|
) |
| |
Creates a new text object.
- Parameters
-
font | The font file to use. |
size | The font size to use. |
- Returns
- The new OText object.
void Neo2D::Render::drawColoredQuad |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
w, |
|
|
float |
h, |
|
|
Vector4 |
color, |
|
|
float |
rotation = 0 |
|
) |
| |
Draws a colored quad without texture to the screen.
- Parameters
-
x | The X-Position |
y | The Y-Position |
w | The width |
h | The height |
color | The color of the quad in RGBA between 0.0 and 1.0 |
rotation | The rotation of the quad. |
void Neo2D::Render::drawText |
( |
OText * |
text, |
|
|
float |
x, |
|
|
float |
y, |
|
|
float |
rotation = 0 |
|
) |
| |
Draws a text object to the screen in 2D.
- Parameters
-
text | The OText object to draw. |
x | The X-Position |
y | The Y-Position |
rotation | The rotation of the text |
void Neo2D::Render::drawTexturedQuad |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
w, |
|
|
float |
h, |
|
|
int |
texture, |
|
|
float |
rotation = 0 |
|
) |
| |
Draws a textured quad to the screen.
- Parameters
-
x | The X-Position |
y | The Y-Position |
w | The width |
h | The height |
texture | The handle of the texture to use |
rotation | The rotation of the quad. |
void Neo2D::Render::drawTexturedQuad |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
w, |
|
|
float |
h, |
|
|
int |
texture, |
|
|
float |
rotation, |
|
|
Vector2 |
scale |
|
) |
| |
Draws a textured quad to the screen.
- Parameters
-
x | The X-Position |
y | The Y-Position |
w | The width |
h | The height |
texture | The handle of the texture to use |
rotation | The rotation of the quad |
scale | The scale of the quad |
void Neo2D::Render::drawTexturedQuad |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
w, |
|
|
float |
h, |
|
|
int |
texture, |
|
|
float |
rotation, |
|
|
Vector2 |
scale, |
|
|
Vector2 |
flip |
|
) |
| |
Draws a textured quad to the screen.
- Parameters
-
x | The X-Position |
y | The Y-Position |
w | The width |
h | The height |
texture | The handle of the texture to use |
rotation | The rotation of the quad |
scale | The scale of the quad |
flip | The vector that specifies how to flip the quad. |
void Neo2D::Render::drawTexturedQuad |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
w, |
|
|
float |
h, |
|
|
int |
texture, |
|
|
float |
rotation, |
|
|
Vector2 |
scale, |
|
|
Vector2 |
flip, |
|
|
Vector4 |
texcoords |
|
) |
| |
Draws a textured quad to the screen.
- Parameters
-
x | The X-Position |
y | The Y-Position |
w | The width |
h | The height |
texture | The handle of the texture to use |
rotation | The rotation of the quad |
scale | The scale of the quad |
flip | The vector that specifies how to flip the quad. |
texcoords | Custom texture coordinates |
static Render* Neo2D::Render::getInstance |
( |
| ) |
|
|
inlinestatic |
Vector2 Neo2D::Render::getResolution |
( |
| ) |
|
|
inline |
void Neo2D::Render::loadShader |
( |
const char * |
vert, |
|
|
const char * |
frag, |
|
|
unsigned int * |
fx |
|
) |
| |
Loads, compiles and links a GLSL shader.
The shader ID will be plased inside the integer specified by the fx pointer.
- Parameters
-
vert | The vertex shader. |
frag | The fragment shader. |
fx | A pointer to and existing integer. |
void Neo2D::Render::set2D |
( |
float |
w, |
|
|
float |
h |
|
) |
| |
Sets a 2D viewport with the given width and height.
- Parameters
-
w | The width of the viewport. |
h | The height of the viewport. |
The documentation for this class was generated from the following file: