UnloadMaterial can also optionally free textures and shader.
This commit is contained in:
@@ -43,7 +43,7 @@ function RL.init()
|
||||
} )
|
||||
model = RL.LoadModel( RL.GetBasePath().."../resources/iqm/monkey.iqm" )
|
||||
-- Unload old material.
|
||||
RL.UnloadMaterial( RL.GetModelMaterial( model, 0 ) )
|
||||
RL.UnloadMaterial( RL.GetModelMaterial( model, 0 ), true )
|
||||
|
||||
RL.SetModelMaterial( model, 0, material )
|
||||
animations = RL.LoadModelAnimations( RL.GetBasePath().."../resources/iqm/monkey.iqm" )
|
||||
|
||||
@@ -286,7 +286,7 @@ local function drawPlayer()
|
||||
end
|
||||
|
||||
function RL.draw()
|
||||
RL.ClearBackground( RL.RED )
|
||||
RL.ClearBackground( RL.BLACK )
|
||||
|
||||
RL.BeginTextureMode( framebuffer )
|
||||
drawMap()
|
||||
|
||||
@@ -14,11 +14,10 @@ out vec4 finalColor;
|
||||
// NOTE: Add here your custom variables
|
||||
|
||||
void main() {
|
||||
// Texel color fetching from texture sampler
|
||||
vec4 texelColor = texture( texture0, fragTexCoord );
|
||||
// Texel color fetching from texture sampler
|
||||
vec4 texelColor = texture( texture0, fragTexCoord );
|
||||
|
||||
// NOTE: Implement here your fragment shader code
|
||||
// NOTE: Implement here your fragment shader code
|
||||
|
||||
finalColor = texelColor * colDiffuse;
|
||||
finalColor = texelColor * colDiffuse;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@ out vec4 fragColor;
|
||||
// NOTE: Add here your custom variables
|
||||
|
||||
void main() {
|
||||
// Send vertex attributes to fragment shader
|
||||
fragTexCoord = vertexTexCoord;
|
||||
fragColor = vertexColor;
|
||||
// Send vertex attributes to fragment shader
|
||||
fragTexCoord = vertexTexCoord;
|
||||
fragColor = vertexColor;
|
||||
|
||||
// Calculate final vertex position
|
||||
gl_Position = mvp * vec4( vertexPosition, 1.0 );
|
||||
// Calculate final vertex position
|
||||
gl_Position = mvp * vec4( vertexPosition, 1.0 );
|
||||
}
|
||||
Reference in New Issue
Block a user