Crafter.Debug/examples/Basic/interfaces/Basic.DebugShim.cppm

26 lines
1 KiB
Text
Raw Normal View History

// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
// Crafter.Debug's frame-loop and timeline calls, in every build: the real
// ones under --debug-api, and in a plain build stand-ins that do nothing, so
// the simulation and main need no #ifdef around them. This is one of the
// app's own sources, so the define Debug::Use adds reaches it.
export module Basic.DebugShim;
import std;
#ifdef BASIC_DEBUG_API
export import Crafter.Debug;
#else
export namespace Crafter::Debug {
inline void Pump() {}
inline bool Advance() { return true; }
inline bool Paused() { return false; }
inline std::uint32_t TakeSteps() { return 0; }
inline bool QuitRequested() { return false; }
template<class... A> void Log(A&&...) {}
template<class... A> void LogWarn(A&&...) {}
template<class... A> void LogError(A&&...) {}
template<class... A> bool Check(bool ok, A&&...) { return ok; }
template<class... A> void Emit(A&&...) {}
template<class T> void Sample(std::string_view, const T&) {}
}
#endif