// Copyright 2014-2017 ClassicalSharp | Licensed under BSD-3 using System; using System.Drawing; using System.Runtime.InteropServices; using OpenTK; namespace ClassicalSharp.GraphicsAPI { /// 3 floats for position (XYZ),
/// 4 bytes for colour (RGBA if OpenGL, BGRA if Direct3D)
/// Use FastColour.Pack to convert colours to the correct swizzling. [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct VertexP3fC4b { public float X, Y, Z; public int Colour; public VertexP3fC4b(float x, float y, float z, int c) { X = x; Y = y; Z = z; Colour = c; } public const int Size = 16; // (4 + 4 + 4) + (1 + 1 + 1 + 1) } /// 3 floats for position (XYZ),
/// 2 floats for texture coordinates (UV),
/// 4 bytes for colour (RGBA if OpenGL, BGRA if Direct3D)
/// Use FastColour.Pack to convert colours to the correct swizzling. [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct VertexP3fT2fC4b { public float X, Y, Z; public int Colour; public float U, V; public VertexP3fT2fC4b(float x, float y, float z, float u, float v, int c) { X = x; Y = y; Z = z; U = u; V = v; Colour = c; } public VertexP3fT2fC4b(ref Vector3 p, float u, float v, int c) { X = p.X; Y = p.Y; Z = p.Z; U = u; V = v; Colour = c; } public const int Size = 24; // 3 * 4 + 2 * 4 + 4 * 1 } }