• Stars
    star
    129
  • Rank 279,262 (Top 6 %)
  • Language
    C++
  • License
    Other
  • Created over 7 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An example cross-platform CMake-based project using SDL2 and OpenGL

An example cross-platform CMake-based project.

This project uses SDL2 and OpenGL to render a spinning 3D logo to a desktop window. You can build it on Windows, MacOS or Linux.

Requirements

Windows (Visual Studio)

CMakeDemo expects to find the SDL2 headers and libraries in a subfolder named extern\SDL-2.0.5. You can download and extract them automatically by running the Python 3 script setup-win32.py. If you don't have Python installed, download and extract them by hand.

On Windows, CMakeDemo uses its own OpenGL headers and loads opengl32.dll dynamically at runtime. Nothing else is needed at build time.

MacOS (Xcode)

Install the SDL2 headers and libraries using MacPorts.

sudo port install libsdl2

OpenGL headers and libraries are installed by Xcode. CMake will find them automatically.

Ubuntu

Install the SDL2 headers and libraries.

sudo apt install libsdl2-dev

OpenGL headers and libraries are already present on the system. CMake will find them automatically.

Build Instructions

For build instructions, see the blog post How to Build a CMake-Based Project.