if (value == 1)
al_set_new_display_flags(ALLEGRO_FULLSCREEN);
Why doesn't this work?
I'm trying to do messagebox asking for fullscreen (yes/no)
You have to call al_create_display too
so here is my source code:
The program is in progress as you can see.:) I'm beginner and just training.
#include<allegro5\allegro.h>
#include<allegro5\allegro_native_dialog.h>
#include<iostream>
#include<allegro5\allegro_ttf.h>
#include<allegro5\allegro_font.h>
#define ScreenWidth 800
#define ScreenHeight 600
int main ()
{
ALLEGRO_DISPLAY *display;
if(!al_init())
{
al_show_native_message_box(NULL, NULL,NULL, "Could not initialize Allegro 5", NULL, NULL);
}
display = al_create_display(800, 600);
al_set_window_title(display, "Test");
if(!display)
{
al_show_native_message_box(display, "Title", "plaa", "Could not create Allegro window", NULL, ALLEGRO_MESSAGEBOX_QUESTION);
}
int value = al_show_native_message_box(display, "Fullscreen?", "", "Do you want to go fullscreen?(This feature is unavailable at the moment)", NULL, ALLEGRO_MESSAGEBOX_YES_NO);
std::cout << value << std::endl;
if (value == 1)
al_set_new_display_flags(ALLEGRO_FULLSCREEN);
al_init_font_addon();
al_init_ttf_addon();
ALLEGRO_FONT *font = al_load_font("COMICATE.TTF", 48, NULL);
al_draw_text(font, al_map_rgb(44, 117, 255), ScreenWidth / 2, ScreenHeight/2, ALLEGRO_ALIGN_CENTRE, "MADE BY GODZILLA69");
al_rest(3.0);
al_destroy_display(display);
return 0;
}
al_get_display_mode:
Retrieves a display mode. Display parameters should not be changed between a call of al_get_num_display_modes and al_get_display_mode. index must be between 0 and the number returned from al_get_num_display_modes-1. mode must be an allocated ALLEGRO_DISPLAY_MODE structure. This function will return NULL on failure, and the mode parameter that was passed in on success.
source: https://www.allegro.cc/manual/5/al_get_display_mode
nvm i got it working
Thanks for helping! 
BTW, what does that number mean(N)?
al_get_display_mode(N, &disp_data);
It is the index. There are many display modes. You need to fetch them 1 at a time.
Alright, Thank you very much