Skip to content
Snippets Groups Projects
Commit f3c7b855 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix drawing of gl text in 64 bit mac cocoa version by making sure the raster position is valid

parent 0892b8c9
No related branches found
No related tags found
No related merge requests found
......@@ -17,12 +17,13 @@ void drawContext::drawString(const std::string &s, const std::string &font_name,
{
if(CTX::instance()->printing && !CTX::instance()->print.text) return;
GLboolean valid;
glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID, &valid);
if(valid == GL_FALSE) return; // the primitive is culled
// change the raster position only if not creating TeX files
if(align > 0 && (!CTX::instance()->printing ||
CTX::instance()->print.fileFormat != FORMAT_TEX)){
GLboolean valid;
glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID, &valid);
if(valid == GL_TRUE){
GLdouble pos[4];
glGetDoublev(GL_CURRENT_RASTER_POSITION, pos);
double x[3], w[3] = {pos[0], pos[1], pos[2]};
......@@ -43,7 +44,6 @@ void drawContext::drawString(const std::string &s, const std::string &font_name,
viewport2World(w, x);
glRasterPos3d(x[0], x[1], x[2]);
}
}
if(!CTX::instance()->printing){
drawContext::global()->setFont(font_enum, font_size);
......@@ -128,7 +128,8 @@ void drawContext::drawSphere(double R, double x, double y, double z,
glDisable(GL_LIGHTING);
}
void drawContext::drawEllipse(double x, double y, double z, float v0[3], float v1[3], int light)
void drawContext::drawEllipse(double x, double y, double z, float v0[3], float v1[3],
int light)
{
if(light) glEnable(GL_LIGHTING);
glPushMatrix();
......@@ -144,7 +145,8 @@ void drawContext::drawEllipse(double x, double y, double z, float v0[3], float v
glDisable(GL_LIGHTING);
}
void drawContext::drawEllipsoid(double x, double y, double z, float v0[3], float v1[3], float v2[3], int light)
void drawContext::drawEllipsoid(double x, double y, double z, float v0[3], float v1[3],
float v2[3], int light)
{
if(light) glEnable(GL_LIGHTING);
glPushMatrix();
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment