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.
86 lines
2.1 KiB
86 lines
2.1 KiB
Content-Type: text/x-zim-wiki
|
|
Wiki-Format: zim 0.4
|
|
Creation-Date: 2020-02-03T23:30:41-08:00
|
|
|
|
====== CanvasState ======
|
|
|
|
[[/doc/sfml_rust/canvas/canvas_state/struct.CanvasState.html|Documentation]]
|
|
|
|
===== Details =====
|
|
|
|
The gist of this class is basically draw everything 2D and have all the resources to do so. It holds binary buffer blobs for resources, it's own compiled shaders, render_pass, and all of the vertex buffers in order to draw those binary buffer blobs.
|
|
|
|
**window_size_dependent_setup** is currently hosted inside this class. If a second graphics class is added I will add some shared library for this to live.
|
|
|
|
**render_pass **the render pass is created with our depth stencil/color data **D32Sfloat_S8Uint **attachment for the render output. This is highly shader dependent. Also depends on the DynamicState
|
|
|
|
|
|
===== Interface =====
|
|
|
|
Generally there is a getter for the resource handle & pointer and a load (or create) for each of the stored items.
|
|
|
|
The class then interacts with these stored items by taking and executing a list of operations to perform on them.
|
|
|
|
[[VKProcessor::CanvasFrame|CanvasFrame]]
|
|
An object which accumulate frame draws. The State will then parse this list of calls and display them on the screen
|
|
|
|
|
|
--------------------
|
|
|
|
=== canvas ===
|
|
I made a maybe(?) good change to the heirarchy of the canvas. Hiding the construction of handles from anything outside.
|
|
|
|
Currently, canvas is separated out to
|
|
* A state container: CanvasState
|
|
* An Interface class CanvasFrame
|
|
* `Managed` objects. Aka, everything that CanvasState holds
|
|
|
|
CanvasText is just laying around until I use it...
|
|
Shader pipeline objects exists in one level of managed
|
|
Handle and Buffer objects exists in the base managed level
|
|
|
|
== Do I commit to the all handles in handles.rs? ==
|
|
|
|
FYI The shader API is actually pretty badass
|
|
|
|
load_shader::<GenericShader, ColorVertex2D>("shadername", a, b);
|
|
|
|
--------------------
|
|
|
|
===== Data =====
|
|
|
|
**Borrowed:**
|
|
queue
|
|
device
|
|
|
|
**Owns:**
|
|
render_pass
|
|
[[CanvasImage]]
|
|
[[VKProcessor:CanvasTexture|CanvasTexture]]
|
|
[[CanvasFont]]
|
|
[[CompiledShader]]
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|