forked from thestr4ng3r/cglft
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfont_shader.h
More file actions
79 lines (60 loc) · 1.65 KB
/
font_shader.h
File metadata and controls
79 lines (60 loc) · 1.65 KB
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
77
78
79
/*
* Copyright (C) 2015 by Florian Märkl
* http://www.metallic-entertainment.com
*
* This file is part of cglft.
*
* cglft is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* cglft is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with cglft. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file font_shader.h
* @author Florian Märkl
*/
#ifndef CGLFT_FONT_SHADER_H
#define CGLFT_FONT_SHADER_H
#include "cglft_export.h"
#ifndef CGLFT_DONT_INCLUDE_GL
#ifdef _WIN32
#include <GL/glew.h>
#else
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#endif
#endif
#include "font_face.h"
class CGLFT_EXPORT ftFontShader
{
public:
static const int vertex_attribute = 0;
static const int uv_attribute = 1;
virtual ~ftFontShader(void) {}
virtual void SetFontFace(ftFontFace *face) =0;
};
class CGLFT_EXPORT ftDefaultFontShader : public ftFontShader
{
private:
GLuint vertex_shader;
GLuint fragment_shader;
GLuint program;
GLint atlas_tex_uniform;
GLint color_uniform;
static const int atlas_tex_unit = 0;
public:
ftDefaultFontShader(void);
~ftDefaultFontShader(void);
void Bind(void);
void SetFontFace(ftFontFace *face);
void SetColor(float r, float g, float b, float a = 1.0f);
};
#endif