Base class for input controls with a specific value type.
Inheritance
InputControl<TValue>
public abstract class InputControl<TValue> : InputControl where TValue : struct
Type Parameters
Name |
Description |
TValue |
Type of value captured by the control. Note that this does not mean
that the control has to store data in the given value format. A control that captures float
values, for example, may be stored in state as byte values instead.
|
Properties
Declaration
public override int valueSizeInBytes { get; }
Property Value
Overrides
Declaration
public override Type valueType { get; }
Property Value
Overrides
Methods
Declaration
public override bool CompareValue(void *firstStatePtr, void *secondStatePtr)
Parameters
Type |
Name |
Description |
Void* |
firstStatePtr |
|
Void* |
secondStatePtr |
|
Returns
Overrides
Declaration
public TValue ProcessValue(TValue value)
Parameters
Type |
Name |
Description |
TValue |
value |
|
Returns
Get the control's default value.
Declaration
public TValue ReadDefaultValue()
Returns
Type |
Description |
TValue |
The control's default value.
|
Declaration
public TValue ReadUnprocessedValue()
Returns
Declaration
public abstract TValue ReadUnprocessedValueFromState(void *statePtr)
Parameters
Type |
Name |
Description |
Void* |
statePtr |
|
Returns
Declaration
public TValue ReadValue()
Returns
Type |
Description |
TValue |
The control's current value.
|
Declaration
public override object ReadValueFromBufferAsObject(void *buffer, int bufferSize)
Parameters
Type |
Name |
Description |
Void* |
buffer |
|
Int32 |
bufferSize |
|
Returns
Overrides
Declaration
public TValue ReadValueFromPreviousFrame()
Returns
Type |
Description |
TValue |
The control's value in the previous frame.
|
Declaration
public TValue ReadValueFromState(void *statePtr)
Parameters
Type |
Name |
Description |
Void* |
statePtr |
|
Returns
Read the control's final, processed value from the given state and return the value as an object.
Declaration
public override object ReadValueFromStateAsObject(void *statePtr)
Parameters
Type |
Name |
Description |
Void* |
statePtr |
|
Returns
Type |
Description |
Object |
The control's value as stored in statePtr .
|
Overrides
Read the control's final, processed value from the given state and store it in the given buffer.
Declaration
public override void ReadValueFromStateIntoBuffer(void *statePtr, void *bufferPtr, int bufferSize)
Parameters
Type |
Name |
Description |
Void* |
statePtr |
State to read the value for the control from.
|
Void* |
bufferPtr |
Buffer to store the value in.
|
Int32 |
bufferSize |
Size of bufferPtr in bytes. Must be at least valueSizeInBytes.
If it is smaller, will be thrown.
|
Overrides
Declaration
public override void WriteValueFromBufferIntoState(void *bufferPtr, int bufferSize, void *statePtr)
Parameters
Type |
Name |
Description |
Void* |
bufferPtr |
|
Int32 |
bufferSize |
|
Void* |
statePtr |
|
Overrides
Read a value object and store it as state in the given memory.
Declaration
public override void WriteValueFromObjectIntoState(object value, void *statePtr)
Parameters
Type |
Name |
Description |
Object |
value |
Value for the control.
|
Void* |
statePtr |
State containing the control's stateBlock. Will receive
the state state as converted from the given value.
|
Overrides
Declaration
public virtual void WriteValueIntoState(TValue value, void *statePtr)
Parameters
Type |
Name |
Description |
TValue |
value |
|
Void* |
statePtr |
|
Extension Methods