[−][src]Struct vxdraw::VxDraw
Main structure that holds all vulkan draw states
VxDraw is the entry-point of the library, from here all resources are spawned and managed.
This structure can safely be dropped and all associated resources will be cleaned up correctly.
Methods
impl VxDraw
[src]
pub fn new(log: Logger, show: ShowWindow) -> VxDraw
[src]
Spawn a new VxDraw context with a window
This method sets up all that is necessary for drawing.
pub fn set_perspective(&mut self, perspective: Matrix4<f32>)
[src]
Set the perspective to be used when drawing geometry
pub fn to_world_coords(&self, screen_coord: (f32, f32)) -> (f32, f32)
[src]
Translate a pixel to the world coordinates according to the current perspective
To set the current perspective see VxDraw::set_perspective.
pub fn set_clear_color(&mut self, color: Color)
[src]
Set the clear color when clearing a frame
pub fn buffer_count(&self) -> usize
[src]
Get how many swapchain images there exist
2 indicates double-buffering, 3 triple-buffering. May return 1 in the case of an OpenGL backend.
pub fn swap_layers(&mut self, layer1: &impl Layerable, layer2: &impl Layerable)
[src]
Swap two layer orders
pub fn get_window_size_in_pixels(&self) -> (u32, u32)
[src]
Get the size of the display window in floats
pub fn get_window_size_in_pixels_float(&self) -> (f32, f32)
[src]
Get the size of the display window in floats
pub fn set_window_size(&mut self, size: (u32, u32))
[src]
Set the size of the display window
pub fn debtri(&mut self) -> Debtri
[src]
Get a handle to all debug triangles, allows editing, removal, or creation of debtris See debtri::Debtri for more details.
pub fn quads(&mut self) -> Quads
[src]
Get a handle to all quads, allows editing, removal, or creation of new quads and layers. See quads::Quads for more details.
pub fn dyntex(&mut self) -> Dyntex
[src]
Get a handle to all dynamic textures, allows editing, removal, or creation of new dynamic textures. See dyntex::Dyntex for more details.
pub fn strtex(&mut self) -> Strtex
[src]
Get a handle to all streaming textures, allows editing, removal, or creation of new streaming textures. See strtex::Strtex for more details.
pub fn text(&mut self) -> Texts
[src]
Drawing text
pub fn events_loop(&mut self) -> Option<EventsLoop>
[src]
Return the events loop of the window
pub fn collect_input(&mut self) -> Vec<Event>
[src]
Please use the events_loop
function instead
Collect all pending input events to this window
pub fn draw_frame_copy_framebuffer(&mut self) -> Vec<u8>
[src]
Draw a frame but also copy the resulting image out
pub fn draw_frame(&mut self)
[src]
Draw a single frame and present it to the screen
The view matrix is used to translate all elements on the screen with the exception of debug triangles and layers that have their own view.
pub fn perspective_projection(&self) -> Matrix4<f32>
[src]
Generate the perspective projection so that the window's size does not stretch its elements. This perspective clamps the shorter axis to -1..1 and the longer axis to whatever its aspect ratio is.
This means that a window wider than tall will show a little more on the left and right edges instead of stretching the image to fill the window.
Trait Implementations
Auto Trait Implementations
impl !Send for VxDraw
impl Unpin for VxDraw
impl !Sync for VxDraw
impl !UnwindSafe for VxDraw
impl !RefUnwindSafe for VxDraw
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Supports<T> for T
[src]
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,