forked from FranciscoBiaso/TileMapEditorRealmz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGLRect.h
38 lines (34 loc) · 1.04 KB
/
GLRect.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
#pragma once
#include "GLTriangle.h"
#include <gtk/gtk.h>
/*!
GLRect
========
This struct represents a Quad (Triangle 1 (ABD), Triangle 2 (CDB));
*/
typedef struct GLRect {
/*
A-------------D
| |
| |
| |
| |
| |
B-------------C
*/
GLRect();
GLRect(glm::vec3 leftTop, glm::vec3 rightTop, glm::vec4 color = glm::vec4(1, 1, 1, 1));
GLRect(glm::vec3 leftTop, float side, glm::vec4 color = glm::vec4(1,1,1,1));
void setCoordZ(float z);
void updatePosition(glm::vec3 leftTop, float topSide, float leftSide = 0);
void setTextCoord(int line, int col, int w = -1, int h = -1);
void setTextCoord(glm::vec2);
void setColor(glm::vec4 a, glm::vec4 b, glm::vec4 c, glm::vec4 d);
void setColor(glm::vec4 color);
void reset_textcoord(float val = -1);
void reset_color();
// first triangle -> A B D //
GLTriangle T1;
// second triangle -> C D B //
GLTriangle T2;
}GLRect;