Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: opengl text output

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2001
    Location
    wrwrqwrqw
    Posts
    13

    opengl text output

    hello,

    can someone tell me how I can write text to my mfc-opengl window ? Is there an opengl command to do this ?

  2. #2
    Intern Contributor
    Join Date
    Jul 2001
    Location
    Czech Republic
    Posts
    78

    Re: opengl text output

    the best approach I have found is to draw textured quads with letters.

    Haven't found yet how the OGL font facility works ...

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2001
    Location
    wrwrqwrqw
    Posts
    13

    Re: opengl text output

    hm, thats a complex way for such a simple thing.

  4. #4
    Junior Member Regular Contributor
    Join Date
    Dec 1969
    Location
    Munich,Germany
    Posts
    227

    Re: opengl text output

    OpenGL ist graphics api not a typewriter....
    yes

  5. #5
    Intern Newbie
    Join Date
    May 2001
    Posts
    39

    Re: opengl text output

    In a Win32 enviroment, you can use wglUseFontBitmap() or wglUseFontOutline() for create display lists with Windows fonts.

    CFont font;
    int fontDL;
    char* text = "Hello World!";

    font.CreatePointFont(120,"Arial",clientDC);
    SelectObject(clientDC->GetSafeHdc(),font);
    wglUseFontBitmaps(clientDC->GetSafeHdc(),0,255,fontDL);
    glRasterPos2f(x,y);
    glListBase(fontDL);
    glCallLists(strlen(text),GL_UNSIGNED_BYTE,text);

    This code write "Hello World!" in (x,y) using Arial 12.

    [This message has been edited by Boresight (edited 09-17-2001).]

  6. #6
    Junior Member Newbie
    Join Date
    Sep 2001
    Location
    wrwrqwrqw
    Posts
    13

    Re: opengl text output

    thanx boresight, exactly what i needed !

Posting Permissions

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