Hi again, That code didn't crash for me on Linux, but it maybe something mouse-related. See the docs for show_mouse ( http://liballeg.org/stabledocs/en/alleg004.html#show_mouse). Also, remember to call set_gfx_mode(GFX_TEXT, 0,0,0,0); at the end, and, in updateScreen, you'd be better with a blit than a draw_sprite (blit(buffer, screen, 0, 0, 0, 0, buffer->w, buffer->h);) Hope that helps, Pete
On Sun, 8 May 2016 at 20:14 Andrew Robinson <[email protected]> wrote: > I re-read one of the Allegro Wikis I downloaded and saved to pdf, and it > says DON'T USE Dev-Cpp version 5. > > So I downloaded version 4.9.9.9. It is a much nicer compiler than the > newer version. Seems like everyone is making that stupid mistake nowadays. > GTK went from GTK2 to GTK3 and ruined GTK. Microsoft went from Win7 to > Win8/10 and now Windows is crap. Can't these people learn, that once you > have a winning formula, don't throw away your winning formula and start > over from scratch again? > > Anyways, I went to Tools --> Check for Updates/Packages... and of course, > it didn't work. To make a long story short, I created a file in > Dev-Cpp/config, named it mirrors.cfg, and placed the following text in it: > > [WebUpdate mirrors] > Dev-C++ Repository server= > https://sourceforge.net/projects/dev-cpp/files/webupdate/webupdate/ > Devpaks Repository server=http://devpaks.org/ > Old Devpaks Repository server=http://old.devpaks.org/ > > One of these works but the other two do not. The reason the other two do > not is because they are missing a file called webupdate.conf. You can > download this file from > https://sourceforge.net/projects/dev-cpp/files/webupdate/webupdate/ and > edit it so that the two non-working websites can work with the Check for > Updates/Packages... menu item in Dev-Cpp, but I have no idea who I should > tell to make this correction. Can someone here do that for me? > > When I manually installed the Allegro5 package, Dev-Cpp will only let me > use that as a project if I select C++ for my language. That explains why > Allegro5 wouldn't work with version 5 of the Dev-Cpp compiler, since I > always select C for my language. It also means the package was incorrectly > compiled, since Allegro is supposed to be a C library only (i.e. -- > _CDECL). This also means version 5 of Dev-Cpp no longer supports Devpaks. > Don't ever expect me to upgrade to that piece of junk then. > > Then I manually installed the Allegro4.2.2 package and everything worked > perfectly ... well except for when I close out the program. It has an > msvcrt.dll error, which I don't understand, since I don't link anything to > msvc, so I ran the program by itself and the error still occurs, so it is > an Allegro problem. Here is my source code: > > *#include <allegro.h>* > > *BITMAP *buffer;* > > > *int cursor_x = 20;int cursor_y = 20;* > > > > > > > > *void getMouseInfo() { if(mouse_b & 1) { cursor_x = mouse_x; cursor_y = > mouse_y; }}void updateScreen() { circlefill( buffer, cursor_x, cursor_y, > 20, makecol( 0, 0, 255)); draw_sprite( screen, buffer, 0, 0); }* > > > > > > > > > > > > > > > > > > *int > main(){ allegro_init(); install_mouse(); install_keyboard(); > set_color_depth(32); set_gfx_mode(GFX_AUTODETECT_WINDOWED, > 640, 700, 0, 0); buffer = create_bitmap(640, 700); clear_to_color(buffer, > 0x333333); show_mouse(buffer); while( !key[KEY_ESC]) > { getMouseInfo(); updateScreen(); } destroy_bitmap(buffer); return > 0;}END_OF_MAIN();* > > Removing destroy_bitmap(buffer); does nothing to get rid of the error, so > what's wrong? Does Allegro need a certain version of msvc to run on > Windows? That would not be a good thing since it breaks cross-OS > functionality. > _______________________________________________ > Allegro-developers mailing list > [email protected] > https://mail.gna.org/listinfo/allegro-developers >
_______________________________________________ Allegro-developers mailing list [email protected] https://mail.gna.org/listinfo/allegro-developers
