Unloading PBRMAterial
I forgot unloading PBRMaterial
This commit is contained in:
parent
39dac7c5a3
commit
ed075ce357
|
|
@ -157,9 +157,11 @@ int main()
|
|||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
UnloadModel(floor.model);
|
||||
//UnloadModel(model.model); // Unload model
|
||||
UnloadShader(shader); // Unload Shader
|
||||
UnloadModel(floor.model); // Unload model
|
||||
UnloadModel(model.model); // Unload model
|
||||
UnloadShader(shader); // Unload Shader
|
||||
UnloadPBRMaterial(floor_mat); // Unload PBRMaterial
|
||||
UnloadPBRMaterial(model_mat); // Unload PBRMaterial
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ void PBRSetAmbient(Shader shader, Color color, float intensity);
|
|||
|
||||
PBRModel PBRModelLoad(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 PBRSetVec2(PBRMaterial *pbrMat,PBRVec2Type type,Vector2 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){
|
||||
if(pbrMat == NULL) return;
|
||||
switch(pbrColorType){
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user