-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtility.h
More file actions
34 lines (28 loc) · 1.06 KB
/
Copy pathUtility.h
File metadata and controls
34 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef ANDROIDGLINVESTIGATIONS_UTILITY_H
#define ANDROIDGLINVESTIGATIONS_UTILITY_H
#include <cassert>
class Utility {
public:
static bool checkAndLogGlError(bool alwaysLog = false);
static inline void assertGlError() { assert(checkAndLogGlError()); }
/**
* Generates an orthographic projection matrix given the half height, aspect ratio, near, and far
* planes
*
* @param outMatrix the matrix to write into
* @param halfHeight half of the height of the screen
* @param aspect the width of the screen divided by the height
* @param near the distance of the near plane
* @param far the distance of the far plane
* @return the generated matrix, this will be the same as @a outMatrix so you can chain calls
* together if needed
*/
static float *buildOrthographicMatrix(
float *outMatrix,
float halfHeight,
float aspect,
float near,
float far);
static float *buildIdentityMatrix(float *outMatrix);
};
#endif //ANDROIDGLINVESTIGATIONS_UTILITY_H