https://github.com/avitase/omelet

A modern C++ template for creating SDL3/OpenGL applications

https://github.com/avitase/omelet

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.7%) to scientific vocabulary

Keywords

cmake cpp opengl sdl3 template
Last synced: 5 months ago · JSON representation

Repository

A modern C++ template for creating SDL3/OpenGL applications

Basic Info
  • Host: GitHub
  • Owner: avitase
  • License: mit
  • Language: C++
  • Default Branch: main
  • Homepage:
  • Size: 314 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
cmake cpp opengl sdl3 template
Created 11 months ago · Last pushed 6 months ago
Metadata Files
Readme License

README.md

Omlete 🍳

This is a highly opinionated CMake template using contemporary C++ to wrap "modern" OpenGL, SDL3, Dear ImGui, glbindings, and GLM.

Template or Library?

Consider this repository as a template that helps you creating a canonical Hello World in the context of OpenGL programming: a colorful rotating triangle!

A colorful rotation triangle

In contrast to a library or a full-fledged game engine, this template does note even try to hide OpenGL details from you but instead provides you with a good (this is the part that is highly opinionated) starting point with convenient helper functions that wraps, for instance, the annoying VAO/VBO fiddling. However, none of the files under omlete/ should be considered out of bounds: Open them, read them, change them! (Maybe except for omelet/source/glsl_program.cpp; here be dragons🐉)

How to use it?

Checkout the repository including its various submodules and build it with CMake. A layman approach (on Linux🐧) is to type:

bash git clone --recurse-submodules https://github.com/avitase/omelet mkdir -p omelet/build && cd omelet/build/ cmake .. && make -j

If you have installed OpenGL on your system, this will build SDL3, Dear ImGui, glbindings, and GLM and finally compile the template in omelet/. (If not, it will fail spectacularly💥)

Compiling the dependencies does take some time but will eventually create an executable under build/install/bin. Run it, it's safe!✋

./install/bin/omelete

You should see a spinning triangle and a Dear ImGui window with the position of your cursor and an FPS counter.

How to use it properly?

This template will give you a CMake Superbuild that builds SDL3, Dear ImGui, glbindings, and GLM as dependencies and the actual SDL3/OpenGL template. Typically, building the Superbuild only has to be done once, you can then navigate to omelete/ (the subdirectory) and start fouling around here.

The subproject omelet/ expects to find its dependencies under build/install. This happens automatically if you use our CMakeUserPresets.json.EXAMPLE (click on the link to learn more about what this is), e.g., by copying it:

```bash

project root (not omelet/omelet!)

cp CMakeUserPresets.json.EXAMPLE CMakeUserPresets.json ```

This will make a new preset release available that you can use to build the Superbuild:

bash cmake --preset=release cmake --build --preset=release

Similar to before, this should install everything under build/install and you can now navigate to the subproject omelet/. Here, you'll find again a CMakeUserPresets.json.EXAMPLE that sets CMAKE_PREFIX_PATH for you and exposes two presets dev and dev-clang-tidy. Feel free to change these presets to your own needs and then run, e.g.,

```bash

run this in omelet/omelet

cmake --preset=dev cmake --build --preset=dev ```

Next steps

Everything you find under omelet/ is nothing but a template, and you might have to change all files eventually. However, consider starting your journey in omelet/source/triangle.cpp and omelet/source/world.cpp, and then gradually work yourself through the includes, when needed.

When you feel lost, have a look into omelet/source/main.cpp where we define int main(int, char**) and start the life of the window.

Seeing link-time errors?

The super build script is not bullet-proof and assumes that all your dependencies that are build during the process are linked statically. If this is not possible, one has to adopt the rpath, e.g., by adding the following the build recipe:

ExternalProject_Add( omelet [...] CMAKE_ARGS [...] -DCMAKE_INSTALL_RPATH:STRING=<INSTALL_DIR>/lib;<INSTALL_DIR>/lib64 -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON

Owner

  • Name: Nis Meinert
  • Login: avitase
  • Kind: user
  • Company: Pasteur Labs

GitHub Events

Total
  • Push event: 27
  • Create event: 1
Last Year
  • Push event: 27
  • Create event: 1

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels