#include <WSprite.hpp>
|
|
| WSpriteManager (class Wasabi *const app) |
| |
| WError | Load () |
| |
| WError | Resize (uint32_t width, uint32_t height) |
| |
| WSprite * | CreateSprite (class WImage *img=nullptr, uint32_t ID=0) const |
| |
| WSprite * | CreateSprite (class WEffect *fx, uint32_t bindingSet, class WImage *img=nullptr, uint32_t ID=0) const |
| |
| class WShader * | GetSpriteVertexShader () const |
| |
| class WShader * | GetSpritePixelShader () const |
| |
| class WEffect * | CreateSpriteEffect (class WRenderTarget *rt=nullptr, class WShader *ps=nullptr, VkPipelineColorBlendAttachmentState bs={}, VkPipelineDepthStencilStateCreateInfo dss={}, VkPipelineRasterizationStateCreateInfo rs={}) const |
| |
|
| WManager (class Wasabi *const a) |
| |
| bool | RegisterChangeCallback (std::string name, std::function< void(WSprite *, bool)> callback) |
| |
| void | RemoveChangeCallback (std::string name) |
| |
| void | AddEntity (WSprite *entity) |
| |
| bool | RemoveEntity (WSprite *entity) |
| |
|
void | OnEntityNameChanged (WSprite *entity, std::string oldName) |
| |
| virtual void | Init () |
| |
| WSprite * | GetEntity (uint32_t ID) const |
| |
| WSprite * | GetEntity (std::string name) const |
| |
| WSprite * | GetEntityByIndex (uint32_t index) const |
| |
| uint32_t | GetEntitiesCount (void) const |
| |
Manager class for WSprite.
◆ CreateSprite() [1/2]
| WSprite* WSpriteManager::CreateSprite |
( |
class WEffect * |
fx, |
|
|
uint32_t |
bindingSet, |
|
|
class WImage * |
img = nullptr, |
|
|
uint32_t |
ID = 0 |
|
) |
| const |
Allocates and initializes a new sprite. If an image is supplied, it will be set to the default sprite's material texture "diffuseTexture".
- Parameters
-
| fx | An effect to be used for this sprite. If nullptr, a default effect will be used |
| bindingSet | The binding set to use to create the material from the given fx |
| img | Image to set to the new sprite |
| ID | Id of the new image |
- Returns
- New sprite
◆ CreateSprite() [2/2]
| WSprite* WSpriteManager::CreateSprite |
( |
class WImage * |
img = nullptr, |
|
|
uint32_t |
ID = 0 |
|
) |
| const |
Allocates and initializes a new sprite. If an image is supplied, it will be set to the default sprite's material texture "diffuseTexture".
- Parameters
-
| img | Image to set to the new sprite |
| ID | Id of the new image |
- Returns
- New sprite
◆ CreateSpriteEffect()
| class WEffect* WSpriteManager::CreateSpriteEffect |
( |
class WRenderTarget * |
rt = nullptr, |
|
|
class WShader * |
ps = nullptr, |
|
|
VkPipelineColorBlendAttachmentState |
bs = {}, |
|
|
VkPipelineDepthStencilStateCreateInfo |
dss = {}, |
|
|
VkPipelineRasterizationStateCreateInfo |
rs = {} |
|
) |
| const |
Creates a new WEffect using the default sprite vertex shader and a supplied pixel shader and other states
- Parameters
-
| rt | Render target intended for this effect. If this is null, the render target will be the backbuffer |
| ps | A pixel/fragment shader to use. If none is provided, the default pixel shader will be used |
| bs | Blend state to use. If none is provided, the default blend state will be used (do not set .colorWriteMask to 0) |
| bs | Depth/stencil state to use. If none is provided, the default depth/stencil state will be used |
| bs | Rasterization state to use. If none is provided, the default rasterization state will be used |
- Returns
- Newly created effect, or nullptr on failure
◆ GetSpritePixelShader()
| class WShader* WSpriteManager::GetSpritePixelShader |
( |
| ) |
const |
Retrieves the default pixel shader that sprites can use.
- Returns
- Default pixel shader that sprites can use
◆ GetSpriteVertexShader()
| class WShader* WSpriteManager::GetSpriteVertexShader |
( |
| ) |
const |
Retrieves the default vertex shader that sprites use.
- Returns
- Default vertex shader that sprites use
◆ Load()
| WError WSpriteManager::Load |
( |
| ) |
|
Loads the manager and creates the default geometry and material.
- Returns
- Error code, see WError.h
◆ Resize()
| WError WSpriteManager::Resize |
( |
uint32_t |
width, |
|
|
uint32_t |
height |
|
) |
| |
Called when the application window is resized.
- Parameters
-
| width | New screen width |
| height | New screen height |
- Returns
- Error code, see WError.h
The documentation for this class was generated from the following file: