Blame |
Last modification |
View Log
| RSS feed
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BauzoidNET.graphics.renderstates
{
public abstract class RenderStatesObject
{
protected RenderStates mRenderStates = null;
protected bool mLocked = false;
/** Constructor. */
public RenderStatesObject(RenderStates renderStates)
{
mRenderStates = renderStates;
}
/** Initialize the render state by setting its initial value. */
public void initialize()
{
activate(true);
}
/** Activate a render state - calls as activate(false). */
public void activate()
{
activate(false);
}
/* Activate a render state with force parameter. */
public abstract void activate(bool force);
/** Reset a render state to default values. */
public abstract void reset();
/** Deactivate render states by resetting its values. */
public void deactivate()
{
reset();
activate(false);
}
/** Lock the render state, disallowing any changes. */
public void lockState(bool isLocked)
{
mLocked = isLocked;
}
/** Check if the render state is locked. */
public bool isLocked()
{
return mLocked;
}
/** Get the parent render states object. */
public RenderStates getRenderStates()
{
return mRenderStates;
}
}
}