mirror of https://github.com/bjornbytes/lovr.git
Add MaterialData;
This commit is contained in:
parent
4935816457
commit
1f6a80ee85
|
@ -0,0 +1,19 @@
|
|||
#include "loaders/material.h"
|
||||
|
||||
MaterialData* lovrMaterialDataCreateEmpty() {
|
||||
MaterialData* materialData = malloc(sizeof(MaterialData));
|
||||
|
||||
for (int i = 0; i < MAX_MATERIAL_COLORS; i++) {
|
||||
materialData->colors[i] = (Color) { 0xff, 0xff, 0xff, 0xff };
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_MATERIAL_TEXTURES; i++) {
|
||||
materialData->textures[i] = NULL;
|
||||
}
|
||||
|
||||
return materialData;
|
||||
}
|
||||
|
||||
void lovrMaterialDataDestroy(MaterialData* materialData) {
|
||||
free(materialData);
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
#include "loaders/texture.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
typedef enum {
|
||||
COLOR_DIFFUSE,
|
||||
MAX_MATERIAL_COLORS
|
||||
} MaterialColor;
|
||||
|
||||
typedef enum {
|
||||
TEXTURE_DIFFUSE,
|
||||
MAX_MATERIAL_TEXTURES
|
||||
} MaterialTexture;
|
||||
|
||||
typedef struct {
|
||||
Color colors[MAX_MATERIAL_COLORS];
|
||||
TextureData* textures[MAX_MATERIAL_TEXTURES];
|
||||
} MaterialData;
|
||||
|
||||
MaterialData* lovrMaterialDataCreateEmpty();
|
||||
void lovrMaterialDataDestroy(MaterialData* materialData);
|
Loading…
Reference in New Issue