954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Please Help

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;
    
}
rohan121212
Light Poster
26 posts since Nov 2011
Reputation Points: 6
Solved Threads: 3
 

Anybody?

rohan121212
Light Poster
26 posts since Nov 2011
Reputation Points: 6
Solved Threads: 3
 

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

DJSAN10
Posting Whiz in Training
249 posts since Dec 2010
Reputation Points: 38
Solved Threads: 26
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You