Alchemy
Loading...
Searching...
No Matches

project.h

Go to the documentation of this file.
1#ifndef ALCHEMY_PROJECT_H
2#define ALCHEMY_PROJECT_H
3
4/// @file
5/// The 3D projection.
6
7#include "types.h"
8#include "static_assert.h"
9
10/// The 3D projection onto the screen: its focal length, near and far depths,
11/// and the screen point the view centres on.
12struct Projection {
16 s32 centerX; ///< screen pixels
17 s32 centerY; ///< screen pixels
18};
19
20STATIC_ASSERT(sizeof(struct Projection) == 0x14);
21STATIC_ASSERT(offsetof(struct Projection, centerX) == 0x0c);
22STATIC_ASSERT(offsetof(struct Projection, centerY) == 0x10);
23
24extern struct Projection gProjection;
25
26#endif
struct Projection gProjection
STATIC_ASSERT, a compile-time check that emits nothing.
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
Definition stddef.h:19
The 3D projection onto the screen: its focal length, near and far depths, and the screen point the vi...
Definition project.h:12
s32 centerX
screen pixels
Definition project.h:16
s32 centerY
screen pixels
Definition project.h:17
s32 near
Definition project.h:14
s32 far
Definition project.h:15
s32 focal
Definition project.h:13
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14