-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGLtext.h
More file actions
41 lines (34 loc) · 763 Bytes
/
GLtext.h
File metadata and controls
41 lines (34 loc) · 763 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
37
38
39
40
41
#pragma once
#pragma comment(lib, "OpenGL32.lib")
#include <Windows.h>
#include <iostream>
#include <stdio.h>
#include <gl\GL.h>
#include <wingdi.h>
#include "vec.h"
struct vec3
{
float x;
float y;
float z;
};
namespace GLTEXT
{
class Font
{
public:
bool bBuilt = false;
unsigned int base;
HDC hdc = nullptr;
int height;
int width;
public:
// Build - build font
void Build(int height, bool bold, bool italic, std::string font);
// Print - write text
void Print(float x, float y, const unsigned char color[3], const char* format, ...);
// CenterText - center text
vec3 CenterText(float x, float y, float width, float height, float textWidth, float textHeight);
float CenterText(float x, float width, float textWidth);
};
}