Font loader experiment

This commit is contained in:
Charles J. Cliffe
2014-12-08 02:16:06 -05:00
parent 5fc9a064b5
commit 6c7372ed90
6 changed files with 473 additions and 1 deletions
+10
View File
@@ -15,6 +15,8 @@
#include "AppFrame.h"
#include <algorithm>
GLFont *PrimaryGLContext::font = NULL;
wxString PrimaryGLContext::glGetwxString(GLenum name) {
const GLubyte *v = glGetString(name);
if (v == 0) {
@@ -56,3 +58,11 @@ PrimaryGLContext::PrimaryGLContext(wxGLCanvas *canvas, wxGLContext *sharedContex
CheckGLError();
}
GLFont *PrimaryGLContext::getFont() {
if (font == NULL) {
font = new GLFont();
font->loadFont("vera_sans_mono.fnt");
}
return font;
}
+4
View File
@@ -7,6 +7,7 @@
#include <queue>
#include "CubicSDRDefs.h"
#include "GLFont.h"
class PrimaryGLContext: public wxGLContext {
public:
@@ -15,5 +16,8 @@ public:
static wxString glGetwxString(GLenum name);
static void CheckGLError();
static GLFont *getFont();
private:
static GLFont *font;
};
+3
View File
@@ -32,5 +32,8 @@ void SpectrumContext::Draw(std::vector<float> &points) {
glDisableClientState(GL_VERTEX_ARRAY);
glPopMatrix();
}
getFont()->drawString("Testing",0.0,0.0,0.7);
CheckGLError();
}