lovr/src/graphics/material.h

31 lines
825 B
C
Raw Normal View History

2017-10-21 21:00:33 +00:00
#include "graphics/texture.h"
#include "util.h"
2017-10-31 08:14:09 +00:00
#include <stdbool.h>
2017-10-21 21:00:33 +00:00
#pragma once
2018-01-30 05:44:32 +00:00
typedef enum {
COLOR_DIFFUSE,
MAX_MATERIAL_COLORS
} MaterialColor;
typedef enum {
TEXTURE_DIFFUSE,
TEXTURE_ENVIRONMENT_MAP,
MAX_MATERIAL_TEXTURES
} MaterialTexture;
2017-10-21 21:00:33 +00:00
typedef struct {
Ref ref;
2018-01-30 05:44:32 +00:00
Color colors[MAX_MATERIAL_COLORS];
2017-10-21 21:00:33 +00:00
Texture* textures[MAX_MATERIAL_TEXTURES];
2017-10-31 08:14:09 +00:00
bool isDefault;
2017-10-21 21:00:33 +00:00
} Material;
2018-01-30 05:44:32 +00:00
Material* lovrMaterialCreate(bool isDefault);
2017-10-21 21:00:33 +00:00
void lovrMaterialDestroy(const Ref* ref);
Color lovrMaterialGetColor(Material* material, MaterialColor colorType);
void lovrMaterialSetColor(Material* material, MaterialColor colorType, Color color);
Texture* lovrMaterialGetTexture(Material* material, MaterialTexture textureType);
void lovrMaterialSetTexture(Material* material, MaterialTexture textureType, Texture* texture);