1 module cat.wheel.structs; 2 3 import bindbc.sdl; 4 5 /** 6 * A rectangle. 7 * 8 * That's it. 9 * 10 * Nothing else. 11 * 12 * It's a rectangle, what more do you want? 13 */ 14 struct Rect { 15 16 /** 17 * The wrapped SDL rectangle 18 */ 19 SDL_Rect sdl; 20 21 /** 22 * Constructs the Rect from four integers 23 */ 24 this(int x, int y, int w, int h) { 25 sdl.x = x; 26 sdl.y = y; 27 sdl.w = w; 28 sdl.h = h; 29 } 30 31 alias sdl this; 32 } 33 34 /** 35 * An RGBA colour 36 */ 37 struct Color { 38 /// The red value of the color 39 ubyte r; 40 41 /// The green value of the color 42 ubyte g; 43 44 /// The blue value of the color 45 ubyte b; 46 47 /// The transparency of the color, dependent on the blend mode used 48 ubyte a; 49 } 50 51 /** 52 * A 2-dimensional vector 53 */ 54 struct Vector2 { 55 /// 56 int x, y; 57 } 58 59 struct Vector2F { 60 float x, y; 61 } 62 63 /** 64 * A 3-dimensional vector 65 */ 66 struct Vector3 { 67 /// 68 int x, y, z; 69 } 70 71 struct Vector3F { 72 float x, y, z; 73 }