Sign in to follow this  

GFX_AUTODETECT_WINDOWED issues

This topic is 2533 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using Allegro in Code Blocks on Windows 7. I have no trouble when I run a program on gfx_autodetect, but as soon as I add gfx_autodetect_WINDOWED then all hell breaks loose...OH NO IT"S WINDOWED AHHHHHHHHHHHHH!!!!

Ok...sorry...

What happens is the program actually opens up fine, but when I go to close it a window pops up that says, "filename.exe has stoppped working".

Here is the code:

allegro_init();
install_keyboard();
set_color_depth(16);
set_gfx_mode( GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);

Share this post


Link to post
Share on other sites
Quote:
Original post by flaynk
Here is the code:
No. That's not the code. The code actually compiles. This code does not.

Quote:
Original post by flaynk
I know practically NOTHING about C++ or anything. All I know is that I have Code::blocks downloaded on my computer lol.
*cringe*

You first must master the language before you can start building complicated things, such as games. If programming in general is included in your definition of "anything," then C++ will own you -- I speak from experience. You need to have mastered the general programming concepts before learning C++. Might I suggest python with pygame?

Share this post


Link to post
Share on other sites
hello friend, I'm from Brazil and I am translating this text by google translator ...
well, the program ends in disaster because you is not keeping it open correctly ...
code and analyze the following note:

#include <allegro.h>

int main()
{
//------------------------------------------------------------------------//
allegro_init(); //--this initialize the allegro--//

install_keyboard(); //--this change de keyboard functions--//

set_color_depth(16); //--specifies number of colors that will work--//

set_gfx_mode(GFX_AUTODETECT_WINDOWED,640,480,0,0);//--define the program windowed (windowed), with x = 640 e y = 480----------------------------//

//-----------------------------------------------------------------------//

while(!key[KEY_ESC])//--while not pressing ESC will ---//
{
//here is executed the principal loop-//
//example:::
textout_ex(screen, font, "i am learning allegro !", 100,100,255,-1);
}
//------------------------------------------------------------------------//

allegro_exit(); //exit the allegro---//
return 0; // say to the application is correctelly finalized--//
} //--end the main()--///
END_OF_MAIN() //THIS IS REQUIRED WHEN WE ARE USING ALLEGRO FOR COMPATIBILITIES

/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/--/-/-/--/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-

If you are doing everything correctly and the error still persists, try instead to autodetect the video driver, specify it manually ...

Share this post


Link to post
Share on other sites

This topic is 2533 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this