Skip to content

feat: fixed build on windows#55

Merged
ms-tristan merged 8 commits into
mainfrom
fix-windows-build
Jan 18, 2026
Merged

feat: fixed build on windows#55
ms-tristan merged 8 commits into
mainfrom
fix-windows-build

Conversation

@ms-tristan

Copy link
Copy Markdown
Collaborator

This pull request refactors the Bullet physics engine integration to improve code organization and modularity, primarily by introducing a new BulletBodyManager class to encapsulate rigid body management. It also updates platform-specific export macros for module creation and adds debugging output to the main application loop.

Physics Engine Refactor and Modularization

  • Introduced BulletBodyManager (BulletBodyManager.hpp, BulletBodyManager.cpp) to handle creation, destruction, and management of rigid bodies, moving related logic out of BulletPhysicEngine. This improves encapsulation and simplifies the physics engine code. [1] [2]
  • Refactored BulletPhysicEngine (BulletPhysicEngine.cpp) to use BulletBodyManager and BulletWorld, removing direct management of bodies and Bullet world objects. Updated methods such as init, cleanup, loop, stepSimulation, checkCollisions, and sendUpdates to delegate responsibilities to the new manager and world classes. [1] [2] [3] [4] [5] [6]

Platform Export Macros

  • Moved and standardized Windows export macros (__declspec(dllexport)) for module entry points in BasicECSSavesManager.cpp and NetworkManager.cpp, ensuring correct symbol export for dynamic loading on Windows. [1] [2] [3]

Build Configuration

  • Added CMAKE_TOOLCHAIN_FILE to the Windows build preset in CMakePresets.json for proper vcpkg integration, improving build reliability and portability.

Debugging and Logging

  • Added debug output statements to the main application loop in AApplication.cpp to aid in runtime diagnostics and troubleshooting.

@ms-tristan ms-tristan self-assigned this Jan 18, 2026
Copilot AI review requested due to automatic review settings January 18, 2026 15:43
@ms-tristan ms-tristan added impact:medium Medium impact: important but not urgent common:bug Bug: something is not working type:game-engine Game engine related work labels Jan 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors the Bullet physics engine and GLEW/SFML renderer to improve code organization through better separation of concerns. It also addresses Windows build issues by standardizing export macros and adding vcpkg toolchain configuration.

Changes:

  • Introduced BulletBodyManager and BulletWorld classes to encapsulate rigid body and physics world management, removing this logic from BulletPhysicEngine
  • Created ResourceManager and ParticleSystem classes to handle mesh/texture loading and particle rendering, extracted from GLEWSFMLRenderer
  • Standardized Windows DLL export macros for module entry points across NetworkManager, BasicECSSavesManager, BulletPhysicEngine, and GLEWSFMLRenderer
  • Added vcpkg CMake toolchain configuration and debugging output for troubleshooting

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/game/client/main.cpp Added catch-all exception handler and duplicate error logging
src/engine/app/AApplication.cpp Added debug output statements to main application loop
src/engine/modules/WindowManager/SFML/SFMLWindowManager.cpp Added window context activation/deactivation around drawing operations
src/engine/modules/Renderer/GLEWSFML/ResourceManager.hpp New header defining ResourceManager class for mesh/texture management
src/engine/modules/Renderer/GLEWSFML/ResourceManager.cpp New implementation of resource loading with OpenGL context management
src/engine/modules/Renderer/GLEWSFML/RenderStructs.hpp New header extracting render-related structs from main renderer
src/engine/modules/Renderer/GLEWSFML/ParticleSystem.hpp New header defining ParticleSystem class for particle management
src/engine/modules/Renderer/GLEWSFML/ParticleSystem.cpp New implementation of particle system update and rendering
src/engine/modules/Renderer/GLEWSFML/GLEWSFMLRenderer.hpp Refactored to use ResourceManager and ParticleSystem members
src/engine/modules/Renderer/GLEWSFML/GLEWSFMLRenderer.cpp Delegated resource and particle operations to new helper classes
src/engine/modules/Renderer/GLEWSFML/CMakeLists.txt Added new source files to build configuration
src/engine/modules/PhysicEngine/Bullet/BulletWorld.hpp New header defining BulletWorld class for physics world management
src/engine/modules/PhysicEngine/Bullet/BulletWorld.cpp New implementation of Bullet physics world lifecycle
src/engine/modules/PhysicEngine/Bullet/BulletBodyManager.hpp New header defining BulletBodyManager for rigid body management
src/engine/modules/PhysicEngine/Bullet/BulletBodyManager.cpp New implementation of body creation, destruction, and property manipulation
src/engine/modules/PhysicEngine/Bullet/BulletPhysicEngine.hpp Refactored to use BulletWorld and BulletBodyManager members
src/engine/modules/PhysicEngine/Bullet/BulletPhysicEngine.cpp Delegated physics operations to helper classes, moved export macro
src/engine/modules/PhysicEngine/Bullet/CMakeLists.txt Added new source files to build configuration
src/engine/modules/NetworkManager/NetworkManager.cpp Moved export macro definition after namespace closure
src/engine/modules/ECSSavesManager/BasicECSSavesManager/BasicECSSavesManager.cpp Moved export macro definition after namespace closure
assets/scripts/space-shooter/systems/MenuSystem.lua Fixed trailing whitespace formatting
CMakePresets.json Added CMAKE_TOOLCHAIN_FILE for vcpkg integration on Windows

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/game/client/main.cpp Outdated
GLXContext oldContext = glXGetCurrentContext();
GLXDrawable oldDrawable = glXGetCurrentDrawable();
#endif
(void)oldContext; // suppress unused warning if not used in some paths

Copilot AI Jan 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unused variable warning suppression using (void)oldContext may not work as intended. On Linux, the oldContext variable is actually used in the restoration logic (lines 303-306), so this suppression is misleading. The comment on line 201 incorrectly states it may not be used in some paths.

Suggested change
(void)oldContext; // suppress unused warning if not used in some paths

Copilot uses AI. Check for mistakes.
Comment thread src/engine/modules/Renderer/GLEWSFML/ResourceManager.cpp
Comment on lines +17 to +18
ResourceManager::ResourceManager(void*& hdc, void*& hwnd, void*& hglrc)
: _hdc(hdc), _hwnd(hwnd), _hglrc(hglrc) {}

Copilot AI Jan 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ResourceManager constructor takes void*& references to hdc, hwnd, and hglrc, but these are stored as references to member variables. This creates a dependency where the ResourceManager must outlive or be constructed with references that remain valid throughout its lifetime. Consider if these should be regular pointers instead of references to avoid lifetime issues.

Copilot uses AI. Check for mistakes.
Comment thread src/engine/modules/WindowManager/SFML/SFMLWindowManager.cpp Outdated
Comment thread src/engine/modules/PhysicEngine/Bullet/BulletPhysicEngine.cpp Outdated
Comment thread CMakePresets.json Outdated

@MsteR7 MsteR7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for me

ms-tristan and others added 6 commits January 18, 2026 20:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
….cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ms-tristan ms-tristan merged commit 1e1ec46 into main Jan 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common:bug Bug: something is not working impact:medium Medium impact: important but not urgent type:game-engine Game engine related work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants