Those packages and tools are used to build this project.
-
mosra/magnum: Lightweight and modular C++11 graphics middleware for games and data visualization
-
MSYS2, this contains the compiler suite(mingw-w64 gcc compiler), and many prebuild libraries.
-
Code::Blocks IDE, the
.cbp
file should be opened by this IDE.
First, you have MSYS2 installed in your Windows.
The wxWidgets library could be installed by such commands in the msys2 shell.
pacman -S mingw-w64-x86_64-wxmsw3.1
And the Magnum library should also be installed by the commands
pacman -S mingw-w64-x86_64-magnum
In the root folder, there is a file named wx-config-msys2.exe
, which I built from the project: eranif/wx-config-msys2: wx-config tool for MSYS2 based installation of wxWidgets using the mingw64 repository. The wx-config-msys2.exe
will be called when you click the "Build" button in Code::Blocks to generate the correct build options.
The source code is mainly modified from this magnum example code:
Also, the wxWidgets code is modified and redesigned from magnum's wxWidgets bootstrap code:
https://github.com/mosra/magnum-bootstrap/tree/base-wxwidgets
The current issue(as 2021-08-01, this issue is fixed now by using the arcball example code from magnum example)
The mouse scroll event works OK(see void GLPanel::OnMouseScroll(wxMouseEvent &event)
function), so when you scroll up/down with the mouse's wheel, you can zoom in/out the scene.
The key press handling works OK(see void GLPanel::OnKeyDown(wxKeyEvent &event)
function), when you press the "0" key, the scene/camera will get reset, when you press the "1", "3" or "7" key, the scene/camera will go to the preset positions.
But it looks like the mouse left button drag does not rotate the scene correctly(see void GLPanel::OnMouseMove(wxMouseEvent &event)
function), compared with Magnum's official webgl demos here: Mouse Interaction Example, also the right mouse button drag is not working, it should translate the screne/camera.