Create types that replace, wrap around, derive from, or are compatible with the OpenTK types that inhabit AptitudeEngine.
why?
We use OpenTK a lot. Everything including the GameWindow context and it's events is OpenTK. Which means that there is a high likely hood that the developer thats using AptitudeEngine may also have to reference OpenTK to use some of those types.
how?
12 actually touches on this issue and is technically a step in the direction this issue is intended to be taking.
Enums are castable.
Two enums of the same sub type can be casted between eachother, so implementing an enum in AptitudeEngine like this:
public enum VSyncMode
{
Off = 0,
On = 1,
Adaptive = 2
}
would immediately be castable to OpenTK's VSyncMode like so:
We actually do this already because of #2 in Vector2's implicit cast overrides to OpenTK's Vector2 seen here:
public static implicit operator OpenTK.Vector2(Vector2 vec)
=> new OpenTK.Vector2(vec.X, vec.Y);
Classes are inheritable
Our version of, say, GraphicsMode can just derive from OpenTK.Graphics.GraphicsMode with a few hiding variables when needed like so:
public class GraphicsMode : OpenTK.Graphics.GraphicsMode
{
public static new readonly GraphicsMode Default
= (GraphicsMode)OpenTK.Graphics.GraphicsMode.Default;
}
what?
Create types that replace, wrap around, derive from, or are compatible with the OpenTK types that inhabit AptitudeEngine.
why?
We use OpenTK a lot. Everything including the GameWindow context and it's events is OpenTK. Which means that there is a high likely hood that the developer thats using AptitudeEngine may also have to reference OpenTK to use some of those types.
how?
12 actually touches on this issue and is technically a step in the direction this issue is intended to be taking.
Enums are castable.
Two enums of the same sub type can be casted between eachother, so implementing an enum in AptitudeEngine like this:
would immediately be castable to OpenTK's
VSyncMode
like so:Structs are implicitly castable when overriden
We actually do this already because of #2 in
Vector2
's implicit cast overrides to OpenTK'sVector2
seen here:Classes are inheritable
Our version of, say,
GraphicsMode
can just derive fromOpenTK.Graphics.GraphicsMode
with a few hiding variables when needed like so: