MTek-GDL 0.100.4-muffintrap
Loading...
Searching...
No Matches
mgdl-types.h
Go to the documentation of this file.
1#pragma once
2
3// PI and other constants
4// Does not work on windows
5#ifdef __cplusplus
6#include <cmath>
7#include <cstdint>
8#else
9#include <math.h>
10#include <stdint.h>
11#include <stdbool.h>
12#endif
13
14// Vector types
15#include <mgdl/mgdl-vectorfunctions.h>
16
17#include <mgdl/mgdl-opengl.h>
18
19// For MacOS
20#include <stddef.h>
21
22#ifdef GEKKO
23
24#include <gctypes.h>
25
26#else
27
28// Mimic ogc type names on PC platforms
29typedef uint8_t u8;
30typedef uint16_t u16;
31typedef int16_t s16;
32typedef uint32_t u32;
33
34#endif
35
36#ifdef MGDL_PLATFORM_WINDOWS
37typedef ssize_t sizetype;
38const double M_PI = 3.14159265358979323846;
39const double M_PI_2 = 1.57079632679489661923;
40#else
41typedef size_t sizetype;
42#endif
43
44
48typedef void (*CallbackFunction)(void);
49
61typedef enum ColorFormats ColorFormats;
62
76
95
102 Diffuse, // Straightforward texture
103 Matcap // Mesh UV's are recalculated to sample from texture based on the camera view matrix
104};
105typedef enum MaterialType MaterialType;
106
113 Centered = 0x7ff0,
114 PCentered = 0x7ff1,
115 Pivot = 0x7ff2,
116 CPivot = 0x7ff3,
117 RJustify = 0x7ff4,
118 LJustify = 0x7ff5
120typedef enum AlignmentModes AlignmentModes;
121
122// Screen aspect ratios supported
123enum ScreenAspect {
124 ScreenAuto, // Use system default
125 Screen16x9,
126 Screen4x3
127};
128typedef enum ScreenAspect ScreenAspect;
129
130// Flags for initializing the system. They can be combined
131enum PlatformInitFlag
132{
133 FlagNone = 0x0,
134 FlagPauseUntilA = 0x01, // Enters a loop after system init and continues when A button is pressed
135 FlagFullScreen = 0x02, // Start in full screen mode
136 FlagSplashScreen = 0x04, // Show splash screen with logo. If FlagPauseUntilA is set will stay in splash screen
137};
138typedef enum PlatformInitFlag PlatformInitFlag;
139
140// Debug font contains these glyphs
141enum IconSymbol
142{
143 Icon_Dot = 0x7f,
144 Icon_FaceInvert = 0x80,
145 Icon_Face,
146 Icon_ArrowUp,
147 Icon_TriangleUp,
148 Icon_ScrollArrow,
149 Icon_Printer,
150 Icon_Skull,
151 Icon_LightningBolt,
152 Icon_Notes,
153 Icon_Sparkle,
154 Icon_Key,
155 Icon_Chevrons,
156 Icon_Alien,
157 Icon_Spiral,
158 Icon_FloppyDisk,
159 Icon_Folder,
160 Icon_Lock,
161 Icon_Bird,
162 Icon_Clock,
163 Icon_Ghost,
164 Icon_Pill,
165 Icon_SquareWave,
166 Icon_SawWave,
167 Icon_TriangleWave,
168 Icon_Bottle,
169 Icon_PartyLeben,
170 Icon_WiFi,
171 Icon_Popsicle,
172 Icon_CursorPoint, // : DiagonalFill
173 Icon_CursorBase,
174 Icon_NekoEar, // CursorWing: These are the same. Rotate Ear 90 right to get cursor
175 Icon_NekoFace,
176 IconSymbol_Count,
177
178 Icon_DiagonalFill = Icon_CursorPoint,
179 Icon_CursorWing = Icon_NekoEar
180};
181typedef enum IconSymbol IconSymbol;
182
183
184enum MeshAttributeFlags
185{
186 FlagNormals = 1,
187 FlagUVs = 2,
188 FlagColors = 4
189};
190typedef enum MeshAttributeFlags MeshAttributeFlags;
191
192enum CameraMode
193{
194 CameraTarget = 0,
195 CameraDirection = 1
196};
197typedef enum CameraMode CameraMode;
198
199// Windows uses Rectangle
200struct Rect
201{
202 short x;
203 short y;
204 short w;
205 short h;
206};
207typedef struct Rect Rect;
208
209// Windows uses Rectangle
210struct RectF
211{
212 float x;
213 float y;
214 float w;
215 float h;
216};
217typedef struct RectF RectF;
218
AlignmentModes
Alignment modes.
Definition mgdl-types.h:112
@ CPivot
Definition mgdl-types.h:116
@ RJustify
Definition mgdl-types.h:117
@ Centered
Definition mgdl-types.h:113
@ LJustify
Definition mgdl-types.h:118
@ PCentered
Definition mgdl-types.h:114
@ Pivot
Definition mgdl-types.h:115
TextureWrapModes
Texture wrap modes.
Definition mgdl-types.h:70
@ Clamp
Clamped (no wrap).
Definition mgdl-types.h:71
@ Repeat
Repeated wrap (only applicable to power of two textures).
Definition mgdl-types.h:72
@ Mirror
Mirrored wrap (only applicable to power of two textures).
Definition mgdl-types.h:73
ColorFormats
Input color format options.
Definition mgdl-types.h:55
@ GrayAlpha
16-bit grayscale with alpha (I8A8).
Definition mgdl-types.h:57
@ RGB
24-bit true-color RGB (R8G8B8).
Definition mgdl-types.h:58
@ Gray
8-bit grayscale (I8).
Definition mgdl-types.h:56
@ RGBA
32-bit true-color RGBA (R8G8B8A8).
Definition mgdl-types.h:59
MaterialType
Material types.
Definition mgdl-types.h:101
void(* CallbackFunction)(void)
Callback function type needed for platform initializing and rendering.
Definition mgdl-types.h:48
TextureFilterModes
Texture filter modes.
Definition mgdl-types.h:86
@ Nearest
Nearest-neighbor interpolation.
Definition mgdl-types.h:87
@ Linear
Linear interpolation.
Definition mgdl-types.h:88
@ NR_MM_LN
Near-mipmap-Linear (texture must be mipmapped).
Definition mgdl-types.h:91
@ NR_MM_NR
Near-mipmap-Near (texture must be mipmapped).
Definition mgdl-types.h:89
@ LN_MM_NR
Linear-mipmap-Near (texture must be mipmapped).
Definition mgdl-types.h:90
@ LN_MM_LN
Linear-mipmap-Linear (texture must be mipmapped).
Definition mgdl-types.h:92
Definition mgdl-types.h:211
Definition mgdl-types.h:201