2 Commits
Author SHA1 Message Date
tobid7 8ee7006d2c Export OS correctly 2026-01-30 20:19:13 +01:00
tobid7 683c226ce0 Fix MSVC dll building 2026-01-29 20:17:04 +01:00
9 changed files with 28 additions and 21 deletions
+6 -7
View File
@@ -70,6 +70,7 @@ if(${PD_BUILD_SHARED})
target_compile_definitions(palladium PRIVATE -DPD_BUILD_SHARED) target_compile_definitions(palladium PRIVATE -DPD_BUILD_SHARED)
else() else()
add_library(palladium STATIC ${PD_SOURCES}) add_library(palladium STATIC ${PD_SOURCES})
target_compile_definitions(palladium PUBLIC -DPD_BUILD_STATIC)
endif() endif()
target_include_directories(palladium PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) target_include_directories(palladium PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
@@ -82,12 +83,10 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Nintendo3DS")
) )
endif() endif()
if(${CMAKE_BUILD_TYPE} STREQUAL "Release") target_compile_options(palladium PRIVATE
target_compile_options(palladium PRIVATE $<$<CONFIG:Debug>:-O0 -g>
$<$<CONFIG:Debug>:-O0 -g> $<$<CONFIG:Release>:-O3>
$<$<CONFIG:Release>:-O3> )
)
endif()
install(DIRECTORY include DESTINATION ".") install(DIRECTORY include DESTINATION ".")
install(TARGETS palladium) install(TARGETS palladium)
@@ -111,4 +110,4 @@ file(GLOB_RECURSE PD_FMTFILES CONFIGURE_DEPENDS
add_custom_target(pd-clang-format add_custom_target(pd-clang-format
COMMAND ${CLANG_FORMAT} --style=file -i ${PD_FMTFILES} COMMAND ${CLANG_FORMAT} --style=file -i ${PD_FMTFILES}
COMMENT "Formatting Project Sources" COMMENT "Formatting Project Sources"
) )
+2 -1
View File
@@ -83,7 +83,8 @@ constexpr static KbKey Kb_F11 = KbKey::Flag(47);
constexpr static KbKey Kb_F12 = KbKey::Flag(48); constexpr static KbKey Kb_F12 = KbKey::Flag(48);
constexpr static KbKey Kb_MouseLeft = KbKey::Flag(120); constexpr static KbKey Kb_MouseLeft = KbKey::Flag(120);
} // namespace HidKb } // namespace HidKb
class HidDriver {
class PD_API HidDriver {
public: public:
enum Flags : u32 { enum Flags : u32 {
Flags_None = 0, Flags_None = 0,
+2 -1
View File
@@ -26,11 +26,12 @@ SOFTWARE.
#include <pd/core/common.hpp> #include <pd/core/common.hpp>
#include <pd/core/timetrace.hpp> #include <pd/core/timetrace.hpp>
#include <pd/drivers/types.hpp> #include <pd/drivers/types.hpp>
#include <pd/pd_p_api.hpp>
namespace PD { namespace PD {
using TraceMap = std::map<std::string, TT::Res::Ref>; using TraceMap = std::map<std::string, TT::Res::Ref>;
class OsDriver { class PD_API OsDriver {
public: public:
OsDriver(const std::string& name = "StdPd") : pName(name) {} OsDriver(const std::string& name = "StdPd") : pName(name) {}
OsDriver(PDDriverData data) : pName("StdPd") {} OsDriver(PDDriverData data) : pName("StdPd") {}
+1 -1
View File
@@ -91,7 +91,7 @@ class PD_API DrawList {
void SetFontScale(float scale) { pFontScale = scale; } void SetFontScale(float scale) { pFontScale = scale; }
void DrawSolid(); void DrawSolid();
void DrawTexture(Texture::Ref tex) { CurrentTex = tex; } void DrawTexture(Texture::Ref tex);
// SECTION: Draw API // // SECTION: Draw API //
+4 -1
View File
@@ -24,7 +24,7 @@ SOFTWARE.
*/ */
/** Generated with ppam */ /** Generated with ppam */
#ifndef PD_BUILD_STATIC
#ifdef _WIN32 // Windows (MSVC Tested) #ifdef _WIN32 // Windows (MSVC Tested)
#ifdef PD_BUILD_SHARED #ifdef PD_BUILD_SHARED
#define PD_API __declspec(dllexport) #define PD_API __declspec(dllexport)
@@ -49,3 +49,6 @@ SOFTWARE.
#else #else
#define PD_API #define PD_API
#endif #endif
#else
#define PD_API
#endif
+2 -1
View File
@@ -34,6 +34,7 @@ SOFTWARE.
namespace PD { namespace PD {
namespace UI7 { namespace UI7 {
class Context;
class PD_API Layout { class PD_API Layout {
public: public:
Layout(const ID& id, IO::Ref io) : ID(id) { Layout(const ID& id, IO::Ref io) : ID(id) {
@@ -172,7 +173,7 @@ class PD_API Layout {
private: private:
friend class Menu; friend class Menu;
friend class Context; friend class PD::UI7::Context;
friend class ReMenu; friend class ReMenu;
// Base Components // Base Components
UI7::ID ID; UI7::ID ID;
+4 -4
View File
@@ -24,13 +24,13 @@ SOFTWARE.
#include <pd/drivers/hid.hpp> #include <pd/drivers/hid.hpp>
namespace PD { namespace PD {
bool HidDriver::IsEvent(Event e, Key keys) { return KeyEvents[0][e] & keys; } PD_API bool HidDriver::IsEvent(Event e, Key keys) { return KeyEvents[0][e] & keys; }
bool HidDriver::IsEvent(Event e, KbKey keys) { PD_API bool HidDriver::IsEvent(Event e, KbKey keys) {
return KbKeyEvents[0][e].Has(keys); return KbKeyEvents[0][e].Has(keys);
} }
void HidDriver::SwapTab() { PD_API void HidDriver::SwapTab() {
auto tkd = KeyEvents[1][Event_Down]; auto tkd = KeyEvents[1][Event_Down];
auto tkh = KeyEvents[1][Event_Held]; auto tkh = KeyEvents[1][Event_Held];
auto tku = KeyEvents[1][Event_Up]; auto tku = KeyEvents[1][Event_Up];
@@ -46,7 +46,7 @@ void HidDriver::SwapTab() {
* If this func has no verride, still clear the stats * If this func has no verride, still clear the stats
* cause if they are empty this leads to a crash * cause if they are empty this leads to a crash
*/ */
void HidDriver::Update() { PD_API void HidDriver::Update() {
// Clear States // Clear States
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
KeyEvents[i][Event_Down] = 0; KeyEvents[i][Event_Down] = 0;
+5 -5
View File
@@ -24,7 +24,7 @@ SOFTWARE.
#include <pd/drivers/os.hpp> #include <pd/drivers/os.hpp>
namespace PD { namespace PD {
TT::Res::Ref& OsDriver::GetTraceRef(const std::string& id) { PD_API TT::Res::Ref& OsDriver::GetTraceRef(const std::string& id) {
if (!pTraces.count(id)) { if (!pTraces.count(id)) {
pTraces[id] = TT::Res::New(); pTraces[id] = TT::Res::New();
pTraces[id]->SetID(id); pTraces[id]->SetID(id);
@@ -32,18 +32,18 @@ TT::Res::Ref& OsDriver::GetTraceRef(const std::string& id) {
return pTraces[id]; return pTraces[id];
} }
TraceMap& OsDriver::GetTraceMap() { return pTraces; } PD_API TraceMap& OsDriver::GetTraceMap() { return pTraces; }
bool OsDriver::TraceExist(const std::string& id) { return pTraces.count(id); } PD_API bool OsDriver::TraceExist(const std::string& id) { return pTraces.count(id); }
/** Standart Driver */ /** Standart Driver */
u64 OsDriver::GetTime() { PD_API u64 OsDriver::GetTime() {
return std::chrono::duration_cast<std::chrono::milliseconds>( return std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::steady_clock::now().time_since_epoch()) std::chrono::steady_clock::now().time_since_epoch())
.count(); .count();
} }
u64 OsDriver::GetNanoTime() { PD_API u64 OsDriver::GetNanoTime() {
return std::chrono::duration_cast<std::chrono::nanoseconds>( return std::chrono::duration_cast<std::chrono::nanoseconds>(
std::chrono::steady_clock::now().time_since_epoch()) std::chrono::steady_clock::now().time_since_epoch())
.count(); .count();
+2
View File
@@ -306,5 +306,7 @@ PD_API void DrawList::DrawLine(const fvec2& a, const fvec2& b, u32 color,
PathAdd(b); PathAdd(b);
PathStroke(color, t); PathStroke(color, t);
} }
PD_API void DrawList::DrawTexture(Texture::Ref tex) { CurrentTex = tex; }
} // namespace Li } // namespace Li
} // namespace PD } // namespace PD