WgpuRenderer

Struct WgpuRenderer 

Source
pub struct WgpuRenderer {
Show 37 fields pub context: GraphicsContext, pub pipelines: PipelineMap, pub user_pipelines: UserPipelineMap, pub shaders: RefCell<ShaderMap>, pub render_targets: RefCell<RenderTargetMap>, pub text: RefCell<TextRasterizer>, pub egui_winit: State, pub egui_render_routine: RefCell<EguiRenderRoutine>, pub screenshot_buffer: SizedBuffer, pub vertex_buffer: SizedBuffer, pub index_buffer: SizedBuffer, pub quad_ubg: UniformBindGroup, pub texture_layout: Arc<BindGroupLayout>, pub window: &'static Window, pub depth_texture: Arc<Texture>, pub first_pass_texture: BindableTexture, pub lights_buffer: Buffer, pub global_lighting_params_buffer: Buffer, pub bloom: Bloom, pub post_processing_effects: RefCell<Vec<PostProcessingEffect>>, pub render_texture_format: TextureFormat, pub tonemapping_texture: BindableTexture, pub camera_uniform: CameraUniform, pub camera_buffer: Buffer, pub camera_bind_group: Arc<BindGroup>, pub camera_bind_group_layout: BindGroupLayout, pub color: Color, pub enable_z_buffer: bool, pub texture_creator: Arc<AtomicRefCell<WgpuTextureCreator>>, pub thread_pool: ThreadPool, pub loaded_image_recv: Receiver<LoadedImage>, pub loaded_image_send: Sender<LoadedImage>, pub textures: Arc<Mutex<TextureMap>>, pub sprite_shader_id: ShaderId, pub error_shader_id: ShaderId, pub screenshot_params: ScreenshotParams, pub screenshot_history_buffer: VecDeque<ScreenshotItem>,
}

Fields§

§context: GraphicsContext§pipelines: PipelineMap§user_pipelines: UserPipelineMap§shaders: RefCell<ShaderMap>§render_targets: RefCell<RenderTargetMap>§text: RefCell<TextRasterizer>§egui_winit: State§egui_render_routine: RefCell<EguiRenderRoutine>§screenshot_buffer: SizedBuffer§vertex_buffer: SizedBuffer§index_buffer: SizedBuffer§quad_ubg: UniformBindGroup§texture_layout: Arc<BindGroupLayout>§window: &'static Window§depth_texture: Arc<Texture>§first_pass_texture: BindableTexture§lights_buffer: Buffer§global_lighting_params_buffer: Buffer§bloom: Bloom§post_processing_effects: RefCell<Vec<PostProcessingEffect>>§render_texture_format: TextureFormat§tonemapping_texture: BindableTexture§camera_uniform: CameraUniform§camera_buffer: Buffer§camera_bind_group: Arc<BindGroup>§camera_bind_group_layout: BindGroupLayout§color: Color§enable_z_buffer: bool§texture_creator: Arc<AtomicRefCell<WgpuTextureCreator>>§thread_pool: ThreadPool§loaded_image_recv: Receiver<LoadedImage>§loaded_image_send: Sender<LoadedImage>§textures: Arc<Mutex<TextureMap>>§sprite_shader_id: ShaderId§error_shader_id: ShaderId§screenshot_params: ScreenshotParams§screenshot_history_buffer: VecDeque<ScreenshotItem>

Implementations§

Source§

impl WgpuRenderer

Source

pub async fn new(window: &'static Window, egui_winit: State) -> Self

Source

pub fn window(&self) -> &Window

Source

pub fn render_post_processing( &mut self, screen_view: &TextureView, game_config: &GameConfig, )

Source

pub fn render_egui(&self, view: &TextureView, egui: &Context)

Source

pub fn on_event(&mut self, event: &WindowEvent, _egui_ctx: &Context) -> bool

Source

pub fn as_mut_any(&mut self) -> &mut dyn Any

Source

pub fn update(&mut self, params: &mut DrawParams<'_>)

Source

pub fn draw(&mut self, params: DrawParams<'_>, egui: &Context)

Source

pub fn scale_factor(&self) -> f32

Source

pub fn resize(&mut self, new_size: UVec2)

Source

pub fn width(&self) -> f32

Source

pub fn height(&self) -> f32

Source

pub fn end_frame(&mut self)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Any for T
where T: Any,

Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> WasmNotSend for T
where T: Send,