Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 787 | chris | 1 | using System; |
| 2 | using System.Collections.Generic; |
||
| 3 | using System.Linq; |
||
| 4 | using System.Text; |
||
| 5 | using System.Threading.Tasks; |
||
| 6 | |||
| 7 | namespace BauzoidNET.graphics.renderstates |
||
| 8 | { |
||
| 9 | public abstract class RenderStatesObject |
||
| 10 | { |
||
| 11 | protected RenderStates mRenderStates = null; |
||
| 12 | protected bool mLocked = false; |
||
| 13 | |||
| 14 | /** Constructor. */ |
||
| 15 | public RenderStatesObject(RenderStates renderStates) |
||
| 16 | { |
||
| 17 | mRenderStates = renderStates; |
||
| 18 | } |
||
| 19 | |||
| 20 | /** Initialize the render state by setting its initial value. */ |
||
| 21 | public void initialize() |
||
| 22 | { |
||
| 23 | activate(true); |
||
| 24 | } |
||
| 25 | |||
| 26 | /** Activate a render state - calls as activate(false). */ |
||
| 27 | public void activate() |
||
| 28 | { |
||
| 29 | activate(false); |
||
| 30 | } |
||
| 31 | |||
| 32 | /* Activate a render state with force parameter. */ |
||
| 33 | public abstract void activate(bool force); |
||
| 34 | |||
| 35 | /** Reset a render state to default values. */ |
||
| 36 | public abstract void reset(); |
||
| 37 | |||
| 38 | /** Deactivate render states by resetting its values. */ |
||
| 39 | public void deactivate() |
||
| 40 | { |
||
| 41 | reset(); |
||
| 42 | activate(false); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** Lock the render state, disallowing any changes. */ |
||
| 46 | public void lockState(bool isLocked) |
||
| 47 | { |
||
| 48 | mLocked = isLocked; |
||
| 49 | } |
||
| 50 | |||
| 51 | /** Check if the render state is locked. */ |
||
| 52 | public bool isLocked() |
||
| 53 | { |
||
| 54 | return mLocked; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** Get the parent render states object. */ |
||
| 58 | public RenderStates getRenderStates() |
||
| 59 | { |
||
| 60 | return mRenderStates; |
||
| 61 | } |
||
| 62 | } |
||
| 63 | } |