From: Diederick Niehorster Date: Sun, 28 Sep 2014 04:04:08 +0000 (+0000) Subject: drawing join dots on stroke fonts is now optional (and default off) X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=223d7dc01950904a061a1151955f24c4a098c3e4;p=freeglut drawing join dots on stroke fonts is now optional (and default off) git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1705 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/include/GL/freeglut_ext.h b/include/GL/freeglut_ext.h index 6f0a048..9c3eee1 100644 --- a/include/GL/freeglut_ext.h +++ b/include/GL/freeglut_ext.h @@ -88,6 +88,8 @@ #define GLUT_GEOMETRY_VISUALIZE_NORMALS 0x0205 +#define GLUT_STROKE_FONT_DRAW_JOIN_DOTS 0x0206 /* Draw dots between line segments of stroke fonts? */ + /* * New tokens for glutInitDisplayMode. * Only one GLUT_AUXn bit may be used at a time. diff --git a/src/fg_font.c b/src/fg_font.c index c0f0479..9e73949 100644 --- a/src/fg_font.c +++ b/src/fg_font.c @@ -278,10 +278,14 @@ void FGAPIENTRY glutStrokeCharacter( void* fontID, int character ) for( j = 0; j < strip->Number; j++ ) glVertex2f( strip->Vertices[ j ].X, strip->Vertices[ j ].Y ); glEnd( ); - glBegin( GL_POINTS ); - for( j = 0; j < strip->Number; j++ ) - glVertex2f( strip->Vertices[ j ].X, strip->Vertices[ j ].Y ); - glEnd( ); + + if (fgState.StrokeFontDrawJoinDots) + { + glBegin( GL_POINTS ); + for( j = 0; j < strip->Number; j++ ) + glVertex2f( strip->Vertices[ j ].X, strip->Vertices[ j ].Y ); + glEnd( ); + } } glTranslatef( schar->Right, 0.0, 0.0 ); } diff --git a/src/fg_init.c b/src/fg_init.c index 4061836..fda824d 100644 --- a/src/fg_init.c +++ b/src/fg_init.c @@ -87,6 +87,7 @@ SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */ 1, /* AuxiliaryBufferNumber */ 4, /* SampleNumber */ GL_FALSE, /* SkipStaleMotion */ + GL_FALSE, /* StrokeFontDrawJoinDots */ 1, /* OpenGL context MajorVersion */ 0, /* OpenGL context MinorVersion */ 0, /* OpenGL ContextFlags */ diff --git a/src/fg_internal.h b/src/fg_internal.h index 5e35378..8c0be9b 100644 --- a/src/fg_internal.h +++ b/src/fg_internal.h @@ -342,6 +342,8 @@ struct tagSFG_State GLboolean SkipStaleMotion; /* skip stale motion events */ + GLboolean StrokeFontDrawJoinDots;/* Draw dots between line segments of stroke fonts? */ + int MajorVersion; /* Major OpenGL context version */ int MinorVersion; /* Minor OpenGL context version */ int ContextFlags; /* OpenGL context flags */ diff --git a/src/fg_state.c b/src/fg_state.c index 580ff10..bb2e8f7 100644 --- a/src/fg_state.c +++ b/src/fg_state.c @@ -118,6 +118,10 @@ void FGAPIENTRY glutSetOption( GLenum eWhat, int value ) fgStructure.CurrentWindow->State.VisualizeNormals = value; break; + case GLUT_STROKE_FONT_DRAW_JOIN_DOTS: + fgState.StrokeFontDrawJoinDots = value; + break; + default: fgWarning( "glutSetOption(): missing enum handle %d", eWhat ); break; @@ -218,6 +222,9 @@ int FGAPIENTRY glutGet( GLenum eWhat ) return GL_FALSE; return fgStructure.CurrentWindow->State.VisualizeNormals; + case GLUT_STROKE_FONT_DRAW_JOIN_DOTS: + return fgState.StrokeFontDrawJoinDots; + default: return fgPlatformGlutGet ( eWhat ); break;