al_attach_shader_source - Online Linux Manual PageSection : 3
Updated :
Source : Allegro reference manual
Note :
NAMEal_attach_shader_source − Allegro 5 API
SYNOPSIS
#include <allegro5/allegro.h>
bool al_attach_shader_source(ALLEGRO_SHADER *shader, ALLEGRO_SHADER_TYPE type,
const char *source)
DESCRIPTIONAttaches the shader's source code to the shader object and compiles it. Passing NULL deletes the underlying (OpenGL or DirectX) shader. See also al_attach_shader_source_file(3) if you prefer to obtain your shader source from an external file. If you do not use ALLEGRO_PROGRAMMABLE_PIPELINE Allegro's graphics functions will not use any shader specific functions themselves. In case of a system with no fixed function pipeline (like OpenGL ES 2 or OpenGL 3 or 4) this means Allegro's drawing functions cannot be used. TODO: Is ALLEGRO_PROGRAMMABLE_PIPELINE set automatically in this case? When ALLEGRO_PROGRAMMABLE_PIPELINE is used the following shader uniforms are provided by Allegro and can be accessed in your shaders: al_projview_matrix matrix for Allegro's orthographic projection multiplied by the al_use_transform(3) matrix. The type is mat4 in GLSL, and float4x4 in HLSL. al_use_tex whether or not to use the bound texture. The type is bool in both GLSL and HLSL. al_tex the texture if one is bound. The type is sampler2D in GLSL and texture in HLSL. al_use_tex_matrix whether or not to use a texture matrix (used by the primitives addon). The type is bool in both GLSL and HLSL. al_tex_matrix the texture matrix (used by the primitives addon). Your shader should multiply the texture coordinates by this matrix. The type is mat4 in GLSL, and float4x4 in HLSL. For GLSL shaders the vertex attributes are passed using the following variables: al_pos vertex position attribute. Type is vec4. al_texcoord vertex texture coordinate attribute. Type is vec2. al_color vertex color attribute. Type is vec4. For HLSL shaders the vertex attributes are passed using the following semantics: POSITION0 vertex position attribute. Type is float4. TEXCOORD0 vertex texture coordinate attribute. Type is float2. TEXCOORD1 vertex color attribute. Type is float4. Also, each shader variable has a corresponding macro name that can be used when defining the shaders using string literals. Don't use these macros with the other shader functions as that will lead to undefined behavior. • ALLEGRO_SHADER_VAR_PROJVIEW_MATRIX for "al_projview_matrix" • ALLEGRO_SHADER_VAR_POS for "al_pos" • ALLEGRO_SHADER_VAR_COLOR for "al_color" • ALLEGRO_SHADER_VAR_TEXCOORD for "al_texcoord" • ALLEGRO_SHADER_VAR_USE_TEX for "al_use_tex" • ALLEGRO_SHADER_VAR_TEX for "al_tex" • ALLEGRO_SHADER_VAR_USE_TEX_MATRIX for "al_use_tex_matrix" • ALLEGRO_SHADER_VAR_TEX_MATRIX for "al_tex_matrix" Examine the output of al_get_default_shader_source(3) for an example of how to use the above uniforms and attributes. Returns true on success and false on error, in which case the error log is updated. The error log can be retrieved with al_get_shader_log(3).
SINCE5.1.0
SEE ALSOal_attach_shader_source_file(3), al_build_shader(3), al_get_default_shader_source(3), al_get_shader_log(3) 0
Johanes Gumabo
Data Size : 15,069 byte
man-al_attach_shader_source.3Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 3 / 180,472
Visitor ID : :
Visitor IP : 18.226.186.109 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.