mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-15 12:18:38 -04:00
Simplify GLFont drawString usage
This commit is contained in:
@@ -33,16 +33,7 @@ void SpectrumContext::Draw(std::vector<float> &points) {
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
GLint vp[4];
|
||||
|
||||
glGetIntegerv( GL_VIEWPORT, vp);
|
||||
|
||||
std::string msgStr("Welcome to CubicSDR -- This is a test string. 01234567890!@#$%^&*()_[]");
|
||||
float charHeight = 62.0;
|
||||
float viewAspect = (float)vp[2]/(float)vp[3];
|
||||
float msgWidth = getFont()->getStringWidth(msgStr,charHeight/(float)vp[3],viewAspect);
|
||||
|
||||
getFont()->drawString(msgStr,0.0-(msgWidth/2.0),0.0,charHeight/(float)vp[3],viewAspect);
|
||||
getFont()->drawString("Welcome to CubicSDR -- This is a test string. 01234567890!@#$%^&*()_[]",0.0,0.0,31,GLFont::GLFONT_ALIGN_CENTER,GLFont::GLFONT_ALIGN_CENTER);
|
||||
|
||||
CheckGLError();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user