al_create_shader(3alleg5)
π al_create_shader π
okay so bestie, you know how we're in the Allegro 5 API? yeah. this is that. welcome to the manual page for al_create_shader, and ngl it's a lil cutie. let's go β¨
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
ALLEGRO_SHADER *al_create_shader(ALLEGRO_SHADER_PLATFORM platform)
π¦ DESCRIPTION π¦
so the whole vibe here? create a shader object. that's it, that's the job. main character energy fr fr.
the platform argument is one of the ALLEGRO_SHADER_PLATFORM(3alleg5) values π
and it does two things at once, iconic:
- it tells you what type of shader object to create
- and it tells you which language is used to program the shader
now here's the part where you gotta pay attention, no cap π«Ά β the shader platform must be compatible with the type of display you're gonna use that shader with. they have to match, periodt.
like, to be SO clear:
π« you cannot create and use aHLSLshader on anOpenGLdisplay π« nor aGLSLshader on aDirect3Ddisplay
it's giving "wrong language, wrong crowd" π they just don't speak to each other.
but wait β the ALLEGRO_SHADER_AUTO value is lowkey the smart one π§ it automatically chooses the appropriate platform for the display currently targeted by the calling thread. and yeah, there must be such a display. no display, no auto, that's the rule π
and it's actually so helpful about it:
- for an
OpenGLdisplay, it will create aGLSLshader β¨ - for a
Direct3Ddisplay, it will create aHLSLshader β¨
Returns the shader object on success π otherwise, it returns NULL. so like, check for NULL, bestie, i'm begging π
β SINCE β
5.1.0 β an oldie but a goodie, she's been here since 5.1.0 and she ate π
π₯ SEE ALSO π₯
al_attach_shader_source(3alleg5)al_attach_shader_source_file(3alleg5)al_build_shader(3alleg5)al_use_shader(3alleg5)al_destroy_shader(3alleg5)al_get_shader_platform(3alleg5)
and that's the whole page, babe π this came straight outta the Allegro reference manual (you know, the al_create_shader(3alleg5) one π). go forth and make shaders, you got this fr fr π«Άβ¨π
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms