IceShard 1
A personal game engine project, with development focused on 2D/2.5D games.
Loading...
Searching...
No Matches
types.hxx
Go to the documentation of this file.
1
3
4#pragma once
5#include <cmath>
6#include <cstdint>
7
8namespace ice
9{
10
11 using utf8 = char8_t; // might need to be changed to unisgned char later.
12 using utf16 = char16_t;
13 using utf32 = char32_t;
14 using wchar = wchar_t;
15
16 using f32 = float;
17 using f64 = double;
18
19 using i8 = std::int8_t;
20 using i16 = std::int16_t;
21 using i32 = std::int32_t;
22 using i64 = std::int64_t;
23
24 using u8 = std::uint8_t;
25 using u16 = std::uint16_t;
26 using u32 = std::uint32_t;
27 using u64 = std::uint64_t;
28
29 using uptr = std::uintptr_t;
30
31 // Forward declaration of ref types
32 struct ref8;
33 struct ref16;
34 struct ref32;
35
36 // Forward declaration of time-types
37 struct Ts;
38 struct Tms;
39 struct Tus;
40 struct Tns;
41
42 // Note: Added these checks, because the previous definition using std::float_t resulted in f32 being a 'long double' type.
43 static_assert(sizeof(f32) == 4, "We expect 'float' types to be 4 bytes.");
44 static_assert(sizeof(f64) == 8, "We expect 'double' types to be 8 bytes.");
45
46} // namespace ice
SPDX-License-Identifier: MIT.
Definition array.hxx:12
std::int8_t i8
Definition types.hxx:19
std::uint64_t u64
Definition types.hxx:27
std::int32_t i32
Definition types.hxx:21
double f64
Definition types.hxx:17
wchar_t wchar
Definition types.hxx:14
std::uint16_t u16
Definition types.hxx:25
std::uintptr_t uptr
Definition types.hxx:29
std::int64_t i64
Definition types.hxx:22
char32_t utf32
Definition types.hxx:13
std::uint32_t u32
Definition types.hxx:26
char16_t utf16
Definition types.hxx:12
float f32
Definition types.hxx:16
std::int16_t i16
Definition types.hxx:20
std::uint8_t u8
Definition types.hxx:24
char8_t utf8
Definition types.hxx:11
Represents time interval of milliseconds.
Definition clock_types.hxx:38
Represents time interval of nanoseconds.
Definition clock_types.hxx:73
Represents time interval of seconds.
Definition clock_types.hxx:21
Represents time interval of microseconds.
Definition clock_types.hxx:56
Holds 'offset' and 'size' fields (u16) to access data stored in a buffer-like object.
Definition ref.hxx:19
Holds 'offset' and 'size' fields (u32) to access data stored in a buffer-like object.
Definition ref.hxx:12
Holds 'offset' and 'size' fields (u8) to access data stored in a buffer-like object.
Definition ref.hxx:28