Skip to content

anthian/HelloOpenGL

Repository files navigation

CMake on multiple platforms

GitHub license GitHub contributors GitHub issues GitHub pull-requests PRs Welcome

GitHub watchers GitHub forks GitHub stars

HelloOpenGL

Summary

HelloOpenGL is a template project with the same pourpose of Glitter project on which it is based, to be a starting point for the tutorials on learnopengl.com and open.gl. HelloOpenGL also compiles and statically links every required library, so you can jump right into doing what you probably want: how to get started with OpenGL, but has some minor differences with Glitter project.

  • Uses glad2 generator despite of the older generated files of the C branch
  • The folder structure follow the Pitchfork layout conventions
  • Has github actions to test de Cmake files against different platforms

Getting Started

HelloOpenGL has a single dependency, cmake, which is used to generate platform-specific makefiles or project files. Nevertheless, you will also need to install the peer dependencies to compile the GLAD and GLFW submodules.

GLAD submodule peer dependencies

For exmple, Ubuntu has python3 installed so you only need to add the Jinja2 module using pip package manager:

# If Python3 isn't preinstalled, uncomment the following line
# sudo apt install python3
pip install -U Jinja2

GLFW submodule peer dependencies

They are defined in GLFW compile instructions. For example, on Ubuntu you will need the following debian package to create a X11 window:

sudo apt install xorg-dev

Start by cloning this repository, making sure to pass the --recursive flag to grab all the dependencies. If you forgot, then you can git submodule update --init instead.

git clone --recursive https://github.com/anthian/HelloOpenGL
cd HelloOpenGL
cd build

And then, generate a project file or makefile for your platform. If you want to use a particular IDE, make sure it is installed; don't forget to set the Start-Up Project in Visual Studio or the Target in Xcode.

# UNIX Makefile
cmake ..

# Mac OSX
cmake -G "Xcode" ..

# Microsoft Windows
cmake -G "Visual Studio 14" ..
cmake -G "Visual Studio 14 Win64" ..
...

If you compile and run, you should now be at the same point as the Hello Window or Context Creation sections of the tutorials. Open main.cpp on your computer and start writing code!

Documentation

HelloOpenGL provides the most basic windowing example. It is a starting point. HelloOpenGL bundles most of the dependencies needed to implement a basic rendering engine. This includes:

Functionality Library
Mesh Loading assimp
Physics bullet
OpenGL Function Loader glad
Windowing and Input glfw
OpenGL Mathematics glm
Texture Loading stb

If you started the tutorials by installing SDL, GLEW, or SOIL, stop. The libraries bundled with HelloOpenGL supersede or are functional replacements for these libraries.

About

Boilerplate for OpenGL projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published