You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.2 KiB
47 lines
1.2 KiB
Content-Type: text/x-zim-wiki
|
|
Wiki-Format: zim 0.4
|
|
Creation-Date: 2020-02-03T23:57:15-08:00
|
|
|
|
====== CanvasFrame ======
|
|
|
|
[[/doc/sfml_rust/canvas/canvas_frame/struct.CanvasFrame.html|Documentation]]
|
|
|
|
===== Details =====
|
|
|
|
Canvas frame is at it's core, an accumulator of meta data to draw to the screen.
|
|
|
|
In reality it is a fairly inneficient accumulator of `enum VertexType`s. This enum is the only real way I found to preserve type safety when passing dynamic amounts of differently typed data
|
|
|
|
This enum consists of (currently) :
|
|
* TextureType(Vec<TextureVertex2D>, Arc<CanvasTextureHandle>),
|
|
* ImageType(Vec<ImageVertex2D>, Arc<CanvasImageHandle>)
|
|
* ColorType(Vec<ColorVertex2D>)
|
|
* ThreeDType(Vec<Vertex3D>)
|
|
|
|
Cool enough, we can enforce the handle type as well using this
|
|
|
|
===== Future =====
|
|
|
|
I like this immediate interface for this simple style of UI and drawing. Unless I need some other sort of data or data which has links to other data, I don't see any interface being much better.
|
|
|
|
|
|
|
|
--------------------
|
|
|
|
===== Data =====
|
|
|
|
**Borrowed:**
|
|
[[VKProcessor::CanvasContainerClasses|CanvasTextureHandle
|
|
CanvasImageHandle
|
|
CanvasFontHandle]]
|
|
|
|
**Owns:**
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
|
|
|
|
|