al_create_display(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– al_create_display β€” Allegro 5 API πŸ’–

okay bestie, welcome to the al_create_display page from the Allegro reference manual, aka Allegro 5 API section 3alleg5. this one is literally the moment you make a window exist. iconic behavior. πŸͺŸβœ¨


✨ NAME ✨

al_create_display β€” Allegro 5 API πŸŽ€


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

ALLEGRO_DISPLAY *al_create_display(int w, int h)

πŸ¦‹ DESCRIPTION πŸ¦‹

so what it does is: it creates a display, or window, with the dimensions you pass in. yes, that's what w and h are β€” the specified dimensions. no cap. πŸ“

the parameters of the display are determined by the last calls to al_set_new_display_*. so like, whatever you set most recently, that's the vibe it's gonna run with. and if you never set anything explicitly? default parameters are used. easy. 🫢

also, and this is the part that's giving main character energy: creating a new display will automatically make it the active one, with the backbuffer selected for drawing. so it just slides right in and takes over. periodt. πŸ’…

⚠️ Returns NULL on error. so like, check that pointer, bestie, don't be out here drawing to a NULL display. 😭

each display that uses OpenGL as a backend has a distinct OpenGL rendering context associated with it β€” one per display, its own little world. 🌈 for the whole discussion about rendering contexts, go read al_set_target_bitmap(3alleg5). iykyk. πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ


okay that's the whole page, no notes. 🌟 this was al_create_display(3alleg5) from the Allegro reference manual, and the footer energy is very much Allegro reference manual Β· al_create_display(3alleg5) β€” go forth and make windows, bestie, you got this. πŸ“πŸ§šπŸ’–

πŸ“¦ where this page comes from