Thread: allegro weirdness, <fstream> errors

  1. #1
    GA ichijoji's Avatar
    Join Date
    Nov 2002
    Posts
    179

    Question allegro weirdness, <fstream> errors

    Hey all, I'm working on a nibbles-type game and I'm trying to add a high score table, but when I try to declare a ifstream I get weird errors. Any ideas? (source/screenshot of error attached)
    Illusion and reality become impartiality and confidence.

  2. #2
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    I think it means you're not using it, but that shoulnd't stop the
    linking proces.
    --

  3. #3
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    For one thing, you're supposed to make it #include<allegro.h>, but I'm not sure if that will solve your problem or not. A couple more things that will help you out but that do not relate to your problem.

    Do this
    blit(buffer,screen,0,0,0,0, SCREEN_W, SCREEN_H); instead of blit(buffer,screen,0,0,0,0,640,480);

    In case you want to go back and change the resolution for the game you won't have to go back to every time you do 640, 480...so always do SCREEN_W, SCREEN_H, except when you initialize the graphics mode. Which brings me to my next point. You might as well init your graphics mode like this...

    set_gfx_mode(GFX_AUTODETECT_FULLSCREEN,640,480,640 ,480);

    Remember that the last two 640, 480 are for the virtual screen, so if you're not using any sort of virtual then you should set those to 0, 0 instead of 640, 480.

    Never use rest(). When you're declaring rest(50) it will process at different speeds on different computers. Instead use a timer that will pause the game for 50 milliseconds.

    Code:
    //setting up a timer
    volatile int counter;
    
    void update_counter()
     {
      counter++;
     }
    
    //initialize the timer
    install_timer();
    install_int_ex( update_counter, BPS_TO_TIMER(60));
    
    //using in place of rest(50)
    counter = 0;
    while(counter < 3); /*this will pause the game for 1/20th
                                       of a second which should be the 
                                        equivalent of 50 milliseconds*/
    Sorry, I may not have solved your problem, but the pieces of info I did tell you should help you out still.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Game Programming FAQ
    By TechWins in forum Game Programming
    Replies: 5
    Last Post: 09-29-2004, 02:00 AM
  2. dev & allegro compile errors
    By Calgore in forum C++ Programming
    Replies: 10
    Last Post: 08-11-2004, 04:41 PM
  3. Need some help choosing a good graphics library
    By dead_cell in forum Game Programming
    Replies: 31
    Last Post: 01-08-2003, 01:30 PM
  4. help with allegro - linking errors
    By MadHatter in forum C++ Programming
    Replies: 1
    Last Post: 11-22-2002, 02:01 PM
  5. Special Allegro Information
    By TechWins in forum Game Programming
    Replies: 12
    Last Post: 08-20-2002, 11:35 PM