mirror of https://github.com/bjornbytes/lovr.git
Struct cleanup;
This commit is contained in:
parent
24ba340929
commit
eaf26ce4b8
|
@ -9,8 +9,8 @@
|
|||
typedef struct {
|
||||
Ref ref;
|
||||
ALCdevice* device;
|
||||
bool isRecording;
|
||||
const char* name;
|
||||
bool isRecording;
|
||||
int sampleRate;
|
||||
int bitDepth;
|
||||
int channelCount;
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
|
||||
typedef struct {
|
||||
Buffer* buffer;
|
||||
AttributeType type;
|
||||
int components;
|
||||
size_t offset;
|
||||
int stride;
|
||||
int divisor;
|
||||
size_t stride;
|
||||
AttributeType type;
|
||||
uint8_t components;
|
||||
uint8_t divisor;
|
||||
bool enabled;
|
||||
} MeshAttribute;
|
||||
|
||||
|
|
|
@ -84,8 +84,8 @@ struct Buffer {
|
|||
Ref ref;
|
||||
void* data;
|
||||
size_t size;
|
||||
uint32_t id;
|
||||
GLsync lock;
|
||||
uint32_t id;
|
||||
BufferUsage usage;
|
||||
};
|
||||
|
||||
|
@ -94,8 +94,8 @@ struct ShaderBlock {
|
|||
BlockType type;
|
||||
vec_uniform_t uniforms;
|
||||
map_int_t uniformMap;
|
||||
GLenum target;
|
||||
Buffer* buffer;
|
||||
GLenum target;
|
||||
uint8_t incoherent;
|
||||
};
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ void lovrThrow(const char* format, ...) {
|
|||
void* _lovrAlloc(const char* type, size_t size, void (*destructor)(void*)) {
|
||||
void* object = calloc(1, size);
|
||||
if (!object) return NULL;
|
||||
*((Ref*) object) = (Ref) { 1, type, destructor };
|
||||
*((Ref*) object) = (Ref) { .free = destructor, .type = type, .count = 1 };
|
||||
return object;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,14 +16,12 @@
|
|||
#define ALIGN(p, n) ((uintptr_t) p & -n)
|
||||
|
||||
typedef struct ref {
|
||||
int count;
|
||||
const char* type;
|
||||
void (*free)(void*);
|
||||
const char* type;
|
||||
int count;
|
||||
} Ref;
|
||||
|
||||
typedef struct {
|
||||
float r, g, b, a;
|
||||
} Color;
|
||||
typedef struct { float r, g, b, a; } Color;
|
||||
|
||||
typedef void (*lovrErrorHandler)(void* userdata, const char* format, va_list args);
|
||||
extern _Thread_local lovrErrorHandler lovrErrorCallback;
|
||||
|
|
Loading…
Reference in New Issue