Skip to content

Commit

Permalink
change clear_color's default value to grey
Browse files Browse the repository at this point in the history
  • Loading branch information
BlaiZephyr committed Jan 16, 2025
1 parent 3407f1c commit 7d0379d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ pub struct ConfigBackend {
#[default = false]
pub vsync: bool,
/// Default clear color
#[default = ConfRgb::black()]
#[default = ConfRgb::grey()]
pub clear_color: ConfRgb,
#[default = "auto"]
pub gpu: String,
Expand Down
2 changes: 0 additions & 2 deletions lib/graphics/src/handles/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,13 @@ pub mod backend {
pub fn consumble_multi_samples(&self) {
self.add_cmd(AllCommands::Misc(CommandsMisc::ConsumeMultiSamplingTargets));
}

/// Updates the clear color of the backend
pub fn update_clear_color(&self, clear_color: ColorRgba) {
self.add_cmd(AllCommands::Render(CommandsRender::Clear(CommandClear {
color: clear_color,
force_clear: false,
})));
}

pub fn indices_for_quads_required_notify(&self, quad_count_required: u64) {
let cmd = CommandIndicesForQuadsRequiredNotify {
quad_count_required,
Expand Down
2 changes: 1 addition & 1 deletion misc
2 changes: 1 addition & 1 deletion src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2284,10 +2284,10 @@ impl ClientNativeImpl {

match name.as_str() {
"gl.vsync" => {
// update vsync val in backend
self.on_vsync_change();
}
"gl.clear_color" => {
// update vsync val in backend
self.graphics.backend_handle.update_clear_color(ColorRgba {
r: self.config.engine.gl.clear_color.r as f32 / 255.0,
g: self.config.engine.gl.clear_color.g as f32 / 255.0,
Expand Down

0 comments on commit 7d0379d

Please sign in to comment.