diff --git a/examples/module/main.cpp b/examples/module/main.cpp index dfeaa59f..d673b025 100644 --- a/examples/module/main.cpp +++ b/examples/module/main.cpp @@ -10,18 +10,27 @@ import raylib; using raylib::Color; +using raylib::Vector2; using raylib::Window; int main() { int screenWidth = 800; int screenHeight = 450; + // Mixing raymath with raylib runtime calls must not produce duplicate symbols when linking against raylib. + Vector2 textPosition = Vector2(100, 180) + Vector2(20, 20); + Window window(screenWidth, screenHeight, "raylib-cpp - modules example"); while (!window.ShouldClose()) { window.BeginDrawing(); window.ClearBackground(raylib::Colors::RAYWHITE); - raylib::DrawText("Congrats! You imported raylib as a module!", 120, 200, 20, Color::LightGray()); + raylib::DrawText( + "Congrats! You imported raylib as a module!", + static_cast(textPosition.x), + static_cast(textPosition.y), + 20, + Color::LightGray()); window.EndDrawing(); } diff --git a/include/raymath.hpp b/include/raymath.hpp index 8d012ff0..c981b3ca 100644 --- a/include/raymath.hpp +++ b/include/raymath.hpp @@ -8,11 +8,9 @@ extern "C" { #endif #ifndef RAYLIB_CPP_NO_MATH -#ifndef BUILD_RAYLIB_CPP_MODULES #ifndef RAYMATH_STATIC_INLINE #define RAYMATH_STATIC_INLINE #endif -#endif #ifdef __GNUC__ #pragma GCC diagnostic push // These throw a warnings on visual studio, need to check if __GNUC__ is defined to use it. #pragma GCC diagnostic ignored "-Wmissing-field-initializers" diff --git a/modules/raylib.cppm b/modules/raylib.cppm index d9bca093..ba3cabac 100644 --- a/modules/raylib.cppm +++ b/modules/raylib.cppm @@ -9,7 +9,6 @@ module; #define BUILD_RAYLIB_CPP_MODULES #define RLCPPAPI -#define RAYMATH_IMPLEMENTATION #include "../include/raylib-cpp.hpp" #undef LIGHTGRAY