Help with Allegro....

This is a discussion on Help with Allegro.... within the C++ Programming forums, part of the General Programming Boards category; Hey.... I am trying to use the textout function to print a string and an int var....but it doesn't work. ...

  1. #1
    SublicK
    Guest

    Help with Allegro....

    Hey....

    I am trying to use the textout function to print a string and an int var....but it doesn't work.

    eg.

    string VarName = "Test Text"
    int VarNum = 100;
    textout(screen,font,VarName,X,Y,C);
    textout(screen,font,VarNum,X1,Y1,C);

    How do you print vars???

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,499
    You have to format a string yourself
    char buff[100];
    sprintf( buff, "Test text %d %d", X, Y );
    textout(screen,font,buff,X,Y);
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    textout probably suspects a c style string. So use

    VarName.c_str();
    as long as it's parameter is const char*

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Allegro in C for a newb
    By Ideius in forum C Programming
    Replies: 5
    Last Post: 12-29-2005, 03:36 PM
  2. Game Programming FAQ
    By TechWins in forum Game Programming
    Replies: 5
    Last Post: 09-29-2004, 02:00 AM
  3. double buffering for allegro
    By Leeman_s in forum C++ Programming
    Replies: 6
    Last Post: 09-12-2002, 02:45 PM
  4. Special Allegro Information
    By TechWins in forum Game Programming
    Replies: 12
    Last Post: 08-20-2002, 11:35 PM
  5. Allegro programming in a window
    By Person Man in forum Windows Programming
    Replies: 0
    Last Post: 11-16-2001, 02:23 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21