mirror of https://github.com/bjornbytes/lovr.git
Try #pragma once;
This commit is contained in:
parent
c47259ccec
commit
e80f390151
|
@ -4,8 +4,7 @@
|
|||
#include <AL/alc.h>
|
||||
#include <AL/alext.h>
|
||||
|
||||
#ifndef LOVR_AUDIO_TYPES
|
||||
#define LOVR_AUDIO_TYPES
|
||||
#pragma once
|
||||
|
||||
typedef struct {
|
||||
ALCdevice* device;
|
||||
|
@ -15,8 +14,6 @@ typedef struct {
|
|||
float orientation[4];
|
||||
} AudioState;
|
||||
|
||||
#endif
|
||||
|
||||
void lovrAudioInit();
|
||||
void lovrAudioDestroy();
|
||||
void lovrAudioUpdate();
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
#include <AL/al.h>
|
||||
#include <AL/alc.h>
|
||||
|
||||
#ifndef LOVR_SOURCE_TYPES
|
||||
#define LOVR_SOURCE_TYPES
|
||||
#pragma once
|
||||
|
||||
#define SOURCE_BUFFERS 4
|
||||
|
||||
|
@ -31,8 +30,6 @@ typedef struct {
|
|||
int isLooping;
|
||||
} Source;
|
||||
|
||||
#endif
|
||||
|
||||
Source* lovrSourceCreate(SourceData* sourceData);
|
||||
void lovrSourceDestroy(const Ref* ref);
|
||||
int lovrSourceGetBitDepth(Source* source);
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#include "headset/headset.h"
|
||||
#include "vendor/vec/vec.h"
|
||||
|
||||
#ifndef LOVR_EVENT_TYPES
|
||||
#define LOVR_EVENT_TYPES
|
||||
#pragma once
|
||||
|
||||
typedef enum {
|
||||
EVENT_QUIT,
|
||||
|
@ -43,8 +42,6 @@ typedef struct {
|
|||
vec_event_t events;
|
||||
} EventState;
|
||||
|
||||
#endif
|
||||
|
||||
void lovrEventInit();
|
||||
void lovrEventDestroy();
|
||||
void lovrEventAddPump(void (*pump)(void));
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#ifndef LOVR_FILESYSTEM_TYPES
|
||||
#define LOVR_FILESYSTEM_TYPES
|
||||
#pragma once
|
||||
|
||||
#define LOVR_PATH_MAX 1024
|
||||
|
||||
|
@ -10,8 +9,6 @@ typedef struct {
|
|||
char* savePathFull;
|
||||
} FilesystemState;
|
||||
|
||||
#endif
|
||||
|
||||
void lovrFilesystemInit(const char* arg0);
|
||||
void lovrFilesystemDestroy();
|
||||
int lovrFilesystemAppend(const char* path, const char* content, int size);
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
GLFWwindow* window;
|
||||
|
||||
void initGlfw();
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#include "util.h"
|
||||
#include "graphics/texture.h"
|
||||
|
||||
#ifndef LOVR_BUFFER_TYPES
|
||||
#define LOVR_BUFFER_TYPES
|
||||
#pragma once
|
||||
|
||||
typedef enum {
|
||||
BUFFER_POINTS = GL_POINTS,
|
||||
BUFFER_TRIANGLE_STRIP = GL_TRIANGLE_STRIP,
|
||||
|
@ -49,7 +49,6 @@ typedef struct Buffer {
|
|||
int rangeCount;
|
||||
Texture* texture;
|
||||
} Buffer;
|
||||
#endif
|
||||
|
||||
Buffer* lovrBufferCreate(int size, BufferFormat* format, BufferDrawMode drawMode, BufferUsage usage);
|
||||
void lovrBufferDestroy(const Ref* ref);
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
#include "graphics/texture.h"
|
||||
#include "math/math.h"
|
||||
|
||||
#ifndef LOVR_GRAPHICS_TYPES
|
||||
#define LOVR_GRAPHICS_TYPES
|
||||
#pragma once
|
||||
|
||||
#define MAX_TRANSFORMS 64
|
||||
#define MAX_CANVASES 4
|
||||
|
@ -71,8 +70,6 @@ typedef struct {
|
|||
int isWireframe;
|
||||
} GraphicsState;
|
||||
|
||||
#endif
|
||||
|
||||
// Base
|
||||
void lovrGraphicsInit();
|
||||
void lovrGraphicsDestroy();
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
#include "util.h"
|
||||
#include "vendor/vec/vec.h"
|
||||
|
||||
#ifndef LOVR_MODEL_TYPES
|
||||
#define LOVR_MODEL_TYPES
|
||||
#pragma once
|
||||
|
||||
typedef struct {
|
||||
float x;
|
||||
|
@ -52,8 +51,6 @@ typedef struct {
|
|||
Texture* texture;
|
||||
} Model;
|
||||
|
||||
#endif
|
||||
|
||||
Model* lovrModelCreate(ModelData* modelData);
|
||||
void lovrModelDestroy(const Ref* ref);
|
||||
void lovrModelDataDestroy(ModelData* modelData);
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
#include "vendor/map/map.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifndef LOVR_SHADER_TYPES
|
||||
#define LOVR_SHADER_TYPES
|
||||
#pragma once
|
||||
|
||||
#define LOVR_SHADER_POSITION 0
|
||||
#define LOVR_SHADER_NORMAL 1
|
||||
|
@ -30,7 +29,6 @@ typedef struct {
|
|||
float projection[16];
|
||||
unsigned int color;
|
||||
} Shader;
|
||||
#endif
|
||||
|
||||
extern const char* lovrShaderVertexPrefix;
|
||||
extern const char* lovrShaderFragmentPrefix;
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
#include "glfw.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifndef LOVR_SKYBOX_TYPES
|
||||
#define LOVR_SKYBOX_TYPES
|
||||
#pragma once
|
||||
|
||||
typedef struct {
|
||||
Ref ref;
|
||||
GLuint texture;
|
||||
} Skybox;
|
||||
#endif
|
||||
|
||||
Skybox* lovrSkyboxCreate(void** data, int* size);
|
||||
void lovrSkyboxDestroy(const Ref* ref);
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
|
||||
struct CanvasState;
|
||||
|
||||
#ifndef LOVR_TEXTURE_TYPES
|
||||
#define LOVR_TEXTURE_TYPES
|
||||
#pragma once
|
||||
|
||||
typedef struct {
|
||||
void* data;
|
||||
|
@ -46,8 +45,6 @@ typedef struct {
|
|||
int msaa;
|
||||
} Texture;
|
||||
|
||||
#endif
|
||||
|
||||
Texture* lovrTextureCreate(TextureData* textureData);
|
||||
Texture* lovrTextureCreateWithFramebuffer(TextureData* textureData, TextureProjection projection, int msaa);
|
||||
void lovrTextureDestroy(const Ref* ref);
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#include <vendor/vec/vec.h>
|
||||
#include "util.h"
|
||||
|
||||
#ifndef LOVR_HEADSET_TYPES
|
||||
#define LOVR_HEADSET_TYPES
|
||||
#pragma once
|
||||
|
||||
typedef void (*headsetRenderCallback)(int eyeIndex, void* userdata);
|
||||
|
||||
|
@ -65,8 +64,6 @@ typedef struct {
|
|||
void (*renderTo)(void* headset, headsetRenderCallback callback, void* userdata);
|
||||
} Headset;
|
||||
|
||||
#endif
|
||||
|
||||
void lovrHeadsetInit();
|
||||
void lovrHeadsetDestroy();
|
||||
void lovrHeadsetPoll();
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
#include "glfw.h"
|
||||
#include "openvr.h"
|
||||
|
||||
#ifndef LOVR_VIVE_TYPES
|
||||
#define LOVR_VIVE_TYPES
|
||||
#pragma once
|
||||
|
||||
typedef struct {
|
||||
Headset headset;
|
||||
|
@ -31,8 +30,6 @@ typedef struct {
|
|||
Texture* texture;
|
||||
} Vive;
|
||||
|
||||
#endif
|
||||
|
||||
Headset* viveInit();
|
||||
void vivePoll(void* headset);
|
||||
void viveDestroy(void* headset);
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
#include <lualib.h>
|
||||
#include "vendor/map/map.h"
|
||||
|
||||
#ifndef LOVR_LUAX
|
||||
#define LOVR_LUAX
|
||||
#pragma once
|
||||
|
||||
#define luax_checktype(L, i, T) *(T**) luaL_checkudata(L, i, #T)
|
||||
#define luax_pushtype(L, T, x) \
|
||||
|
@ -19,5 +18,3 @@ int luax_releasetype(lua_State* L);
|
|||
void luax_pushenum(lua_State* L, map_int_t* map, int value);
|
||||
void* luax_checkenum(lua_State* L, int index, map_int_t* map, const char* typeName);
|
||||
void* luax_optenum(lua_State* L, int index, const char* fallback, map_int_t* map, const char* typeName);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "math/math.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
#define mat4_init mat4_set
|
||||
mat4 mat4_set(mat4 m, mat4 n);
|
||||
mat4 mat4_fromMat34(mat4 m, float (*n)[4]);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "vendor/vec/vec.h"
|
||||
|
||||
#ifndef LOVR_MATH_TYPES
|
||||
#define LOVR_MATH_TYPES
|
||||
#pragma once
|
||||
|
||||
#define MAX(a, b) a > b ? a : b
|
||||
#define MIN(a, b) a < b ? a : b
|
||||
|
@ -10,5 +9,3 @@ typedef float* vec3;
|
|||
typedef float* quat;
|
||||
typedef float* mat4;
|
||||
typedef vec_t(mat4) vec_mat4_t;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "math/math.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
quat quat_init(quat q, quat r);
|
||||
quat quat_set(quat q, float x, float y, float z, float w);
|
||||
quat quat_fromAngleAxis(quat q, float angle, vec3 axis);
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
#include "util.h"
|
||||
#include "math/math.h"
|
||||
|
||||
#ifndef LOVR_TRANSFORM_TYPES
|
||||
#define LOVR_TRANSFORM_TYPES
|
||||
#pragma once
|
||||
|
||||
typedef struct Transform {
|
||||
Ref ref;
|
||||
float matrix[16];
|
||||
float inverse[16];
|
||||
int isDirty;
|
||||
} Transform;
|
||||
#endif
|
||||
|
||||
Transform* lovrTransformCreate(mat4 transfrom);
|
||||
void lovrTransformDestroy(const Ref* ref);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "math/math.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
vec3 vec3_init(vec3 v, vec3 u);
|
||||
vec3 vec3_set(vec3 v, float x, float y, float z);
|
||||
vec3 vec3_add(vec3 v, vec3 u);
|
||||
|
|
|
@ -4,11 +4,10 @@
|
|||
#endif
|
||||
#include <openvr_capi.h>
|
||||
|
||||
#ifndef OPENVR_TYPES
|
||||
#define OPENVR_TYPES
|
||||
#pragma once
|
||||
|
||||
typedef struct {
|
||||
int isLoaded;
|
||||
RenderModel_t* model;
|
||||
RenderModel_TextureMap_t* texture;
|
||||
} OpenVRModel;
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#ifndef LOVR_TIMER_TYPES
|
||||
#define LOVR_TIMER_TYPES
|
||||
#pragma once
|
||||
|
||||
#define TICK_SAMPLES 60
|
||||
|
||||
|
@ -13,8 +12,6 @@ typedef struct {
|
|||
int fps;
|
||||
} TimerState;
|
||||
|
||||
#endif
|
||||
|
||||
void lovrTimerInit();
|
||||
double lovrTimerGetDelta();
|
||||
double lovrTimerGetTime();
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#include "vendor/vec/vec.h"
|
||||
#include <stddef.h>
|
||||
|
||||
#ifndef LOVR_UTIL
|
||||
#define LOVR_UTIL
|
||||
#pragma once
|
||||
|
||||
#define containerof(ptr, type) ((type*)((char*)(ptr) - offsetof(type, ref)))
|
||||
#define LOVR_COLOR(r, g, b, a) ((a << 0) | (b << 8) | (g << 16) | (r << 24))
|
||||
|
@ -23,5 +22,3 @@ void lovrSleep(double seconds);
|
|||
void* lovrAlloc(size_t size, void (*destructor)(const Ref* ref));
|
||||
void lovrRetain(const Ref* ref);
|
||||
void lovrRelease(const Ref* ref);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue