class BuiltinResources

Holds references to built-in resources used by the core engine.

Public

Constructors

BuiltinResources

BuiltinResources() = default

Methods

~BuiltinResources

~BuiltinResources() noexcept

GetDefaultGUIStyleSheet

const HGUIStyleSheet &GetDefaultGUIStyleSheet() const

Returns the default style sheet used by the GUI, if no other style sheet is provided.

GetDefaultGUIStyleSheetCascade

SPtr<const GUIStyleSheetCascade> GetDefaultGUIStyleSheetCascade() const

Returns the default style sheet for GUI elements.

GetWhiteSpriteTexture

const HSpriteTexture &GetWhiteSpriteTexture() const

Returns a small entirely white texture.

GetDummyTexture

const HTexture &GetDummyTexture() const

Returns a dummy 2x2 texture that may be used when no other is available.

Don't modify the returned texture.

GetCursorArrow

const PixelData &GetCursorArrow(Vector2I &hotSpot)

Returns image data for an arrow cursor, along with its hotspot.

GetCursorArrowDrag

const PixelData &GetCursorArrowDrag(Vector2I &hotSpot)

Returns image data for an arrow with dragged object cursor, along with its hotspot.

GetCursorWait

const PixelData &GetCursorWait(Vector2I &hotSpot)

Returns image data for a wait cursor, along with its hotspot.

GetCursorIBeam

const PixelData &GetCursorIBeam(Vector2I &hotSpot)

Returns image data for an "I" beam cursor, along with its hotspot.

GetCursorSizeNesw

const PixelData &GetCursorSizeNesw(Vector2I &hotSpot)

Returns image data for a NESW resize cursor, along with its hotspot.

GetCursorSizeNs

const PixelData &GetCursorSizeNs(Vector2I &hotSpot)

Returns image data for a NS resize cursor, along with its hotspot.

GetCursorSizeNwse

const PixelData &GetCursorSizeNwse(Vector2I &hotSpot)

Returns image data for a NWSE resize cursor, along with its hotspot.

GetCursorSizeWe

const PixelData &GetCursorSizeWe(Vector2I &hotSpot)

Returns image data for a WE resize cursor, along with its hotspot.

GetCursorDeny

const PixelData &GetCursorDeny(Vector2I &hotSpot)

Returns image data for a deny cursor, along with its hotspot.

GetCursorMoveLeftRight

const PixelData &GetCursorMoveLeftRight(Vector2I &hotSpot)

Returns image data for a move left-right cursor, along with its hotspot.

GetFrameworkIcon

const PixelData &GetFrameworkIcon()

Returns the default application icon.

GetBuiltinShader

HShader GetBuiltinShader(BuiltinShader type) const

Returns one of the builtin shader types.

CreateSpriteTextMaterial

HMaterial CreateSpriteTextMaterial() const

Creates a material used for textual sprite rendering (for example text in GUI).

CreateSpriteImageMaterial

HMaterial CreateSpriteImageMaterial() const

Creates a material used for image sprite rendering (for example images in GUI).

CreateSpriteLineMaterial

HMaterial CreateSpriteLineMaterial() const

Creates a material used for antialiased line rendering (for example curve rendering in GUI).

GetMesh

HMesh GetMesh(BuiltinMesh mesh) const

Retrieves one of the builtin meshes.

GetShader

HShader GetShader(const Path &path) const

Loads a shader at the specified path.

path
Path relative to the default shader folder with no file extension.

GetFont

HFont GetFont(const String &font) const

Attempts to return a font of the given font family.

Returns the default font is provided font is not found.

GetOrCompileShader

HShader GetOrCompileShader(const Path &path) const

Loads the shader with the specified name from the cache if available, or compiles the shader from source if not available.

path
Absolute path to the shader source file.

Returns: Valid shader if successful, or null otherwise.

GetDefaultFont

HFont GetDefaultFont() const

Returns the default font used by the engine.

staticGetTexture

static HTexture GetTexture(BuiltinTexture type)

Retrieves one of the builtin textures.

staticGetShaderFolder

static Path GetShaderFolder()

Returns absolute path to the builtin shader folder where raw shader files are located.

staticGetUnitTestDataFolder

static Path GetUnitTestDataFolder()

Returns the folder holding unit test resources.

staticGetShaderIncludeFolder

static Path GetShaderIncludeFolder()

Returns absolute path to the builtin shader include folder.

staticGetIconFolder

static Path GetIconFolder()

Returns absolute path to the builtin icons folder.

staticGetEditorShaderIncludeFolder

static Path GetEditorShaderIncludeFolder()

Returns absolute path to the editor builtin shader include folder.

staticInstance

static T &Instance()

Returns a reference to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticInstancePtr

static T *InstancePtr()

Returns a pointer to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticShutDown

static void ShutDown()

Shuts down this module and frees any resources it is using.

staticIsStarted

static bool IsStarted()

Query if the module has been started.

Protected

Methods

~Module<T>

virtual ~Module<T>() = default

OnShutDown

virtual void OnShutDown()

Override if you want your module to be notified just before it is deleted.

staticInstanceInternal

static T *&InstanceInternal()

Returns a singleton instance of this module.

staticIsDestroyed

static bool &IsDestroyed()

Checks has the Module been shut down.

staticIsStartedUp

static bool &IsStartedUp()

Checks has the Module been started up.

Private

Methods

OnStartUp

void OnStartUp() override

Override if you want your module to be notified once it has been constructed and started.

GetSkinTexture

HSpriteTexture GetSkinTexture(const String &name) const

Loads a GUI skin texture with the specified filename.

GetCursorTexture

HTexture GetCursorTexture(const String &name) const

Loads a cursor texture with the specified filename.

Fields

mDefaultGUIStyleSheet

HGUIStyleSheet mDefaultGUIStyleSheet

mDefaultGUIStyleSheetCascade

SPtr<GUIStyleSheetCascade> mDefaultGUIStyleSheetCascade

mFont

HFont mFont

mCursorArrow

SPtr<PixelData> mCursorArrow

mCursorArrowDrag

SPtr<PixelData> mCursorArrowDrag

mCursorArrowLeftRight

SPtr<PixelData> mCursorArrowLeftRight

mCursorIBeam

SPtr<PixelData> mCursorIBeam

mCursorDeny

SPtr<PixelData> mCursorDeny

mCursorWait

SPtr<PixelData> mCursorWait

mCursorSizeNESW

SPtr<PixelData> mCursorSizeNESW

mCursorSizeNS

SPtr<PixelData> mCursorSizeNS

mCursorSizeNWSE

SPtr<PixelData> mCursorSizeNWSE

mCursorSizeWE

SPtr<PixelData> mCursorSizeWE

mFrameworkIcon

SPtr<PixelData> mFrameworkIcon

mWhiteSpriteTexture

HSpriteTexture mWhiteSpriteTexture

mDummyTexture

HTexture mDummyTexture

mShaderSpriteText

HShader mShaderSpriteText

mShaderSpriteImage

HShader mShaderSpriteImage

mShaderSpriteLine

HShader mShaderSpriteLine

mShaderDiffuse

HShader mShaderDiffuse

mShaderTransparent

HShader mShaderTransparent

mShaderParticlesUnlit

HShader mShaderParticlesUnlit

mShaderParticlesLit

HShader mShaderParticlesLit

mShaderParticlesLitOpaque

HShader mShaderParticlesLitOpaque

mShaderDecal

HShader mShaderDecal

mCompiledShaders

UnorderedMap<Path, HShader> mCompiledShaders

mBuiltinRawDataFolder

Path mBuiltinRawDataFolder

mBuiltinDataFolder

Path mBuiltinDataFolder