Skip to content

Commit

Permalink
defer raylib.endTextureMode();
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanlangston committed Jan 4, 2024
1 parent 411d782 commit 1c326a6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Models/Meteor.zig
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ pub const Meteor = struct {
defer raylib.unloadRenderTexture(meteorRenderTexture);
{
raylib.beginTextureMode(meteorRenderTexture);
defer raylib.endTextureMode();

// Draw Meteor
const spriteFrame = MeteorSprite.getSpriteFrame(@intFromFloat(meteor.frame));
Expand All @@ -275,8 +276,6 @@ pub const Meteor = struct {
meteor.rotation * 365,
Shared.Color.Tone.Light,
);

raylib.endTextureMode();
}
const meteorRenderImage = raylib.Image.fromTexture(meteorRenderTexture.texture);
defer meteorRenderImage.unload();
Expand All @@ -285,6 +284,7 @@ pub const Meteor = struct {
defer raylib.unloadRenderTexture(playerRenderTexture);
{
raylib.beginTextureMode(playerRenderTexture);
defer raylib.endTextureMode();

// Draw Player
const shipTexture = Shared.Texture.Get(.Ship);
Expand All @@ -298,8 +298,6 @@ pub const Meteor = struct {
player.rotation,
Shared.Color.Tone.Light,
);

raylib.endTextureMode();
}
const playerRenderImage = raylib.Image.fromTexture(playerRenderTexture.texture);
defer playerRenderImage.unload();
Expand Down

0 comments on commit 1c326a6

Please sign in to comment.