RetroArch
utils.h
Go to the documentation of this file.
1 #ifndef UTILS_H
2 #define UTILS_H
3 
4 #include <psp2/gxm.h>
5 #include <psp2/types.h>
6 #include <psp2/kernel/sysmem.h>
7 
8 /* Misc utils */
9 #define ALIGN(x, a) (((x) + ((a) - 1)) & ~((a) - 1))
10 #define UNUSED(a) (void)(a)
11 #define SCREEN_DPI 220
12 
13 /* GPU utils */
14 void *gpu_alloc(SceKernelMemBlockType type, unsigned int size, unsigned int alignment, unsigned int attribs, SceUID *uid);
15 void gpu_free(SceUID uid);
16 void *vertex_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset);
17 void vertex_usse_free(SceUID uid);
18 void *fragment_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset);
19 void fragment_usse_free(SceUID uid);
20 
21 /* Math utils */
22 
23 #define _PI_OVER_180 0.0174532925199432957692369076849f
24 #define _180_OVER_PI 57.2957795130823208767981548141f
25 
26 #define DEG_TO_RAD(x) (x * _PI_OVER_180)
27 #define RAD_TO_DEG(x) (x * _180_OVER_PI)
28 
29 void matrix_init_orthographic(float *m, float left, float right, float bottom, float top, float near, float far);
30 
31 /* Text utils */
32 
33 #endif
GLsizeiptr size
Definition: glext.h:6559
void * vertex_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset)
Definition: utils.c:37
GLint GLint bottom
Definition: glext.h:8393
int SceUID
Definition: pte_types.h:24
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:11766
void * gpu_alloc(SceKernelMemBlockType type, unsigned int size, unsigned int alignment, unsigned int attribs, SceUID *uid)
Definition: utils.c:5
GLenum type
Definition: glext.h:6233
GLint left
Definition: glext.h:8393
const GLint * attribs
Definition: glext.h:11445
const GLfloat * m
Definition: glext.h:11755
void fragment_usse_free(SceUID uid)
Definition: utils.c:76
void matrix_init_orthographic(float *m, float left, float right, float bottom, float top, float near, float far)
Definition: utils.c:85
GLdouble GLdouble right
Definition: glext.h:11766
void vertex_usse_free(SceUID uid)
Definition: utils.c:52
void gpu_free(SceUID uid)
Definition: utils.c:28
void * fragment_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset)
Definition: utils.c:61