mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-03 14:35:03 -04:00
Font loader experiment
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user