-
-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy pathGLPrimitive.h
60 lines (47 loc) · 1.65 KB
/
GLPrimitive.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* Copyright (c) scott.cgi All Rights Reserved.
*
* This source code belongs to project Mojoc, which is a pure C Game Engine hosted on GitHub.
* The Mojoc Game Engine is licensed under the MIT License, and will continue to be iterated with coding passion.
*
* License : https://github.com/scottcgi/Mojoc/blob/master/LICENSE
* GitHub : https://github.com/scottcgi/Mojoc
* CodeStyle: https://github.com/scottcgi/Mojoc/blob/master/Docs/CodeStyle.md
*
* Since : 2014-2-26
* Update : 2019-1-24
* Author : scott.cgi
*/
#ifndef GL_PRIMITIVE_H
#define GL_PRIMITIVE_H
#include "Engine/Graphics/OpenGL/Platform/gl3.h"
#include "Engine/Toolkit/Math/Matrix.h"
#include "Engine/Toolkit/Math/Math.h"
#include "Engine/Toolkit/HeaderUtils/Rect.h"
#include "Engine/Graphics/Draw/Color.h"
#include "Engine/Toolkit/Utils/Array.h"
/**
* Draw something without texture.
* can render with Drawable's Render function.
*/
struct AGLPrimitive
{
/**
* Render array of points, the point is pair of x, y.
*/
void (*RenderPoints) (Array(float)* pointArr, Matrix4* mvpMatrix, Color* color, float pointSize);
/**
* Render array of vertices, the vertex is pair of x, y.
*/
void (*RenderPolygon)(Array(float)* vertexArr, Matrix4* mvpMatrix, Color* color, float lineWidth);
/**
* Render array of lines, the line is two pairs of x, y.
*/
void (*RenderLines) (Array(float)* lineArr, Matrix4* mvpMatrix, Color* color, float lineWidth);
/**
* Render rect.
*/
void (*RenderRect) (Rect* rect, Matrix4* mvpMatrix, Color* color, float lineWidth);
};
extern struct AGLPrimitive AGLPrimitive[1];
#endif