Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Allegro 5 on Linux, errors.

This thread is locked; no one can reply to it. rss feed Print
Allegro 5 on Linux, errors.
Matias Persson
Member #15,093
May 2013

So I'm programming a game for linux, compiles fine, runs fine... But the console gives errors;

When program is run - This is obviously related to virtualbox, have already contacted ubuntu virtualization team for help on this one;

#SelectExpand
1pci id for fd 6: 80ee:beef, driver (null) 2libGL error: core dri or dri2 extension not found 3libGL error: failed to load driver: vboxvideo 4pci id for fd 6: 80ee:beef, driver (null) 5libGL error: core dri or dri2 extension not found 6libGL error: failed to load driver: vboxvideo

When program is closed;

#SelectExpand
1(The other error remains of course) 2 3// Now this, what the heck is this error? Is it also virtualbox related or me doing something wrong with Allegro? 4X error of failed request: BadDrawable (invalid Pixmap or Window parameter) 5 Major opcode of failed request: 72 (X_PutImage) 6 Resource id in failed request: 0x4800002 7 Serial number of failed request: 1291 8 Current serial number in output stream: 1294 9 10process returned 1 (0x1) 11press ENTER to continue.

Any ideas?

Peter Hull
Member #1,136
March 2001

Number 1 I believe always happens and you can ignore it.

Number 2 I've also had and it was always my fault - if I remember correctly it was to do with terminating the program without closing all the windows.

Pete

Matias Persson
Member #15,093
May 2013

Hi, thanks for your response Peter :)

However I do close all the windows;

#SelectExpand
1#include <iostream> 2#include <fstream> 3#include <allegro5/allegro.h> 4#include <allegro5/allegro_image.h> 5 6int main() { 7 bool redraw = false, running = true; 8 9 std::ofstream file("Log.txt"); 10 11 ALLEGRO_DISPLAY *display; 12 ALLEGRO_EVENT_QUEUE *event_queue; 13 ALLEGRO_TIMER *timer; 14 15 if(!al_init()) { 16 file << "Failed to initialize Allegro 5, shutting down." << std::endl; 17 return -1; 18 } 19 20 display = al_create_display(640, 480); 21 if(!display) { 22 file << "Failed to create display, shutting down." << std::endl; 23 al_destroy_display(display); 24 return -1; 25 } 26 27 timer = al_create_timer(1.0 / 60.0); 28 if(!timer) { 29 file << "Failed to create timer, shutting down." << std::endl; 30 al_destroy_timer(timer); 31 return -1; 32 } 33 34 event_queue = al_create_event_queue(); 35 if(!event_queue) { 36 file << "Failed to create event queue, shutting down." << std::endl; 37 al_destroy_event_queue(event_queue); 38 return -1; 39 } 40 41 al_install_keyboard(); 42 al_init_image_addon(); 43 44 ALLEGRO_BITMAP *bitmap = al_load_bitmap("test.png"); 45 46 al_register_event_source(event_queue, al_get_display_event_source(display)); 47 al_register_event_source(event_queue, al_get_timer_event_source(timer)); 48 al_register_event_source(event_queue, al_get_keyboard_event_source()); 49 50 al_start_timer(timer); 51 52 do { 53 ALLEGRO_EVENT ev; 54 al_wait_for_event(event_queue, &ev); 55 56 if(ev.type == ALLEGRO_EVENT_TIMER) { 57 redraw = true; 58 } 59 else if(ev.type == ALLEGRO_EVENT_DISPLAY_CLOSE) { 60 running = false; 61 } 62 63 if(redraw && al_is_event_queue_empty(event_queue)) { 64 al_clear_to_color(al_map_rgb(0,0,0)); 65 66 67 al_flip_display(); 68 } 69 } while (running); 70 71 al_destroy_event_queue(event_queue); 72 al_destroy_timer(timer); 73 al_destroy_display(display); 74 75 return 0; 76}

Peter Hull
Member #1,136
March 2001

I must admit I got those errors with a different library (let's call it the Standard Display Library ;) ) and I fixed it by being more rigorous about destroying everything. That might be irrelevant for Allegro.

You could try: deleting the bitmap that you created and/or calling al_uninstall_system to see if that helps.

Also I see that you set redraw to true but never to false - assume this is because you cut/pasted to make a minimal example?

Pete

Matias Persson
Member #15,093
May 2013

I don't know how I forgot that!
Errors are still there, I'm starting to believe it's virtualbox cause all of the errors.
The game runs just fine on the VM though!

Edit:
Redraw, forgot about that.. Was so hyped about being able to compile on Linux :D

Go to: