al_create_shader(3alleg5)

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

πŸ’– 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 a HLSL shader on an OpenGL display 🚫 nor a GLSL shader on a Direct3D display

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 OpenGL display, it will create a GLSL shader ✨
  • for a Direct3D display, it will create a HLSL shader ✨

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 πŸ”₯


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