|
Unravel Engine C++ Reference
|
#include "common.h"#include <tinystl/allocator.h>#include <tinystl/string.h>#include <tinystl/vector.h>#include "entry/entry.h"#include <bgfx/bgfx.h>#include <bx/commandline.h>#include <bx/endian.h>#include <bx/math.h>#include <bx/readerwriter.h>#include <bx/string.h>#include "bgfx_utils.h"#include <bimg/bimg.h>#include <bimg/decode.h>#include <bx/bx.h>#include <bx/file.h>#include <bx/sort.h>#include <time.h>Go to the source code of this file.
Namespaces | |
| namespace | entry |
Functions | |
| void * | load (bx::FileReaderI *_reader, bx::AllocatorI *_allocator, const bx::FilePath &_filePath, uint32_t *_size) |
| void * | load (const bx::FilePath &_filePath, uint32_t *_size) |
| void | unload (void *_ptr) |
| static const bgfx::Memory * | loadMem (bx::FileReaderI *_reader, const char *_filePath) |
| static void * | loadMem (bx::FileReaderI *_reader, bx::AllocatorI *_allocator, const bx::FilePath &_filePath, uint32_t *_size) |
| static bgfx::ShaderHandle | loadShader (bx::FileReaderI *_reader, const bx::StringView &_name) |
| bgfx::ShaderHandle | loadShader (const bx::StringView &_name) |
| bgfx::ShaderHandle | loadShader (const bx::FilePath &_filePath) |
| bgfx::ProgramHandle | loadProgram (bx::FileReaderI *_reader, const bx::StringView &_vsName, const bx::StringView &_fsName) |
| bgfx::ProgramHandle | loadProgram (const bx::StringView &_vsName, const bx::StringView &_fsName) |
| static void | imageReleaseCb (void *_ptr, void *_userData) |
| static bgfx::TextureHandle | loadTextureFromContainer (bimg::ImageContainer *imageContainer, uint64_t _flags, bgfx::TextureInfo *_info, const TexturePreCreateFn &_preCreate=nullptr) |
| bool | imageFlipTangentSpaceNormalY (bimg::ImageContainer *&_image) |
| bool | imagePrepareNormalMapBakePng (bimg::ImageContainer *&_image) |
| Prepare a flipped normal map for PNG bake export (RGBA8, opaque alpha when unused). | |
| bgfx::TextureHandle | loadTexture (const void *_data, uint32_t _size, uint64_t _flags, uint8_t _skip, bgfx::TextureInfo *_info, bimg::Orientation::Enum *_orientation, const char *_name, bx::Error *_err, const TexturePreCreateFn &_preCreate) |
| bgfx::TextureHandle | loadTexture (bx::FileReaderI *_reader, const bx::FilePath &_filePath, uint64_t _flags, uint8_t _skip, bgfx::TextureInfo *_info, bimg::Orientation::Enum *_orientation, bx::Error *_err, const TexturePreCreateFn &_preCreate=nullptr) |
| bgfx::TextureHandle | loadTexture (const bx::FilePath &_filePath, uint64_t _flags, uint8_t _skip, bgfx::TextureInfo *_info, bimg::Orientation::Enum *_orientation, bx::Error *_err, const TexturePreCreateFn &_preCreate) |
| bimg::ImageContainer * | imageLoad (const void *data, uint32_t size, bgfx::TextureFormat::Enum _dstFormat) |
| bimg::ImageContainer * | imageLoad (const bx::FilePath &_filePath, bgfx::TextureFormat::Enum _dstFormat) |
| bool | imageParseInfo (const void *_data, uint32_t _size, bimg::ImageContainer &_info, bx::Error *_err) |
| bool | imageParseInfo (const bx::FilePath &_filePath, bimg::ImageContainer &_info, bx::Error *_err) |
| Parse image metadata without decoding pixel data. | |
| void | calcTangents (void *_vertices, uint16_t _numVertices, bgfx::VertexLayout _layout, const uint16_t *_indices, uint32_t _numIndices) |
| bool | saveToFile (bgfx::ViewId viewId, const bx::FilePath &_filePath, bgfx::FrameBufferHandle fbo, uint32_t width, uint32_t height) |
| bool | imageSave (const char *saveAs, bimg::ImageContainer *image) |
| void calcTangents | ( | void * | _vertices, |
| uint16_t | _numVertices, | ||
| bgfx::VertexLayout | _layout, | ||
| const uint16_t * | _indices, | ||
| uint32_t | _numIndices ) |
Definition at line 628 of file bgfx_utils.cpp.
| bool imageFlipTangentSpaceNormalY | ( | bimg::ImageContainer *& | _image | ) |
Flip tangent-space normal map Y (tangent-space +Y / green channel via bimg unpack/pack). Preserves the container format for uncompressed sources. Compressed inputs are decoded to RGBA8 and left as RGBA8 (no lossy re-encode back to BC).
Definition at line 439 of file bgfx_utils.cpp.
| bimg::ImageContainer * imageLoad | ( | const bx::FilePath & | _filePath, |
| bgfx::TextureFormat::Enum | _dstFormat ) |
Definition at line 588 of file bgfx_utils.cpp.
| bimg::ImageContainer * imageLoad | ( | const void * | data, |
| uint32_t | size, | ||
| bgfx::TextureFormat::Enum | _dstFormat ) |
Definition at line 583 of file bgfx_utils.cpp.
| bool imageParseInfo | ( | const bx::FilePath & | _filePath, |
| bimg::ImageContainer & | _info, | ||
| bx::Error * | _err ) |
Parse image metadata without decoding pixel data.
Definition at line 613 of file bgfx_utils.cpp.
| bool imageParseInfo | ( | const void * | _data, |
| uint32_t | _size, | ||
| bimg::ImageContainer & | _info, | ||
| bx::Error * | _err ) |
Definition at line 603 of file bgfx_utils.cpp.
| bool imagePrepareNormalMapBakePng | ( | bimg::ImageContainer *& | _image | ) |
Prepare a flipped normal map for PNG bake export (RGBA8, opaque alpha when unused).
Definition at line 467 of file bgfx_utils.cpp.
|
static |
Definition at line 217 of file bgfx_utils.cpp.
| bool imageSave | ( | const char * | saveAs, |
| bimg::ImageContainer * | image ) |
Definition at line 789 of file bgfx_utils.cpp.
| void * load | ( | bx::FileReaderI * | _reader, |
| bx::AllocatorI * | _allocator, | ||
| const bx::FilePath & | _filePath, | ||
| uint32_t * | _size ) |
Definition at line 76 of file bgfx_utils.cpp.
| void * load | ( | const bx::FilePath & | _filePath, |
| uint32_t * | _size ) |
Definition at line 103 of file bgfx_utils.cpp.
|
static |
Definition at line 130 of file bgfx_utils.cpp.
|
static |
Definition at line 114 of file bgfx_utils.cpp.
| bgfx::ProgramHandle loadProgram | ( | bx::FileReaderI * | _reader, |
| const bx::StringView & | _vsName, | ||
| const bx::StringView & | _fsName ) |
Definition at line 199 of file bgfx_utils.cpp.
| bgfx::ProgramHandle loadProgram | ( | const bx::StringView & | _vsName, |
| const bx::StringView & | _fsName ) |
Definition at line 211 of file bgfx_utils.cpp.
|
static |
Definition at line 150 of file bgfx_utils.cpp.
| bgfx::ShaderHandle loadShader | ( | const bx::FilePath & | _filePath | ) |
Definition at line 191 of file bgfx_utils.cpp.
| bgfx::ShaderHandle loadShader | ( | const bx::StringView & | _name | ) |
Definition at line 185 of file bgfx_utils.cpp.
| bgfx::TextureHandle loadTexture | ( | bx::FileReaderI * | _reader, |
| const bx::FilePath & | _filePath, | ||
| uint64_t | _flags, | ||
| uint8_t | _skip, | ||
| bgfx::TextureInfo * | _info, | ||
| bimg::Orientation::Enum * | _orientation, | ||
| bx::Error * | _err, | ||
| const TexturePreCreateFn & | _preCreate = nullptr ) |
Definition at line 536 of file bgfx_utils.cpp.
| bgfx::TextureHandle loadTexture | ( | const bx::FilePath & | _filePath, |
| uint64_t | _flags, | ||
| uint8_t | _skip, | ||
| bgfx::TextureInfo * | _info, | ||
| bimg::Orientation::Enum * | _orientation, | ||
| bx::Error * | _err, | ||
| const TexturePreCreateFn & | _preCreate ) |
Definition at line 571 of file bgfx_utils.cpp.
| bgfx::TextureHandle loadTexture | ( | const void * | _data, |
| uint32_t | _size, | ||
| uint64_t | _flags = BGFX_TEXTURE_NONE|BGFX_SAMPLER_NONE, | ||
| uint8_t | _skip = 0, | ||
| bgfx::TextureInfo * | _info = NULL, | ||
| bimg::Orientation::Enum * | _orientation = NULL, | ||
| const char * | _name = NULL, | ||
| bx::Error * | _err = NULL, | ||
| const TexturePreCreateFn & | _preCreate = nullptr ) |
Load a texture from memory (DDS, KTX, PNG, etc.). _name is optional debug label. _preCreate is invoked after the image header has been parsed, right before the GPU texture is created.
Definition at line 491 of file bgfx_utils.cpp.
|
static |
Definition at line 224 of file bgfx_utils.cpp.
| bool saveToFile | ( | bgfx::ViewId | viewId, |
| const bx::FilePath & | _filePath, | ||
| bgfx::FrameBufferHandle | fbo, | ||
| uint32_t | width, | ||
| uint32_t | height ) |
Definition at line 729 of file bgfx_utils.cpp.
| void unload | ( | void * | _ptr | ) |
Definition at line 109 of file bgfx_utils.cpp.