Sets global active text shader (all subsequent b2dText calls use this shader, shader=0 resets to default).
Takes shader (shader handle from b2dLoadTextShader or 0 for default, integer).
Returns nothing.
Shaders
Parameters & Returns
Parameters
shaderInt
Returns
Void
Quick Summary
Sets global active text shader (all subsequent b2dText calls use this shader, shader=0 resets to default).
Takes shader (shader handle from b2dLoadTextShader or 0 for default, integer).
Returns nothing.
Technical Exegesis...
Sets global active text shader (all subsequent b2dText calls use this shader, shader=0 resets to default). Takes shader (shader handle from b2dLoadTextShader or 0 for default, integer). Returns nothing. Sets g_2D_activeTextShader (global state affects all subsequent text draws), applies to b2dText/b2dTextCentered/etc (all text rendering functions use global shader), overridden by future b2dTextEx if implemented (per-draw shader parameter would ignore global).
Sets global active text shader (all subsequent b2dText calls use this shader, shader=0 resets to default). Takes shader (shader handle from b2dLoadTextShader or 0 for default, integer). Returns nothing. Sets g_2D_activeTextShader (global state affects all subsequent text draws), applies to b2dText/b2dTextCentered/etc (all text rendering functions use global shader), overridden by future b2dTextEx if implemented (per-draw shader parameter would ignore global). Use for batch shader application (set once, draw multiple text strings with same shader), shader state management (switch effects for different text types), or default rendering (set to 0 to disable custom shaders). Global shader state: affects all draws (every b2dText call uses active shader until changed), persists across frames (remains active until b2dSetTextShader called again), simple state machine (single global variable, no per-text state). Use cases: (1) Batch effect (b2dSetTextShader(outlineShader): draw all UI labels with outline: b2dSetTextShader(0) reset), (2) UI categories (b2dSetTextShader(headerShader): draw section headers: b2dSetTextShader(bodyShader): draw body text), (3) State management (If errorState Then b2dSetTextShader(redTextShader) Else b2dSetTextShader(0)), (4) Layer rendering (b2dSetTextShader(shadowShader): draw all text shadows: b2dSetTextShader(0): draw main text). Common patterns: activate = b2dSetTextShader(shader) set global; reset = b2dSetTextShader(0) default rendering. Shader parameter: shader>0 (uses loaded shader from b2dLoadTextShader, applies custom pixel shader to text), shader=0 (default rendering, standard text rendering no custom effects), shader≤0 or not found (falls back to default rendering, no error). Performance: cost zero (simple global variable assignment, no GPU operations), state change (changing shader may break batching during rendering, PSO switch cost ~0.01ms per change), minimize changes (set shader once for multiple text draws, not per-draw if same shader). Validation: no validation (any integer accepted, invalid shaders fall back to default during rendering), safe with freed shaders (if shader freed after set, rendering falls back to default no crash). Related: b2dLoadTextShader loads shader (creates shader set by this function), b2dGetTextShader queries active (reads value set by this function), b2dText uses global shader (affected by this function), b2dTextCentered uses global shader (affected by this function), b2dSetTextShaderFloat/etc set parameters (configure shader set by this function).