Game Development Reference
In-Depth Information
The sprite class will contain the sprite data, but a separate renderer class
will be responsible for rendering the sprites. Separating the functionality in this
way allows the rendering code to be optimized later.
Here are the three structures.
[StructLayout(LayoutKind.Sequential)]
public struct Vector
{
public double X { get; set; }
public double Y { get; set; }
public double Z { get; set; }
public Vector(double x, double y, double z) : this()
{
X=x;
Y=y;
Z=z;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct Point
{
public float X { get; set; }
public float Y { get; set; }
public Point(float x, float y)
: this()
{
X=x;
Y=y;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct Color
{
public float Red { get; set; }
public float Green { get; set; }
public float Blue { get; set; }
Search WWH ::




Custom Search