![]() |
|
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: 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 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
![]() |
Does it do the same on an Android phone or tablet? --- |
Dizzy Egg
Member #10,824
March 2009
![]() |
Have you called al_init() before creating the display?
---------------------------------------------------- |
JustBoredYo
Member #23,375
June 2022
|
@DizzyEgg yes I have called it. Here is the full code in case you need more information: 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
![]() |
Is 800x600 supported by your monitor? If not, the display could come back null. Since Allegro5 works on Android, I'm going to guess it should work on Chrome OS as well, given a proper build, but I don't know for sure. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|