#include <SDL3/SDL.h>
#include <SDL3_image/SDL_image.h>
#include <SDL3_mixer/SDL_mixer.h>
#include <SDL3_ttf/SDL_ttf.h>
#include <any>
#include <algorithm>
#include <chrono>
#include <functional>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory>
#include <mutex>
#include <queue>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <sol/sol.hpp>
#include <SDOM/SDOM_SDL_Utils.hpp>
#include <SDOM/SDOM_CLR.hpp>
#include <SDOM/SDOM_DisplayHandle.hpp>
#include <SDOM/SDOM_AssetHandle.hpp>
#include <SDOM/SDOM_UnitTests.hpp>
#include <SDOM/SDOM_Utils.hpp>
Go to the source code of this file.
|
namespace | SDOM |
| Contains all core classes and utilities for the SDOM library.
|
|
|
#define | DEBUG_LUA_TESTS 0 |
|
#define | ERROR(message) throw SDOM::Exception(message, __FILE__, __LINE__) |
| Throws an SDOM exception with file and line info.
|
|
#define | WARNING(message) SDOM::showWarning(message, __FILE__, __LINE__) |
| Shows a warning message with file and line info.
|
|
#define | DEBUG_LOG(...) |
| Logs a debug message in green text.
|
|
#define | FAIL(...) |
| Logs a failure message in red text.
|
|
#define | INFO(...) |
| Logs an informational message to stdout.
|
|
#define | LUA_INFO(...) do { if (DEBUG_LUA_TESTS) { std::ostringstream _sdom_lua_dbg_oss; _sdom_lua_dbg_oss << __VA_ARGS__; std::cout << CLR::YELLOW << "[LUA-INFO] " << (_sdom_lua_dbg_oss.str()) << CLR::RESET << std::endl; } } while(0) |
|
#define | DEBUG_ERR(message) |
| Logs a debug error (non-fatal) with file and line info in dark text.
|
|
#define | ASSERT_EQ(val, expected) |
| Asserts that two values are equal; throws an error if not.
|
|
|
enum class | SDOM::AnchorPoint : uint8_t {
SDOM::DEFAULT = 0
, SDOM::TOP_LEFT = 0
, SDOM::TOP_CENTER = 1
, SDOM::TOP_RIGHT = 2
,
SDOM::MIDDLE_LEFT = 3
, SDOM::MIDDLE_CENTER = 4
, SDOM::MIDDLE_RIGHT = 5
, SDOM::BOTTOM_LEFT = 6
,
SDOM::BOTTOM_CENTER = 7
, SDOM::BOTTOM_RIGHT = 8
, SDOM::Aliases for anchor points
, SDOM::LEFT = MIDDLE_LEFT
,
SDOM::CENTER = MIDDLE_CENTER
, SDOM::RIGHT = MIDDLE_RIGHT
, SDOM::TOP = TOP_CENTER
, SDOM::MIDDLE = MIDDLE_CENTER
,
SDOM::BOTTOM = BOTTOM_CENTER
, SDOM::LEFT_TOP = TOP_LEFT
, SDOM::CENTER_TOP = TOP_CENTER
, SDOM::RIGHT_TOP = TOP_RIGHT
,
SDOM::LEFT_MIDDLE = MIDDLE_LEFT
, SDOM::CENTER_MIDDLE = MIDDLE_CENTER
, SDOM::RIGHT_MIDDLE = MIDDLE_RIGHT
, SDOM::LEFT_BOTTOM = BOTTOM_LEFT
,
SDOM::CENTER_BOTTOM = BOTTOM_CENTER
, SDOM::RIGHT_BOTTOM = BOTTOM_RIGHT
} |
| Reference points for anchoring child edges to a parent. More...
|
|
◆ ASSERT_EQ
#define ASSERT_EQ |
( |
|
val, |
|
|
|
expected |
|
) |
| |
Value: if ((val) != (expected)) { \
ERROR("Assertion failed: " + std::string(#val) + " == " + std::string(#expected) \
+ ", actual: " + std::to_string((val)) + ", expected: " + std::to_string((expected))); \
}
Asserts that two values are equal; throws an error if not.
- Parameters
-
val | Value to test. |
expected | Expected value. |
◆ DEBUG_ERR
#define DEBUG_ERR |
( |
|
message | ) |
|
Value:
"\n Debug: " << \
static const std::string RESET
ANSI escape sequence to reset formatting.
Definition SDOM_CLR.hpp:245
static const std::string YELLOW
ANSI escape sequence for yellow foreground.
Definition SDOM_CLR.hpp:278
static const std::string ORANGE
ANSI escape sequence for orange foreground.
Definition SDOM_CLR.hpp:276
static const std::string DARK
ANSI escape sequence for dark grey foreground.
Definition SDOM_CLR.hpp:275
Logs a debug error (non-fatal) with file and line info in dark text.
- Parameters
-
message | Debug message to include. |
◆ DEBUG_LOG
Value: do { \
std::ostringstream _sdom_dbg_oss; \
_sdom_dbg_oss << __VA_ARGS__; \
} while(0)
static const std::string GREEN
ANSI escape sequence for green foreground.
Definition SDOM_CLR.hpp:268
Logs a debug message in green text.
- Parameters
-
message | Debug message to display. |
◆ DEBUG_LUA_TESTS
#define DEBUG_LUA_TESTS 0 |
◆ ERROR
#define ERROR |
( |
|
message | ) |
throw SDOM::Exception(message, __FILE__, __LINE__) |
Throws an SDOM exception with file and line info.
- Parameters
-
message | Error message to report. |
◆ FAIL
Value: do { \
std::ostringstream _sdom_dbg_oss; \
_sdom_dbg_oss << __VA_ARGS__; \
} while(0)
static const std::string RED
ANSI escape sequence for red foreground.
Definition SDOM_CLR.hpp:267
Logs a failure message in red text.
- Parameters
-
message | Failure message to display. |
◆ INFO
Value: do { \
std::ostringstream _sdom_dbg_oss; \
_sdom_dbg_oss << __VA_ARGS__; \
Logs an informational message to stdout.
- Parameters
-
message | Informational message to display. |
◆ LUA_INFO
#define LUA_INFO |
( |
|
... | ) |
do { if (DEBUG_LUA_TESTS) { std::ostringstream _sdom_lua_dbg_oss; _sdom_lua_dbg_oss << __VA_ARGS__; std::cout << CLR::YELLOW << "[LUA-INFO] " << (_sdom_lua_dbg_oss.str()) << CLR::RESET << std::endl; } } while(0) |
◆ WARNING
Shows a warning message with file and line info.
- Parameters
-
message | Warning message to display. |
◆ DEBUG_REGISTER_LUA
constexpr bool DEBUG_REGISTER_LUA = false |
|
constexpr |
◆ ORPHAN_GRACE_PERIOD
constexpr int ORPHAN_GRACE_PERIOD = 5000 |
|
constexpr |