Results 1 to 10 of 10

Thread: [JEDI-SDL & OpenGL] How to render text on OpenGL scene

  1. #1

    [JEDI-SDL & OpenGL] How to render text on OpenGL scene

    Hi again guys, it's me again Ok, there's a question: how to render text on OpenGL scene? Blitting text surface doesn't work. Has anyone got any tutorials or examples how to do it?

  2. #2

    [JEDI-SDL & OpenGL] How to render text on OpenGL scene

    take a look at http://www.nitrogen.za.org/

    you can find the bitmap font generator and the engine
    From brazil (:

    Pascal pownz!

  3. #3

    [JEDI-SDL & OpenGL] How to render text on OpenGL scene

    Well, I use SDL_TTF to load fonts, so bitmap fonts are out...

  4. #4

    [JEDI-SDL & OpenGL] How to render text on OpenGL scene

    Quote Originally Posted by Loodziek
    Well, I use SDL_TTF to load fonts, so bitmap fonts are out...
    I think you can't use them in opengl :?
    From brazil (:

    Pascal pownz!

  5. #5
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    [JEDI-SDL & OpenGL] How to render text on OpenGL scene

    There are tutorials on the NeHe website that can show you how to use TTF via OpenGL it's self. I doubt that you can use the SDL font functions in OpenGL.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  6. #6

    [JEDI-SDL & OpenGL] How to render text on OpenGL scene

    Ok, I left TTF and start learning how to use Bitmap fonts But there's another question: how to do this without WinAPI? At NeHe I have found Delphi OpenGL demo how to use bitmap fonts, but there's problem. Demo author use HFONT to do this. I work with Freepascal and Lazarus, so I can't do it this way. What's "crossplatform" HFONT equivalent?

    -Edit-
    I have found how to do it in GLUT. Thanks a lot guys


    -Edit-
    Erm... I still don't know to load bitmap fonts from *.bmp file generated for e.g. with Font Studio 4. Is there any example?

  7. #7

    [JEDI-SDL & OpenGL] How to render text on OpenGL scene

    Quote Originally Posted by Loodziek
    Ok, I left TTF and start learning how to use Bitmap fonts But there's another question: how to do this without WinAPI? At NeHe I have found Delphi OpenGL demo how to use bitmap fonts, but there's problem. Demo author use HFONT to do this. I work with Freepascal and Lazarus, so I can't do it this way. What's "crossplatform" HFONT equivalent?

    -Edit-
    I have found how to do it in GLUT. Thanks a lot guys


    -Edit-
    Erm... I still don't know to load bitmap fonts from *.bmp file generated for e.g. with Font Studio 4. Is there any example?
    i writed a png exporter for fontstudio
    http://www.freeshells.ch/~arthurpr/PNGEXPORT.rar
    From brazil (:

    Pascal pownz!

  8. #8

    [JEDI-SDL & OpenGL] How to render text on OpenGL scene

    I have thinked about it, and it's my idea. We render text on PSDL_Surface, right? So, why don't this surface using glBitmap or glDrawPixels? I'm trying to do that, but I get errors. Is there something wrong? Can you tell my what should I do?

  9. #9

    [JEDI-SDL & OpenGL] How to render text on OpenGL scene

    Here you can find code to render text in OpenGL using sdl_ttf library.

  10. #10
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    [JEDI-SDL & OpenGL] How to render text on OpenGL scene

    Ok if you are using SDL and you are using OpenGL for graphics, NONE of your SDL graphics commands can be used. Period. The graphics functions and surfaces for SDL and OpenGL are generally not compatible with each other.

    That said... the use of both TTF (or other formats) and bitmap/raster fonts are both doable, but have different advantages so decide which you want based on what you think your program needs most and what works best for you.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •