mirror of https://github.com/bjornbytes/lovr.git
Clean up some includes;
This commit is contained in:
parent
0e318aa46e
commit
8c714c45b0
|
@ -1,5 +1,6 @@
|
|||
#include "api.h"
|
||||
#include "data/textureData.h"
|
||||
#include "data/blob.h"
|
||||
|
||||
static int l_lovrTextureDataEncode(lua_State* L) {
|
||||
TextureData* textureData = luax_checktype(L, 1, TextureData);
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "data/modelData.h"
|
||||
#include "data/rasterizer.h"
|
||||
#include "data/textureData.h"
|
||||
#include "core/os.h"
|
||||
#include "core/util.h"
|
||||
#include <math.h>
|
||||
#include <stdbool.h>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "api.h"
|
||||
#include "graphics/canvas.h"
|
||||
#include "graphics/graphics.h"
|
||||
#include "graphics/texture.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
static int luax_checkattachment(lua_State* L, int index, Attachment* attachment) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "api.h"
|
||||
#include "graphics/buffer.h"
|
||||
#include "graphics/shader.h"
|
||||
#include "data/blob.h"
|
||||
#include "core/maf.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "api.h"
|
||||
#include "graphics/buffer.h"
|
||||
#include "graphics/shader.h"
|
||||
#include "data/blob.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
typedef struct {
|
||||
typedef struct WindowFlags {
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
bool fullscreen;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "data/textureData.h"
|
||||
#include "data/blob.h"
|
||||
#include "lib/stb/stb_image.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
#include "data/blob.h"
|
||||
#include "core/util.h"
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
struct Blob;
|
||||
|
||||
typedef enum {
|
||||
FORMAT_RGB,
|
||||
FORMAT_RGBA,
|
||||
|
@ -52,19 +53,19 @@ typedef struct {
|
|||
|
||||
typedef struct TextureData {
|
||||
ref_t ref;
|
||||
Blob* blob;
|
||||
struct Blob* blob;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
Blob* source;
|
||||
struct Blob* source;
|
||||
TextureFormat format;
|
||||
Mipmap* mipmaps;
|
||||
uint32_t mipmapCount;
|
||||
} TextureData;
|
||||
|
||||
TextureData* lovrTextureDataCreate(uint32_t width, uint32_t height, Blob* contents, uint8_t value, TextureFormat format);
|
||||
TextureData* lovrTextureDataCreateFromBlob(Blob* blob, bool flip);
|
||||
TextureData* lovrTextureDataCreate(uint32_t width, uint32_t height, struct Blob* contents, uint8_t value, TextureFormat format);
|
||||
TextureData* lovrTextureDataCreateFromBlob(struct Blob* blob, bool flip);
|
||||
Color lovrTextureDataGetPixel(TextureData* textureData, uint32_t x, uint32_t y);
|
||||
void lovrTextureDataSetPixel(TextureData* textureData, uint32_t x, uint32_t y, Color color);
|
||||
Blob* lovrTextureDataEncode(TextureData* textureData);
|
||||
struct Blob* lovrTextureDataEncode(TextureData* textureData);
|
||||
void lovrTextureDataPaste(TextureData* textureData, TextureData* source, uint32_t dx, uint32_t dy, uint32_t sx, uint32_t sy, uint32_t w, uint32_t h);
|
||||
void lovrTextureDataDestroy(void* ref);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "graphics/texture.h"
|
||||
#include "data/textureData.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "event/event.h"
|
||||
#include "math/math.h"
|
||||
#include "core/maf.h"
|
||||
#include "core/os.h"
|
||||
#include "core/util.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#include "graphics/font.h"
|
||||
#include "data/modelData.h"
|
||||
#include "core/maf.h"
|
||||
#include "core/os.h"
|
||||
#include "core/util.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -15,6 +13,7 @@ struct Material;
|
|||
struct Mesh;
|
||||
struct Shader;
|
||||
struct Texture;
|
||||
struct WindowFlags;
|
||||
|
||||
typedef void (*StencilCallback)(void* userdata);
|
||||
|
||||
|
@ -88,7 +87,7 @@ typedef struct {
|
|||
bool lovrGraphicsInit(bool debug);
|
||||
void lovrGraphicsDestroy(void);
|
||||
void lovrGraphicsPresent(void);
|
||||
void lovrGraphicsCreateWindow(WindowFlags* flags);
|
||||
void lovrGraphicsCreateWindow(struct WindowFlags* flags);
|
||||
int lovrGraphicsGetWidth(void);
|
||||
int lovrGraphicsGetHeight(void);
|
||||
float lovrGraphicsGetPixelDensity(void);
|
||||
|
|
|
@ -3,9 +3,18 @@
|
|||
#include "graphics/shader.h"
|
||||
#include "graphics/texture.h"
|
||||
#include "resources/shaders.h"
|
||||
#include "core/util.h"
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
struct Material {
|
||||
ref_t ref;
|
||||
float scalars[MAX_MATERIAL_SCALARS];
|
||||
Color colors[MAX_MATERIAL_COLORS];
|
||||
struct Texture* textures[MAX_MATERIAL_TEXTURES];
|
||||
float transform[9];
|
||||
};
|
||||
|
||||
Material* lovrMaterialCreate() {
|
||||
Material* material = calloc(1, sizeof(Material));
|
||||
lovrAssert(material, "Out of memory");
|
||||
|
|
|
@ -1,19 +1,11 @@
|
|||
#include "data/modelData.h"
|
||||
#include "core/util.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
struct Texture;
|
||||
struct Shader;
|
||||
|
||||
typedef struct Material {
|
||||
ref_t ref;
|
||||
float scalars[MAX_MATERIAL_SCALARS];
|
||||
Color colors[MAX_MATERIAL_COLORS];
|
||||
struct Texture* textures[MAX_MATERIAL_TEXTURES];
|
||||
float transform[9];
|
||||
} Material;
|
||||
|
||||
typedef struct Material Material;
|
||||
Material* lovrMaterialCreate(void);
|
||||
void lovrMaterialDestroy(void* ref);
|
||||
void lovrMaterialBind(Material* material, struct Shader* shader);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "graphics/shader.h"
|
||||
#include "graphics/texture.h"
|
||||
#include "resources/shaders.h"
|
||||
#include "data/blob.h"
|
||||
#include "data/modelData.h"
|
||||
#include "math/math.h"
|
||||
#include <math.h>
|
||||
|
|
|
@ -16,11 +16,13 @@
|
|||
#include "resources/bindings_vive_tracker_right_foot.json.h"
|
||||
#include "resources/bindings_vive_tracker_camera.json.h"
|
||||
#include "resources/bindings_vive_tracker_keyboard.json.h"
|
||||
#include "data/blob.h"
|
||||
#include "event/event.h"
|
||||
#include "filesystem/filesystem.h"
|
||||
#include "graphics/graphics.h"
|
||||
#include "graphics/canvas.h"
|
||||
#include "graphics/model.h"
|
||||
#include "graphics/texture.h"
|
||||
#include "core/maf.h"
|
||||
#include "core/os.h"
|
||||
#include <stdbool.h>
|
||||
|
|
|
@ -10,6 +10,14 @@ static const size_t vectorComponents[] = {
|
|||
[V_MAT4] = 16
|
||||
};
|
||||
|
||||
struct Pool {
|
||||
ref_t ref;
|
||||
float* data;
|
||||
size_t count;
|
||||
size_t cursor;
|
||||
size_t generation;
|
||||
};
|
||||
|
||||
Pool* lovrPoolCreate() {
|
||||
Pool* pool = calloc(1, sizeof(Pool));
|
||||
lovrAssert(pool, "Out of memory");
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "core/util.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
|
@ -24,14 +23,7 @@ typedef union {
|
|||
} handle;
|
||||
} Vector;
|
||||
|
||||
typedef struct Pool {
|
||||
ref_t ref;
|
||||
float* data;
|
||||
size_t count;
|
||||
size_t cursor;
|
||||
size_t generation;
|
||||
} Pool;
|
||||
|
||||
typedef struct Pool Pool;
|
||||
Pool* lovrPoolCreate(void);
|
||||
void lovrPoolDestroy(void* ref);
|
||||
void lovrPoolGrow(Pool* pool, size_t count);
|
||||
|
|
Loading…
Reference in New Issue