This repository was archived by the owner on Feb 19, 2026. It is now read-only.
Add CMake build system with Linux support and Pong test game#1
Open
killerdevildog wants to merge 2 commits intoStarEngine:developfrom
Open
Add CMake build system with Linux support and Pong test game#1killerdevildog wants to merge 2 commits intoStarEngine:developfrom
killerdevildog wants to merge 2 commits intoStarEngine:developfrom
Conversation
- Add root CMakeLists.txt and src/CMakeLists.txt for building starengine static library - Fix Windows-style backslash path separators in #include directives - Fix case-sensitive filename mismatches (SpriteSheet->Spritesheet, FilePath->Filepath) - Add Linux platform support: byte typedef, tfopen(), Logger stderr output - Guard WGL-specific code with _WIN32 instead of DESKTOP - Fix #ifdef DESKTOP/#else pattern to use #elif defined(ANDROID) throughout - Fix Dictionary.inl lower_bound/upper_bound for non-MSVC compilers (use equal_range) - Guard Windows-only InputManager methods (keyboard, gamepad) with _WIN32 - Add build/ and lib/ to .gitignore - System dependencies: SDL2, SDL2_mixer, GLEW, OpenGL, Freetype, libpng
- Add test/pong/ with a fully playable Pong game linked against starengine - Main menu with 1P vs AI and 2P local multiplayer modes - AI difficulty selection: Easy, Medium, Hard, Impossible - AI uses ball trajectory prediction with configurable reaction time and error - Serve countdown, ball trail, paddle glow, screen shake effects - Pause screen and game-over screen with rematch option - Bitmap font rendering for all UI text (A-Z, 0-9, symbols) - Fix GraphicsManager.h GL include guards for Linux (DESKTOP else branch) - Enable STARENGINE_BUILD_EXAMPLES by default in root CMakeLists.txt - Add StarLog.txt to .gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a CMake build system for StarEngine that successfully builds the engine as a static library (
libstarengine.a) on Linux. It also includes a fully playable Pong test game that links against the engine, proving the build system works end-to-end.What was done
CMake Build System
CMakeLists.txtandsrc/CMakeLists.txtdefining thestarenginestatic library targetConsole.cpp,Window.cpp) and Android-only files (Resource.cpp,HelpersAndroid.cpp)Linux Portability Fixes
The original codebase targeted Windows (MSVC) and Android (NDK) only. The following changes were needed to compile on Linux/GCC:
\in#includedirectives to forward slashes across all source filesSpriteSheet.h→Spritesheet.h,FilePath.h→Filepath.h, etc.)#ifdef DESKTOP ... #else (assume Android)throughout. Changed to#elif defined(ANDROID)to avoid compiling Android code on Linuxwglext.h,PFNWGLSWAPINTERVALEXTPROC) from#ifdef DESKTOPto#ifdef _WIN32typedef uint8_t byteandtfopen()wrapper for Linuxunordered_multimap::lower_bound/upper_bound(MSVC-only) with standardequal_rangeon non-Windowsstd::cerroutput<GL/glew.h>,<GL/gl.h>)Test Game: Star Pong
A complete Pong game in
test/pong/that links againstlibstarengineand uses engine subsystems (Logger, TimeManager):How to build
What is NOT in this PR
FindPackagepaths, MSVC flags) can be added in a follow-up PR.InputManagerhas no SDL-based keyboard/gamepad input for Linux yet — the Pong game handles input directly via SDL. Wiring SDL events intoInputManagerfor Linux would be a future PR.These platform integrations are straightforward to add incrementally now that the CMake foundation is in place.