Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Is Allegro5 compatibale with Chrome OS

This thread is locked; no one can reply to it. rss feed Print
Is Allegro5 compatibale with Chrome OS
JustBoredYo
Member #23,375
June 2022

Hi I was just wondering because I looked into installing and using Allegro 5.2, I think, but I either get a segfault or null pointer with these to code lines:

#SelectExpand
1//Segfault 2ALLEGRO_DISPLAY* display = al_create_display(800, 600); 3 4if(!display) 5{ 6 std::cout<<"Could not create display.\n"; 7 return -1; 8}

and

#SelectExpand
2//Null pointer 3al_set_new_display_flags(ALLEGRO_FULLSCREEN); 4ALLEGRO_DISPLAY* display = al_create_display(800, 600); 5 6if(!display) 7{ 8 std::cout<<"Could not create display.\n"; 9 return -1; 10}

I have tried the full source code on my PC and there it works perfectly meaning it can't be the code and I can't find anything regarding this subject on the internet.

MiquelFire
Member #3,110
January 2003
avatar

Does it do the same on an Android phone or tablet?

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

Dizzy Egg
Member #10,824
March 2009
avatar

Have you called al_init() before creating the display?

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

JustBoredYo
Member #23,375
June 2022

@DizzyEgg yes I have called it. Here is the full code in case you need more information:

#SelectExpand
1#include <iostream> 2#include <allegro5/allegro.h> 3using namespace std; 4 5int main() { 6 7 ALLEGRO_DISPLAY* display = NULL; 8 9 if(!al_init()) 10 { 11 cout << "Could not initialize Allegro5.\n"; 12 return -1; 13 } 14 cout << "Initialialized Allegro5.\n"; 15 16 al_set_new_display_flags(ALLEGRO_FULLSCREEN); 17 display = al_create_display(800, 600); 18 19 if(!display) 20 { 21 cout << "Could not initialize ALLEGRO_DISPLAY.\n"; 22 return -1; 23 } 24 cout << "Initialialized ALLEGRO_DISPLAY.\n"; 25 26 al_clear_to_color(al_map_rgb(0, 0, 0)); 27 al_flip_display(); 28 29 al_rest(5.0); 30 al_destroy_display(display); 31 32 return 0; 33}

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Go to: