al_get_default_shader_source(3alleg5)

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

✨ al_get_default_shader_source ✨

okay bestie, welcome to the Allegro 5 API manual, the al_get_default_shader_source(3alleg5) page πŸ’– this one's short and sweet, so let's get into it.


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

char const *al_get_default_shader_source(ALLEGRO_SHADER_PLATFORM platform,
   ALLEGRO_SHADER_TYPE type)

πŸ¦‹ DESCRIPTION πŸ¦‹

So this function hands you back a string containing the source code for Allegro's default vertex or pixel shader β€” whichever one is the right fit for the platform you passed in. Slay. πŸ’…

Now for the tea on ALLEGRO_SHADER_AUTO: if you pass that, it means GLSL gets used when OpenGL is the one doing the rendering, and otherwise it's HLSL. πŸ‘‘

⚠️ lowkey important: ALLEGRO_SHADER_AUTO requires that there's a current display set on the calling thread. no display, no deal, fr fr.

Also, heads up β€” this function can return NULL if Allegro was built without support for shaders on the platform you picked. so like, check your return value, bestie, don't just assume. 😭


⭐ SINCE ⭐

5.1.6


πŸŽ€ SEE ALSO πŸŽ€


and that's the whole page, no cap πŸ’œ shoutout to the Allegro reference manual for keeping it iconic β€” al_get_default_shader_source(3alleg5), mwah, bye bestie 🫢✨

πŸ“¦ where this page comes from