2018-12-17 22:40:07 +00:00
|
|
|
#include "data/modelData.h"
|
2019-12-10 21:01:28 +00:00
|
|
|
#include "core/util.h"
|
2017-10-21 21:00:33 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-04-05 11:58:29 +00:00
|
|
|
struct Texture;
|
|
|
|
struct Shader;
|
|
|
|
|
|
|
|
typedef struct Material {
|
2018-02-12 03:16:40 +00:00
|
|
|
float scalars[MAX_MATERIAL_SCALARS];
|
2018-01-30 05:44:32 +00:00
|
|
|
Color colors[MAX_MATERIAL_COLORS];
|
2019-04-05 11:58:29 +00:00
|
|
|
struct Texture* textures[MAX_MATERIAL_TEXTURES];
|
2018-07-18 08:17:16 +00:00
|
|
|
float transform[9];
|
2017-10-21 21:00:33 +00:00
|
|
|
} Material;
|
|
|
|
|
2018-12-19 08:15:08 +00:00
|
|
|
Material* lovrMaterialInit(Material* material);
|
2018-12-19 08:25:20 +00:00
|
|
|
#define lovrMaterialCreate() lovrMaterialInit(lovrAlloc(Material))
|
2018-02-26 08:59:03 +00:00
|
|
|
void lovrMaterialDestroy(void* ref);
|
2019-04-05 11:58:29 +00:00
|
|
|
void lovrMaterialBind(Material* material, struct Shader* shader);
|
2018-02-12 03:16:40 +00:00
|
|
|
float lovrMaterialGetScalar(Material* material, MaterialScalar scalarType);
|
|
|
|
void lovrMaterialSetScalar(Material* material, MaterialScalar scalarType, float value);
|
2017-10-21 21:00:33 +00:00
|
|
|
Color lovrMaterialGetColor(Material* material, MaterialColor colorType);
|
|
|
|
void lovrMaterialSetColor(Material* material, MaterialColor colorType, Color color);
|
2019-04-05 11:58:29 +00:00
|
|
|
struct Texture* lovrMaterialGetTexture(Material* material, MaterialTexture textureType);
|
|
|
|
void lovrMaterialSetTexture(Material* material, MaterialTexture textureType, struct Texture* texture);
|
2018-07-18 08:17:16 +00:00
|
|
|
void lovrMaterialGetTransform(Material* material, float* ox, float* oy, float* sx, float* sy, float* angle);
|
|
|
|
void lovrMaterialSetTransform(Material* material, float ox, float oy, float sx, float sy, float angle);
|