0

So here is what i have done
I did the basics of c++ and was quite comfortable with them
Now i wanted to start with the allegro gaming library
so i downloaded the library and linked it with my compiler
i compile a program and it compiles fine but when it runs it just displays and blank screen saying windows application at top
What do i do?
Please Help
Here is my code:-

#include <allegro.h>

int x = 10;
int y = 10;

int main(){
 
    allegro_init();
    install_keyboard();
    set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0);
    
    while ( !key[KEY_ESC] ){
    
        clear_keybuf();
        
        acquire_screen();
        
        textout_ex( screen, font, " ", x, y, makecol( 0, 0, 0), makecol( 0, 0, 0) );
        
        if (key[KEY_UP]) --y;        
        else if (key[KEY_DOWN]) ++y;    
        else if (key[KEY_RIGHT]) ++x;
        else if (key[KEY_LEFT]) --x;

        textout_ex( screen, font, "@", x, y, makecol( 255, 0, 0), makecol( 0, 0, 0) );
        
        release_screen();
        
        rest(50);

    }    
    
    return 0;
    
}

Edited by rohan121212: n/a

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by DJSAN10
0

You would probably like to post it in the Game Development section or the moderator could just move it there

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.