Results 1 to 4 of 4

Thread: Problem with Text...

  1. #1

    Problem with Text...

    Hello, I have tried to write on the screen in my game by following Nehe's 13th tutorial.
    It did work, but it doesn't write what it's supposed to! lol

    I have spent 4h on this and can't figure it out.

    Please have a look here http://www.uploadtemple.com/view.php/1171926771.zip.
    The executable Writer.exe is the way it should work (code straight from Nehe's tutorial) and if you compile and run PaperWars3D.pas, you should see my problem.

    And whatever the problem is, it is most certainly either in Writer.pas or PaperWars3D.pas. I believe it might have to do with the procedure BuildFont, but I don't know.

    Thanks very much to those who will give their time

  2. #2

    Problem with Text...

    In glPrint procedure (writer.pas) when you use glCallLists, cast the string to PChar.
    Code:
    glCallLists(length(text),GL_UNSIGNED_BYTE,Pchar(text));

  3. #3

    Problem with Text...

    Fantastic!

    It's interesting though, I remember now that when I tried to compile the code from Nehe's tutorial, the compiler stoped on that line, so I changed pchar(text) to @text and it worked perfectly. Then when I copied bits of it into my game, I left it as @text, and the result was that it didn't write what I wanted. Now that I put it back to pchar(text), it compiles fine and works perfectly... I have no idea why!

  4. #4

    Problem with Text...

    it would have worked with "@text[1]"

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
  •