Code Monkey home page Code Monkey logo

cmake-glfw-opengl-template's Introduction

CMake-Glfw-OpenGL-Template

What is this?

CMake based C++ Project template with support for glfw, glad, imgui, spdlog, tracy, stbi, cgltf

This template is split into three parts

Project and Project.Library and lib

Project will be your actual project/game, Project.Library containing supporting functions, things you might be reusing for something else. It could also contain your graphics/game engine abstractions.

This template provides a basic Application base class, ready to go, including window creation via glfw, hooking up OpenGL via glad, preparing UI rendering via dear imgui, logging via spdlog and comes with profiler capabilities via tracy too. The example also loads a model with textures via cgltf and stbi.

lib contains the list of dependencies used by projects across the solution, in this case, imgui, spdlog, glm, tracy, stbi and cgltf.

The project provides a tiny example of an application which most graphics-engine/game-engine/game developers/vfx artists or perhaps even researchers write, and its always the same, some window glue, some opengl loading, some mesh rendering and texture loading, spdlog unifies logging here - as each and every project I've seen keeps using printf or cout or most likely some self-rolled logger which is really unnecessary.

Screenshot

For whom is this for?

  • Prototyping
  • Game Jams
  • Getting started with programming
  • Getting started with graphics programming

What do you need?

  • CMake
  • for VSCode the CMake Tools extension from Microsoft
  • a compiler of your choice (Clang, GCC, MSVC)

Make sure to run git submodule update --init --recursive upon cloning the repository to ensure that Deccer's Cubes are included.

Assumptions

This project template assumes the following things

  • OpenGL 4.6 support (can be changed in Application.cpp:59-60)
  • Resolution >= 1920x1080 so that you can actually use the window (can be changed in Application.cpp:66-67)

What's next?

You most likely dont want to name your program Project and or Project.Library. Use your favorite search tool and replace Project.Library with UE6.Engine and Project with UE6 :)

cmake-glfw-opengl-template's People

Contributors

clementineaccount avatar deccer avatar lvd0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cmake-glfw-opengl-template's Issues

Include Build Instructions for command line for Linux

Some people might not be used to CMake, either using it from command line or using it in Visual Studio's CMake. I was able to run CMake Make .. and then realized I don't know what to do and have to do troubleshooting to figure out what to do to build when there are multiple CMakeLists.txt files. I have only been familiar with either single CMakeLists.txt for command line or using Visual Studios or Visual Code's CMake extension.

Can you make this template a github "template"?

You can do this by going to settings>general and then checking "Template repository".
This way anytime anyone wants to use this they can just add /generate at the end of the url and can make a repo out of it!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.