Returns entity render flags bitfield controlling rendering behavior.
Takes entity (entity handle from b3dCreate* functions, positive integer).
Returns integer bitfield flags (combination of flag bits, 0 on error).
3D Graphics
Parameters & Returns
Parameters
entityInt
Returns
Int
Quick Summary
Returns entity render flags bitfield controlling rendering behavior.
Takes entity (entity handle from b3dCreate* functions, positive integer).
Returns integer bitfield flags (combination of flag bits, 0 on error).
Technical Exegesis...
Returns entity render flags bitfield controlling rendering behavior. Takes entity (entity handle from b3dCreate* functions, positive integer). Returns integer bitfield flags (combination of flag bits, 0 on error). Queries current render state flags that control visibility, shadow casting, picking, and other rendering properties.
Returns entity render flags bitfield controlling rendering behavior. Takes entity (entity handle from b3dCreate* functions, positive integer). Returns integer bitfield flags (combination of flag bits, 0 on error). Queries current render state flags that control visibility, shadow casting, picking, and other rendering properties.
Render flags (bitfield values): specific bit values control different rendering features, flags combined using bitwise OR (multiple flags active simultaneously), check individual flags using bitwise AND (test specific flag state), modify flags using b3dSetEntityRenderFlags.
Use cases: (1) Query visibility state (check if entity hidden or visible), (2) Check shadow casting (determine if entity casts shadows), (3) Verify picking enabled (check if entity responds to ray picking), (4) Save render state (backup flags before modification: oldFlags%=b3dGetEntityRenderFlags(entity%): later restore), (5) Conditional rendering logic (If (b3dGetEntityRenderFlags(entity%) AND FLAG_VISIBLE)>0 Then entity visible).
Common patterns: save flags = oldFlags%=b3dGetEntityRenderFlags(entity%); check flag = If (b3dGetEntityRenderFlags(entity%) AND SPECIFIC_FLAG)>0 Then flag is set; test multiple = flags%=b3dGetEntityRenderFlags(entity%): If (flags% AND FLAG1)>0 AND (flags% AND FLAG2)>0 Then both set.
Flag operations: get current flags with b3dGetEntityRenderFlags, set new flags with b3dSetEntityRenderFlags (replaces all flags), combine flags with bitwise OR (flag1 | flag2 | flag3), test flags with bitwise AND ((flags AND test_flag) > 0 means flag is set).
Return values: 0 on error (invalid entity handle, prints error to stderr), integer bitfield on success (combined flag values, 0=no flags set).
Performance: very fast O(1) lookup (simple entity field access, ~0.0001ms), no calculation or GPU access required, suitable for per-frame queries.
Render behavior: flags control various rendering aspects (visibility, shadows, picking, culling, etc.), changes take effect immediately (next b3dRenderWorld call), flags stored per-entity (different entities have independent flag states).
Bitwise operations: use bitwise AND to test flags (If (flags% AND 1)>0 Then bit 0 set), use bitwise OR to combine flags (flags%=FLAG_A OR FLAG_B OR FLAG_C), use bitwise XOR to toggle flags (flags%=flags% XOR FLAG_TOGGLE).
Typical usage patterns: visibility check before logic (If (b3dGetEntityRenderFlags(entity%) AND VISIBLE_FLAG)>0 Then update entity), shadow toggle decision (check if entity should cast shadows), picking validation (verify entity is pickable before ray tests), state restoration (save/restore during temporary visibility changes).