mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-27 05:18:27 +00:00
delete unused code for dummy platform and renderer backends
This commit is contained in:
parent
286562a9b9
commit
5cfd7fe182
@ -2,7 +2,7 @@ use std::{
|
|||||||
cell::UnsafeCell,
|
cell::UnsafeCell,
|
||||||
ffi::{c_void, CStr},
|
ffi::{c_void, CStr},
|
||||||
os::raw::{c_char, c_int},
|
os::raw::{c_char, c_int},
|
||||||
sync::{Mutex, MutexGuard},
|
sync::Mutex,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{PlatformIo, Viewport};
|
use crate::{PlatformIo, Viewport};
|
||||||
@ -175,92 +175,11 @@ pub(crate) extern "C" fn platform_create_vk_surface(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The default [`PlatformViewportBackend`], does nothing.
|
|
||||||
pub(crate) struct DummyPlatformViewportBackend {}
|
|
||||||
impl PlatformViewportBackend for DummyPlatformViewportBackend {
|
|
||||||
fn create_window(&mut self, _viewport: &mut Viewport) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn destroy_window(&mut self, _viewport: &mut Viewport) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn show_window(&mut self, _viewport: &mut Viewport) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_window_pos(&mut self, _viewport: &mut Viewport, _pos: [f32; 2]) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_window_pos(&mut self, _viewport: &mut Viewport) -> [f32; 2] {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_window_size(&mut self, _viewport: &mut Viewport, _size: [f32; 2]) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_window_size(&mut self, _viewport: &mut Viewport) -> [f32; 2] {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_window_focus(&mut self, _viewport: &mut Viewport) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_window_focus(&mut self, _viewport: &mut Viewport) -> bool {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_window_minimized(&mut self, _viewport: &mut Viewport) -> bool {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_window_title(&mut self, _viewport: &mut Viewport, _title: &str) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_window_alpha(&mut self, _viewport: &mut Viewport, _alpha: f32) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn update_window(&mut self, _viewport: &mut Viewport) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn render_window(&mut self, _viewport: &mut Viewport) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn swap_buffers(&mut self, _viewport: &mut Viewport) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn create_vk_surface(
|
|
||||||
&mut self,
|
|
||||||
_viewport: &mut Viewport,
|
|
||||||
_instance: u64,
|
|
||||||
_out_surface: &mut u64,
|
|
||||||
) -> i32 {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Just holds a [`PlatformViewportBackend`].
|
/// Just holds a [`PlatformViewportBackend`].
|
||||||
pub(crate) struct PlatformViewportContext {
|
pub(crate) struct PlatformViewportContext {
|
||||||
pub(crate) backend: Box<dyn PlatformViewportBackend>,
|
pub(crate) backend: Box<dyn PlatformViewportBackend>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PlatformViewportContext {
|
|
||||||
pub(crate) fn dummy() -> Self {
|
|
||||||
Self {
|
|
||||||
backend: Box::new(DummyPlatformViewportBackend {}),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsafe impl Send for PlatformViewportContext {}
|
unsafe impl Send for PlatformViewportContext {}
|
||||||
|
|
||||||
/// Trait that holds optional functions for a rendering backend to support multiple viewports.
|
/// Trait that holds optional functions for a rendering backend to support multiple viewports.
|
||||||
@ -299,43 +218,11 @@ pub(crate) extern "C" fn renderer_swap_buffers(viewport: *mut Viewport, _arg: *m
|
|||||||
ctx.backend.swap_buffers(unsafe { &mut *viewport });
|
ctx.backend.swap_buffers(unsafe { &mut *viewport });
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The default [`RendererViewportBackend`], does nothing.
|
|
||||||
pub(crate) struct DummyRendererViewportBackend {}
|
|
||||||
impl RendererViewportBackend for DummyRendererViewportBackend {
|
|
||||||
fn create_window(&mut self, _viewport: &mut Viewport) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn destroy_window(&mut self, _viewport: &mut Viewport) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_window_size(&mut self, _viewport: &mut Viewport, _size: [f32; 2]) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn render_window(&mut self, _viewport: &mut Viewport) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn swap_buffers(&mut self, _viewport: &mut Viewport) {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Just holds a [`RendererViewportBackend`].
|
/// Just holds a [`RendererViewportBackend`].
|
||||||
pub(crate) struct RendererViewportContext {
|
pub(crate) struct RendererViewportContext {
|
||||||
pub(crate) backend: Box<dyn RendererViewportBackend>,
|
pub(crate) backend: Box<dyn RendererViewportBackend>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RendererViewportContext {
|
|
||||||
pub(crate) fn dummy() -> Self {
|
|
||||||
Self {
|
|
||||||
backend: Box::new(DummyRendererViewportBackend {}),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsafe impl Send for RendererViewportContext {}
|
unsafe impl Send for RendererViewportContext {}
|
||||||
|
|
||||||
/// Describes a monitor that can be used by ImGui.
|
/// Describes a monitor that can be used by ImGui.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user