Magma is a simple application framework built with Dear ImGui, providing an easy-to-use platform for developing both desktop and web applications. It offers support for both Vulkan and OpenGL rendering backends.
- Simple and intuitive interface powered by Dear ImGui
- Cross-platform support for desktop and web applications
- Rendering backends for Vulkan and OpenGL
- Easy to use
- CMake (Required)
- VulkanSDK (Optional)
- Emscripten (Optional)
To get started with Magma, follow these steps:
- Clone the repository recursively
- Create a
CMakeLists.txtfile
cmake_minimum_required(VERSION 3.3)
project(MagmaExample)
set(MAGMA_VULKAN ON)
set(MAGMA_OPENGL OFF)
set(MAGMA_EMSCRIPTEN OFF)
#add_compile_definitions(MAGMA_NO_LOGGING) #uncomment to stop all logging
#add_compile_definitions(MAGMA_NO_CORE_LOGGING) #uncomment to stop core logging
#add_compile_definitions(MAGMA_NO_CLIENT_LOGGING) #uncomment to stop client logging
add_subdirectory(Magma)
add_executable(MagmaExample
Sandbox/src/main.cpp
)
target_link_libraries(MagmaExample
PRIVATE
magma
)- Create a main file (in this case
Sandbox/src/main.cpp)
#define MAGMA_ENTRYPOINT
#include "Magma/Magma.h"
class MyApplication:public mg::Application
{
public:
MyApplication()
{
}
void Init()
{
SetSize(600,600);
SetTitle("Magma Example Application");
}
void Destroy() override
{
}
~MyApplication()
{
}
void Render() override
{
ImGui::ShowDemoWindow();
ImGui::Begin("Second Window");
if(ImGui::Button("Click me"))
SetTitle("You Clicked Me");
if (ImGui::Button("Resize"))
SetSize(450,450);
ImGui::End();
}
private:
};
mg::Application* CreateApplication(int argc, char** argv)
{
return new MyApplication();
}NOTE:
#define MAGMA_ENTRYPOINTshould be before including magma and should be defined wheremg::Application* CreateApplication(int argc, char** argv)is implemented.
After initial setup, it may be necessary to rebuild your project to ensure all configurations are properly applied.
You can also use the app template and the app with layers template
We welcome contributions from the community. If you encounter any issues or have suggestions for improvement, please open an issue or submit a pull request on the GitHub repository.
- Magma is licensed under the MIT License. See the LICENSE file for more details.
- Magma uses the FiraCode font Open Font License (OFL)





