Unloading PBRMAterial
I forgot unloading PBRMaterial
This commit is contained in:
parent
39dac7c5a3
commit
ed075ce357
|
|
@ -157,10 +157,12 @@ int main()
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
UnloadModel(floor.model);
|
UnloadModel(floor.model); // Unload model
|
||||||
//UnloadModel(model.model); // Unload model
|
UnloadModel(model.model); // Unload model
|
||||||
UnloadShader(shader); // Unload Shader
|
UnloadShader(shader); // Unload Shader
|
||||||
|
UnloadPBRMaterial(floor_mat); // Unload PBRMaterial
|
||||||
|
UnloadPBRMaterial(model_mat); // Unload PBRMaterial
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,7 @@ void PBRSetAmbient(Shader shader, Color color, float intensity);
|
||||||
|
|
||||||
PBRModel PBRModelLoad(const char *fileName);
|
PBRModel PBRModelLoad(const char *fileName);
|
||||||
void PBRLoadTextures(PBRMaterial *pbrMat,PBRTexType pbrTexType,const char *fileName);
|
void PBRLoadTextures(PBRMaterial *pbrMat,PBRTexType pbrTexType,const char *fileName);
|
||||||
|
void UnloadPBRMaterial(PBRMaterial pbrMat)
|
||||||
void PBRSetColor(PBRMaterial *pbrMat,PBRColorType pbrColorType,Color color);
|
void PBRSetColor(PBRMaterial *pbrMat,PBRColorType pbrColorType,Color color);
|
||||||
void PBRSetVec2(PBRMaterial *pbrMat,PBRVec2Type type,Vector2 value);
|
void PBRSetVec2(PBRMaterial *pbrMat,PBRVec2Type type,Vector2 value);
|
||||||
void PBRSetFloat(PBRMaterial *pbrMat, PBRFloatType pbrParamType, float value);
|
void PBRSetFloat(PBRMaterial *pbrMat, PBRFloatType pbrParamType, float value);
|
||||||
|
|
@ -334,6 +335,13 @@ void PBRLoadTextures(PBRMaterial *pbrMat,PBRTexType pbrTexType,const char *fileN
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UnloadPBRMaterial(PBRMaterial pbrMat){
|
||||||
|
if(pbrMat.useTexAlbedo == 1) UnloadTexture(pbrMat.texAlbedo);
|
||||||
|
if(pbrMat.useTexNormal == 1) UnloadTexture(pbrMat.texNormal);
|
||||||
|
if(pbrMat.useTexMRA == 1) UnloadTexture(pbrMat.texMRA);
|
||||||
|
if(pbrMat.useTexEmissive == 1) UnloadTexture(pbrMat.texEmissive);
|
||||||
|
}
|
||||||
|
|
||||||
void PBRSetColor(PBRMaterial *pbrMat,PBRColorType pbrColorType,Color color){
|
void PBRSetColor(PBRMaterial *pbrMat,PBRColorType pbrColorType,Color color){
|
||||||
if(pbrMat == NULL) return;
|
if(pbrMat == NULL) return;
|
||||||
switch(pbrColorType){
|
switch(pbrColorType){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user