Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
hakolao committed Jan 31, 2022
1 parent 207bfa7 commit e123a14
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions examples/circle/render_system_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl Plugin for MainRenderPlugin {
/// Insert our render pass at startup
fn insert_render_pass_system(mut commands: Commands, vulkano_windows: Res<VulkanoWindows>) {
let vulkano_window = vulkano_windows
.get_vulkano_window(WindowId::primary())
.get_window_renderer(WindowId::primary())
.unwrap();
let queue = vulkano_window.graphics_queue();
let format = vulkano_window.swapchain_format();
Expand All @@ -90,7 +90,7 @@ fn pre_render_setup_system(
mut pipeline_frame_data: ResMut<WindowSyncData>,
) {
for (window_id, mut frame_data) in pipeline_frame_data.frame_data.iter_mut() {
if let Some(vulkano_window) = vulkano_windows.get_vulkano_window_mut(*window_id) {
if let Some(vulkano_window) = vulkano_windows.get_window_renderer_mut(*window_id) {
let before = match vulkano_window.start_frame() {
Err(e) => {
bevy::log::error!("Failed to start frame: {}", e);
Expand All @@ -109,7 +109,7 @@ fn post_render_system(
mut pipeline_frame_data: ResMut<WindowSyncData>,
) {
for (window_id, frame_data) in pipeline_frame_data.frame_data.iter_mut() {
if let Some(vulkano_window) = vulkano_windows.get_vulkano_window_mut(*window_id) {
if let Some(vulkano_window) = vulkano_windows.get_window_renderer_mut(*window_id) {
#[cfg(feature = "example_has_gui")]
if let Some(after) = frame_data.after.take() {
let final_image_view = vulkano_window.final_image();
Expand All @@ -134,7 +134,7 @@ pub fn main_render_system(
mut render_pass_deferred: ResMut<RenderPassDeferred>,
) {
let mut frame_data = pipeline_frame_data.get_mut(WindowId::primary()).unwrap();
if let Some(vulkano_window) = vulkano_windows.get_vulkano_window_mut(WindowId::primary()) {
if let Some(vulkano_window) = vulkano_windows.get_window_renderer_mut(WindowId::primary()) {
// We take the before pipeline future leaving None in its place
if let Some(before_future) = frame_data.before.take() {
let final_image_view = vulkano_window.final_image();
Expand Down Expand Up @@ -175,7 +175,7 @@ pub fn main_render_system(
#[cfg(feature = "example_has_gui")]
fn set_gui_styles_system(vulkano_windows: Res<VulkanoWindows>) {
let primary_window = vulkano_windows
.get_vulkano_window(WindowId::primary())
.get_window_renderer(WindowId::primary())
.unwrap();
let _ctx = primary_window.gui_context();
// Set styles here... for primary window
Expand All @@ -184,7 +184,7 @@ fn set_gui_styles_system(vulkano_windows: Res<VulkanoWindows>) {
#[cfg(feature = "example_has_gui")]
fn main_gui_system(vulkano_windows: Res<VulkanoWindows>, diagnostics: Res<Diagnostics>) {
let primary_window = vulkano_windows
.get_vulkano_window(WindowId::primary())
.get_window_renderer(WindowId::primary())
.unwrap();
let ctx = primary_window.gui_context();
egui::Area::new("fps")
Expand Down
2 changes: 1 addition & 1 deletion examples/multi_window_gui/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fn create_new_window_system(
#[cfg(feature = "example_has_gui")]
pub fn main_render_system_primary_window(mut vulkano_windows: ResMut<VulkanoWindows>) {
let vulkano_window = vulkano_windows
.get_vulkano_window_mut(WindowId::primary())
.get_window_renderer_mut(WindowId::primary())
.unwrap();
// Start Frame
let before = match vulkano_window.start_frame() {
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fn update_on_resize_system(
changed_window_ids.push(event.id);
}
for id in changed_window_ids {
if let Some(vulkano_window) = windows.get_vulkano_window_mut(id) {
if let Some(vulkano_window) = windows.get_window_renderer_mut(id) {
// Swap chain will be resized at the beginning of next frame. But user should update pipeline frame data
vulkano_window.resize();
// Insert or update pipeline frame data
Expand Down Expand Up @@ -411,7 +411,7 @@ pub fn winit_runner_with(mut app: App) {
return;
};
if let Some(vulkano_window) =
vulkano_winit_windows.get_vulkano_window_mut(window_id)
vulkano_winit_windows.get_window_renderer_mut(window_id)
{
// Update egui with the window event
vulkano_window.gui().update(event_wrapper);
Expand Down
4 changes: 2 additions & 2 deletions src/vulkano_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ impl VulkanoWindows {
)
}

pub fn get_vulkano_window_mut(&mut self, id: WindowId) -> Option<&mut VulkanoWindowRenderer> {
pub fn get_window_renderer_mut(&mut self, id: WindowId) -> Option<&mut VulkanoWindowRenderer> {
self.window_id_to_winit
.get(&id)
.and_then(|id| self.windows.get_mut(id))
}

pub fn get_vulkano_window(&self, id: WindowId) -> Option<&VulkanoWindowRenderer> {
pub fn get_window_renderer(&self, id: WindowId) -> Option<&VulkanoWindowRenderer> {
self.window_id_to_winit
.get(&id)
.and_then(|id| self.windows.get(id))
Expand Down

0 comments on commit e123a14

Please sign in to comment.