From: Fay, J. F Dr C. U. A. AAC/X. <john.fay.ctr@Eglin.af.mil> - 2010-07-02 14:57:49
|
Florian, It sounds like you are using C++ variable types. The "freeglut" libraries are C libraries; the string will be a simple "char *" variable. There may be some trouble with the "const" that the "c_str" function returns. I'm not particularly conversant on the stroke fonts. I think they generate regular OpenGL objects and can be moved and scaled by adjusting the transformation matrices. I've cc'ed the developers' list on this reply as somebody there may have greater wisdom than I do. Also, just in case you hadn't seen them on the "freeglut" page I would like to introduce you to them. - John -----Original Message----- From: Florian Meßner [mailto:flo...@ho...] Sent: Friday, July 02, 2010 9:18 AM To: Fay, John F Dr CTR USAF AFMC AAC/XRS Subject: Freeglut - StrokeStrings Hi John, I've got a question - again. Well, I wanted to use glutStrokeString, but I don't know what to use as the second parameter: std::string s; ... glutStrokeString(GLUT_STROKE_MONO_ROMAN, s); glutStrokeString(GLUT_STROKE_MONO_ROMAN, s.c_str()); both tries didn't work... And I wanted to know, how to change the size of such strokestrings. Thanks again :-) |
From: Florian E. <fl...@bu...> - 2010-07-03 17:16:55
|
>> That's correct. They are also influenced, e.g., by a previous >> glLineWidth(...). I'm using the following defines: >> >> #define GLUT_FONT_HEIGHT 152.381 >> #define GLUT_FONT_DESCENT 33.333 >> #define GLUT_FONT_WIDTH 104.762 > glScaled(GLUT_FONT_WIDTH, GLUT_FONT_HEIGHT, GLUT_FONT_DESCENT); Ah, that was a misunderstanding. Those defines aren't meant to be used as scale factors, they simply give the size of the font characters in units. Now that you've used them as scale factors, the resulting characters are around 23 000 units in size and are very likely just somewhere far outside of your viewport. Try using the inverse values instead. Florian P.S. GLUT_FONT_DESCENT also isn't for z values, it's the space below the baseline which, e.g. the "g" character uses. -- "_Nothing_ brightens up my morning. Coffee simply provides a shade of grey just above the pitch-black of the infinite depths of the _abyss_." |
From: Florian E. <fl...@bu...> - 2010-07-02 15:31:23
|
Hello everyone, > It sounds like you are using C++ variable types. The "freeglut" > libraries are C libraries; the string will be a simple "char *" > variable. There may be some trouble with the "const" that the "c_str" > function returns. The quick-and-dirty solution to this looks somewhat along the lines of: const char* chr = text.c_str(); while (*chr) glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN,*(chr++)); > I'm not particularly conversant on the stroke fonts. I think they > generate regular OpenGL objects and can be moved and scaled by > adjusting the transformation matrices. That's correct. They are also influenced, e.g., by a previous glLineWidth(...). I'm using the following defines: #define GLUT_FONT_HEIGHT 152.381 #define GLUT_FONT_DESCENT 33.333 #define GLUT_FONT_WIDTH 104.762 I've cc'ed the developers' list on this reply as somebody there may > have greater wisdom than I do. Also, just in case you hadn't seen > them on the "freeglut" page I would like to introduce you to them. Welcome :-) HTH, Florian > -----Original Message----- > From: Florian Meßner [mailto:flo...@ho...] > Sent: Friday, July 02, 2010 9:18 AM > To: Fay, John F Dr CTR USAF AFMC AAC/XRS > Subject: Freeglut - StrokeStrings > > Hi John, > I've got a question - again. > > Well, I wanted to use glutStrokeString, but I don't know what to use as the second parameter: > > std::string s; > ... > glutStrokeString(GLUT_STROKE_MONO_ROMAN, s); > glutStrokeString(GLUT_STROKE_MONO_ROMAN, s.c_str()); > > both tries didn't work... > > And I wanted to know, how to change the size of such strokestrings. > > Thanks again :-) > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Freeglut-developer mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer -- 0666 - Filemode of the Beast |
From: Larry E. R. <hyd...@ya...> - 2010-07-03 01:23:04
|
Florain, std::string s; ... glutStrokeString(GLUT_STROKE_MONO_ROMAN, s); glutStrokeString(GLUT_STROKE_MONO_ROMAN, (char*)s.c_str()); you need to cast away the const that comes from string::c_str(). You could use the const_cast<> type cast instead, but really, it doesn't matter. Larry ________________________________ From: "Fay, John F Dr CTR USAF AFMC AAC/XRS" <john.fay.ctr@Eglin.af.mil> To: Florian Meßner <flo...@ho...> Cc: FreeGLUT developers list <fre...@li...> Sent: Fri, July 2, 2010 8:24:19 AM Subject: Re: [Freeglut-developer] Freeglut - StrokeStrings Florian, It sounds like you are using C++ variable types. The "freeglut" libraries are C libraries; the string will be a simple "char *" variable. There may be some trouble with the "const" that the "c_str" function returns. I'm not particularly conversant on the stroke fonts. I think they generate regular OpenGL objects and can be moved and scaled by adjusting the transformation matrices. I've cc'ed the developers' list on this reply as somebody there may have greater wisdom than I do. Also, just in case you hadn't seen them on the "freeglut" page I would like to introduce you to them. - John -----Original Message----- From: Florian Meßner [mailto:flo...@ho...] Sent: Friday, July 02, 2010 9:18 AM To: Fay, John F Dr CTR USAF AFMC AAC/XRS Subject: Freeglut - StrokeStrings Hi John, I've got a question - again. Well, I wanted to use glutStrokeString, but I don't know what to use as the second parameter: std::string s; ... glutStrokeString(GLUT_STROKE_MONO_ROMAN, s); glutStrokeString(GLUT_STROKE_MONO_ROMAN, s.c_str()); both tries didn't work... And I wanted to know, how to change the size of such strokestrings. Thanks again :-) ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first-- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Freeglut-developer mailing list Fre...@li... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |