iGed is a lightweight game engine demo designed to showcase the core functionalities of a modern game engine. The
project is built as a practical demonstration of game engine development, with its core architecture and components
heavily inspired by Hazel, a well-known open-source game engine.
Visual Studio 2022 is recommended. iGed is officially untested on other development environments while we focus on a Windows build. Due to the use of C++ modules, MSVC version 17.6 or higher is required.
1. Downloading the repository:
Start by cloning the repository with:
git clone --recursive https://github.com/Sumzeek/iGed.git
If the repository was cloned non-recursively previously, use git submodule update --init --recursive to clone the
necessary submodules.
If you encounter the error:
Failed to connect to 127.0.0.1 port 1080 after 2104 ms: Couldn't connect to serverIt means you need to manually configure Git's proxy settings and enable your proxy (VPN or similar).
Use the following commands to set up Git's proxy (for example, using Clash with default port 7890; adjust the port based on your own proxy software):
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890
After setting the proxy, re-run the previous commands to retry your operation.
Once finished, restore the default Git settings by removing the proxy:
git config --global --unset http.proxy
git config --global --unset https.proxy
2. Building the project:
-
Ensure that you have Visual Studio 2022 installed with MSVC version 17.6 or higher. You can check your MSVC version in Visual Studio under
Help > About Microsoft Visual Studio. -
Using Visual Studio:
- Configure the project using CMake. If you are using the Visual Studio CMake integration, open the
CMakeLists.txtfile in the root directory, and Visual Studio will automatically configure the project. - Build the project by selecting
Build Solutionfrom theBuildmenu.
- Configure the project using CMake. If you are using the Visual Studio CMake integration, open the
-
Using CLion:
- Open the project in CLion by selecting
File > Openand choosing the root directory of the repository. - CLion will automatically detect the
CMakeLists.txtfile and configure the project. - Ensure that the CMake profile is set to use the correct toolchain. Go to
File > Settings > Build, Execution, Deployment > Toolchainsand ensure that the selected toolchain points to your MSVC installation (e.g.,Visual Studio). - Build the project by clicking the
Buildbutton in the toolbar or selectingBuild > Build Allfrom the menu.
- Open the project in CLion by selecting
-
Running the project:
- After a successful build, you can run the project directly from Visual Studio or CLion.
- In Visual Studio, select
Start Without DebuggingorStart Debuggingfrom the Debug menu. - In CLion, click the Run button in the toolbar or select
Run > Runfrom the menu.
If the module interface file (.ixx) and the implementation file (.cpp) are separated, it may result in
inconsistent memory addresses between the data in the .ixx file and the .cpp file.
In the iGe library, Sumzeek attempted to separate the module interface file (.ixx) and the implementation file (
.cpp) for the Log class. During window initialization, the WindowsWindow class called a function from the Log class:
// #define IGE_CORE_INFO(...) ::iGe::Log::GetCoreLogger()->info(__VA_ARGS__)
IGE_CORE_INFO("Creating window {0} ({1}, {2})", m_Data.Title, m_Data.Width, m_Data.Height);At this point, the retrieved static variable of Log was nullptr. Additionally, when printing the addresses of the static variable during the initialization of both the Log class and WindowsWindow, they were found to be different.
Similarly, if OpenGL is initialized in the .ixx file within the WindowsWindow class of the iGe library:
int status = gladLoadGL((GLADloadfunc) glfwGetProcAddress); But OpenGL functions are called in .cpp within the Application class, the pointer address of glClearColor becomes
nullptr:
void Application::Run() {
while (m_Running) {
glClearColor(1.0f, 0.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
for (Layer* layer : m_LayerStack) {
layer->OnUpdate();
}
m_Window->OnUpdate();
}
}To ensure consistency, all modules should be separated into module interface files and implementation files, with
all function implementations placed in .cpp files.
To enable support for import std, which is currently experimental in CMake, you need to modify the top-level
CMakeLists.txt to explicitly enable the CMAKE_EXPERIMENTAL_CXX_IMPORT_STD feature.
Specifically, you must set the CMAKE_EXPERIMENTAL_CXX_IMPORT_STD variable to a required UUID value. This value can
be found
on CMake's official GitHub documentation,
under the corresponding tag or version branch.
For example, for CMake version 3.31.6, the required value is:
0e5b6991-d74f-4b3d-a41c-cf096e0b2508
Due to the author's current research and professional commitments, this project is temporarily paused with no set date for future updates. However, all existing code and documentation remain open for learning and reference purposes.
Contributions, forks, and further exploration are warmly welcomed by the community. Thank you for your understanding and support.