-
Notifications
You must be signed in to change notification settings - Fork 0
/
gfxLib.h
76 lines (61 loc) · 1.63 KB
/
gfxLib.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* gfxLib.h
*/
#ifndef GFX_LIB_H
#define GFX_LIB_H
#include <math.h>
#include <GLUT/glut.h>
/*
* list fo rgb colors
*
* Revision History:
* 6/12/2015 (JB): Initial Version - added red,black,yellow,white,blue
*/
#define RED_R 0.74
#define RED_G 0.12
#define RED_B 0.12
#define BLACK_R 0.0
#define BLACK_G 0.0
#define BLACK_B 0.0
#define YELLOW_R 1.0
#define YELLOW_G 0.95
#define YELLOW_B 0.3
#define WHITE_R 1.0
#define WHITE_G 1.0
#define WHITE_B 1.0
#define BLUE_R 0.02
#define BLUE_G 0.11
#define BLUE_B 0.9
#define CIRCLE_TRIANGLE_AMOUNT 1000 //How defined the circle is using triangles to draw.
typedef enum
{
COLOR_WHITE=0,
COLOR_RED,
COLOR_BLUE,
COLOR_BLACK,
COLOR_YELLOW
} colorEnum;
typedef struct
{
float r;
float g;
float b;
} rgbStruct;
typedef void (*ButtonFunction)();
typedef struct buttonStruct{
float x; /* top left x coord of the button */
float y; /* top left y coord of the button */
float w; /* the width of the button */
float h; /* the height of the button */
int state; /* the state, 1 if pressed, 0 otherwise */
char *label;
ButtonFunction callBackFunction;
}BUTTON;
void drawButton(BUTTON *button, colorEnum curColor);
void drawRing(float positionX, float positionY, float radius, colorEnum curColor);
void drawCircle(float positionX, float positionY, float radius, colorEnum curColor);
void drawRectangleLine(int v1x, int v1y, int v2x, int v2y, colorEnum curColor);
void drawRectangle(int v1x, int v1y, int v2x, int v2y, colorEnum curColor);
void getColorRgb(colorEnum curColor, rgbStruct *rgbVal) ;
void Font(void *font,char *text,float x,float y);
#endif