|
libmx2 2.2.1
C++20 multimedia and game-engine library (SDL2 / OpenGL / Vulkan)
|
Classes | |
| class | Item |
| A single key/value pair read from a configuration file. More... | |
| class | ConfigFile |
| Parses and manages an INI-style configuration file. More... | |
| class | Exception |
| General-purpose exception class for the mx library. More... | |
| class | Font |
| RAII wrapper around a TTF_Font handle. More... | |
| class | Text |
| Helper for rendering text strings with SDL_Renderer. More... | |
| class | MXCapture |
| OpenCV video capture source that renders via an OpenGL sprite. More... | |
| class | Input |
| Convenience wrapper that queries controller buttons by logical name. More... | |
| class | Joystick |
| RAII wrapper for a raw SDL_Joystick device. More... | |
| class | Controller |
| RAII wrapper for SDL_GameController (standard layout mapping). More... | |
| struct | Vertex |
| Per-vertex data sent to the Vulkan vertex buffer. More... | |
| struct | VertexHash |
| struct | MXMaterial |
| Parsed Wavefront MTL material properties. More... | |
| class | Mesh |
| A single OpenGL sub-mesh: geometry buffers, texture bindings, and deformers. More... | |
| class | Model |
| A collection of Mesh objects loaded from an OBJ file. More... | |
| class | mxWindow |
| Main SDL2 application window. More... | |
| class | Mixer |
| SDL_mixer–based audio manager. More... | |
| class | TeeBuf |
| A std::streambuf that writes every byte to two underlying buffers. More... | |
| class | TeeStream |
| An std::ostream that writes to two output streams simultaneously. More... | |
| class | Texture |
| RAII wrapper around an SDL_Texture. More... | |
| class | mxUtil |
| Utility bag for SDL-based applications. More... | |
| struct | QueueFamilyIndices |
| Tracks Vulkan queue family assignments needed to create a device. More... | |
| struct | SwapChainSupportDetails |
| Swapchain capabilities and format/mode candidates for a physical device. More... | |
| struct | UniformBufferObject |
| Standard UBO layout uploaded to shaders each frame. More... | |
| class | VKWindow |
| Primary Vulkan rendering window and device management class. More... | |
| class | VKAbstractModel |
| Convenience wrapper that owns an MXModel plus its Vulkan textures, UBOs, and descriptor sets. More... | |
| struct | Vec2 |
| struct | Vec3 |
| struct | VKVertex |
| Per-vertex data uploaded to the Vulkan vertex buffer. More... | |
| struct | VKVertexHash |
| Hash functor for VKVertex, suitable for use in unordered_map. More... | |
| struct | SubMesh |
| A range of indices within the shared index buffer, with its own texture. More... | |
| class | MXModel |
| Vulkan mesh loader and GPU resource manager. More... | |
| class | VKSprite |
| Vulkan 2-D sprite with texture, custom shader, and instancing support. More... | |
| struct | CacheKey |
| Cache key combining text content and colour. More... | |
| struct | CacheKeyHash |
| Hash functor for CacheKey. More... | |
| struct | CachedTexture |
| GPU texture resources cached for a rendered text string. More... | |
| class | VKText |
| Renders SDL_ttf text into Vulkan image textures. More... | |
| class | Wrapper |
| A nullable smart wrapper around a raw pointer. More... | |
Concepts | |
| concept | WrapType |
| Constrains Wrapper<T> to pointer types only. | |
Enumerations | |
| enum class | Input_Button { BTN_A = 0 , BTN_B , BTN_X , BTN_Y , BTNL_L , BTN_R , BTN_D_UP , BTN_D_DOWN , BTN_D_LEFT , BTN_D_RIGHT , BTN_START , BTN_BACK } |
| Logical button identifiers for a standard gamepad. More... | |
| enum class | DeformAxis { X = 0 , Y = 1 , Z = 2 } |
| Axis selector for deformation operations. More... | |
Functions | |
| static bool | ends_with (const std::string &s, const std::string &suf) |
| static std::ofstream | log_file ("system.log.txt", std::ios::out) |
| static std::ofstream | error_file ("error.log.txt", std::ios::out) |
| void | redirect () |
| Redirect std::cout and std::cerr through the tee streams. | |
| float | generateRandomFloat (float min, float max) |
| Generate a random float in the given range. | |
| int | generateRandomInt (int min, int max) |
| Generate a random integer in the given range. | |
| std::unique_ptr< char[]> | compressString (const std::string &text, uLong &len) |
| Compress a string using zlib. | |
| std::string | decompressString (void *data, uLong size_) |
| Decompress a zlib-compressed data block. | |
| std::vector< char > | readFile (const std::string &filename) |
| Read an entire file into a byte vector. | |
| std::string | readFileToString (const std::string &filename) |
| Read an entire text file into a string. | |
| static VKAPI_ATTR VkBool32 VKAPI_CALL | debugCallback (VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData, void *pUserData) |
| static bool | ends_with (const std::string &s, const std::string &suf) |
Variables | |
| static const int | keys [] |
| static const SDL_GameControllerButton | ctrl [] |
| TeeStream | system_out (std::cout, log_file) |
| Global stdout + log tee stream. | |
| TeeStream | system_err (std::cerr, error_file) |
| Global stderr + log tee stream. | |
|
strong |
|
strong |
Logical button identifiers for a standard gamepad.
| std::unique_ptr< char[]> mx::compressString | ( | const std::string & | text, |
| uLong & | len ) |
|
static |
Definition at line 246 of file vk.cpp.
Referenced by mx::VKWindow::createInstance().
| std::string mx::decompressString | ( | void * | data, |
| uLong | size_ ) |
Decompress a zlib-compressed data block.
| data | Pointer to compressed data. |
| size_ | Size of compressed data in bytes. |
Definition at line 46 of file util.cpp.
Referenced by mx::MXModel::loadMXMOD(), and mx::Model::openModel().
|
static |
Definition at line 611 of file model.cpp.
Referenced by mx::MXModel::load(), mx::MXModel::loadMXMOD(), and mx::Model::openModel().
|
static |
Definition at line 15 of file vk_model.cpp.
|
static |
References error_file(), and log_file().
Referenced by error_file(), and redirect().
| float mx::generateRandomFloat | ( | float | min, |
| float | max ) |
| int mx::generateRandomInt | ( | int | min, |
| int | max ) |
|
static |
Referenced by error_file(), and redirect().
| std::vector< char > mx::readFile | ( | const std::string & | filename | ) |
Read an entire file into a byte vector.
| filename | Path to the file. |
Definition at line 77 of file util.cpp.
Referenced by mx::VKWindow::createGraphicsPipeline(), mx::VKAbstractModel::createModelPipeline(), mx::VKWindow::createSpritePipeline(), mx::VKWindow::createTextPipeline(), mx::MXModel::loadMXMOD(), and mx::Model::openModel().
| std::string mx::readFileToString | ( | const std::string & | filename | ) |
| void mx::redirect | ( | ) |
Redirect std::cout and std::cerr through the tee streams.
After calling this function, all writes to std::cout and std::cerr are forwarded to both the terminal and the configured log file.
Definition at line 14 of file tee_stream.cpp.
References error_file(), log_file(), system_err, and system_out.
Referenced by gl::GLWindow::initGL(), gl::GLWindow::initGL(), and mx::mxWindow::mxWindow().
|
static |
Definition at line 14 of file input.cpp.
Referenced by mx::Input::getButton().
|
static |
Definition at line 8 of file input.cpp.
Referenced by mx::Input::getButton(), and mx::ConfigFile::saveFile().
| TeeStream mx::system_err | ( | std::cerr | , |
| error_file | ) |
Global stderr + log tee stream.
Definition at line 104 of file tee_stream.hpp.
Referenced by mx::mxWindow::create_window(), gl::ShaderProgram::createProgram(), gl::ShaderProgram::createProgramFromFile(), gl::GLText::createText(), mx::mxWindow::createTexture(), gl::GLWindow::initGL(), gl::GLWindow::initGL(), mx::mxUtil::loadFont(), png::LoadPNG(), mx::mxUtil::loadTexture(), mx::mxWindow::mxWindow(), gl::ShaderProgram::printProgramLog(), gl::ShaderProgram::printShaderLog(), mx::mxUtil::printText(), mx::Text::printText_Blended(), mx::Text::printText_Solid(), redirect(), png::SavePNG(), png::SavePNG_RGBA(), mx::Model::setTextures(), mx::Model::setTexturesFromMTL(), gl::ShaderProgram::setUniform(), gl::ShaderProgram::setUniform(), gl::ShaderProgram::setUniform(), gl::ShaderProgram::setUniform(), gl::ShaderProgram::setUniform(), gl::ShaderProgram::setUniform(), and mx::Font::tryLoadFont().
Global stdout + log tee stream.
Definition at line 103 of file tee_stream.hpp.
Referenced by mx::Controller::connectEvent(), mx::Model::dumpMeshStats(), gl::GLWindow::initGL(), gl::GLWindow::initGL(), mx::mxUtil::initJoystick(), mx::Model::loadMTL(), gl::ShaderProgram::loadProgram(), gl::ShaderProgram::loadProgramFromText(), mx::Model::openModelString(), mx::Model::openOBJ(), redirect(), gl::GLSprite::release(), gl::ShaderProgram::release(), mx::Model::setTextures(), mx::Model::setTexturesFromMTL(), gl::GLSprite::~GLSprite(), gl::GLWindow::~GLWindow(), and mx::mxWindow::~mxWindow().