|
odd x errors on linux |
Michael Taboada
Member #14,161
March 2012
|
Hi, X Error of failed request: BadDrawable (invalid Pixmap or Window parameter) I'm not sure what this means, as all I've been able to read is that perhaps I haven't freed a display, but to the best of my knowledge I have. If you want to look at the code causing this, look at https://github.com/2mb-solutions/bash-it.git (note: Has submodules). -Michael. |
bamccaig
Member #7,536
July 2006
|
I can't begin to guess what's causing this, but my understanding is that the 5.1 branch has many bug fixes and is actually considered more stable at this point despite the developers being free to make breaking changes (which doesn't seem to happen often). You can try to eliminate bugs in Allegro by building with Allegro 5.1... I've only glanced at your code, but there are several alarm bells. You're ignoring return values[1] (which in C is your only indication of failure, which whether you think does or not, DO happen). Probably worse is the global variables. I gave up trying to spot the problem quickly because it's honestly not worth trying to weed through such poor code. Only a long session with a debugger has any hope of figuring it out, but even if you get past it now you'll just end up right back here again and again. You need to learn best practices to start and refactor the code... -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Peter Hull
Member #1,136
March 2001
|
Sounds like an interesting project! 1int main()
2{
3al_init();
4al_install_audio();
5al_install_keyboard();
6al_init_acodec_addon();
7ALLEGRO_DISPLAY* disp = al_create_display(640,480);
8// Generate the main menu.
9string options[] = {"play","exit"};
10dynamic_menu* mainMenu = create_menu(options, 2, NULL, 0);
11mainMenu->set_display(disp);
12int r = mainMenu->run_extended("", "", 1, true);
13if (r == 1)
14{
15
16}
17}
Michael Taboada said: perhaps I haven't freed a display, but to the best of my knowledge I have I would expect to see an al_destroy_display somewhere in there but I don't. I also looked in the linked repository that implements dynamic_menu.
|
Michael Taboada
Member #14,161
March 2012
|
Hi, |
|