Skip to content

Commit

Permalink
Update starscape colors
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanlangston committed Jan 7, 2024
1 parent 4bd42b0 commit e1d9821
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Models/Starscape.zig
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ pub const Starscape = struct {
(Shared.Random.Get().float(f32) * (MAX_STAR_SIZE - MIN_STAR_SIZE)) + MIN_STAR_SIZE,
);
}
var renderTexture = raylib.loadRenderTexture(@intFromFloat(screenSize.x), @intFromFloat(screenSize.y));
var starsRenderTexture = raylib.loadRenderTexture(@intFromFloat(screenSize.x), @intFromFloat(screenSize.y));
{
raylib.beginTextureMode(renderTexture);
raylib.beginTextureMode(starsRenderTexture);
defer raylib.endTextureMode();
raylib.clearBackground(Shared.Color.Transparent);
for (stars) |star| {
Expand All @@ -29,13 +29,13 @@ pub const Starscape = struct {
@intFromFloat(star.y),
star.z,
Shared.Color.White,
Shared.Color.Yellow.Light,
Shared.Color.Yellow.Dark,
);
}
}

return Starscape{
.starTexture = renderTexture.texture,
.starTexture = starsRenderTexture.texture,
};
}

Expand All @@ -51,6 +51,7 @@ pub const Starscape = struct {
) void {
const textWidthF: f32 = @floatFromInt(self.starTexture.width);
const textHeightF: f32 = @floatFromInt(self.starTexture.height);

raylib.drawTexturePro(
self.starTexture,
raylib.Rectangle.init(
Expand Down

0 comments on commit e1d9821

Please sign in to comment.