Re: [HOpenGL] renderString problems

C Flynn <[email protected]>
Newsgroups gmane.comp.lang.haskell.cafe,gmane.comp.lang.haskell.hopengl
Message-ID <Pine.LNX.4.64.0708021125120.740@cslin-gps.csunix.comp.leeds.ac.uk>
On Wed, 1 Aug 2007, Dave Tapley wrote:

> Hi all,
>
> I'm having a lot of trouble using renderString from Graphics.UI.GLUT.Fonts.
> All my attempts to render a StrokeFont have so far failed.
> Using a BitmapFont I can get strings to appear but they demonstrate
> the odd behaviour of translating themselves a distance equal to their
> length every time my displayCallback function is evaluated.
>
> My requests are:
>  * Does anyone know how to keep the position fixed?
>  * Are there any good examples of (working) GLUT code available on
> the web, I'm finding it very hard to make any progress at the moment.
> Certainly not at Haskell speed :(
>
> I am using the following code:
>
>> import Graphics.UI.GLUT
>> main = do
>>     getArgsAndInitialize
>>     createWindow ""
>>     displayCallback $= update
>>     actionOnWindowClose $= ContinueExectuion
>>     mainLoop
>>
>> update = do
>>     clear [ColorBuffer]
>>     renderString Fixed8By13 $ "Test string"
>>     flush
>
> Cheers,
> Dave
> _______________________________________________
> HOpenGL mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/hopengl
>

I had a similar problem with stroke fonts. Try scaling by a low number 
(such as 0.01) and see where that gets you. The problem was it was 
rendering them at a size much bigger than my coordinate space that I just 
couldn't see them. I'm not convinced you need that $ there either but I 
don't suppose it hurts.

Charles
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.