-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrendering.h
More file actions
36 lines (29 loc) · 737 Bytes
/
rendering.h
File metadata and controls
36 lines (29 loc) · 737 Bytes
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
#pragma once
#include <array>
#include <GL/freeglut.h>
#include "typedefs.h"
extern float windowMatrix[16];
namespace engine
{
void renderString(float x, float y, void* font, const char* string, const vector3f rgb)
{
glPushAttrib(GL_COLOR_BUFFER_BIT);
{
glMatrixMode(GL_PROJECTION);
glPushMatrix();
{
glLoadMatrixf(windowMatrix);
glDisable(GL_LIGHTING);
glColor3f(rgb[0], rgb[1], rgb[2]);
glRasterPos2f(x, y);
glutBitmapString(font, (const unsigned char*)string);
glEnable(GL_LIGHTING);
}
glPopMatrix();
}
glPopAttrib();
}
void renderString(float x, float y, void* font, const char* string, const std::array<float, 3>& rgb) {
renderString(x, y, font, string, rgb.data());
}
}