Giter Site home page Giter Site logo

alansley / cpp_glfw3_basecode Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 9.21 MB

C++ GLFW3 Basecode with integrated GLM, STB, and ImGui for rapid OpenGL prototyping & experimentation.

License: MIT License

C++ 50.65% C 45.76% CSS 0.35% JavaScript 0.46% HTML 0.86% Objective-C 0.54% CMake 0.05% Objective-C++ 0.92% Shell 0.01% GLSL 0.08% Kotlin 0.01% Makefile 0.22% Batchfile 0.08% GDB 0.01%
basecode cross-platform glfw3 glsl linux opengl windows glm imgui stb

cpp_glfw3_basecode's Introduction

C++ GLFW3 Basecode

Cross-platform C++ GLFW3 Basecode with GLAD, GLM, STB, and Dear ImGui pre-integrated for rapid OpenGL prototyping and experimentation.

Main is kept as small as possible so you can add as much code there as you want if you're just experimenting, or alternatively you might want to add your code to a 'demo-scene'-type class (examples provided) as a quick and easy way to separate out your new functionality.

Screenshot of cpp_glf3_basecode

In terms of custom functionality, this basecode also provides:

  • A Window class with a mouse/keyboard and window event handlers and a custom 3D camera to look and move around,
  • A ShaderProgram class to easily load & combine vertex/fragment shaders as well as tesselation shaders,
  • Simple Point, Line, Quad and TexturedQuad classes for basic drawing, as well as a Grid class for orientation,
  • Selectable Hor+ and Vert- Field of View (FoV) handling, and
  • A basic WaveFront .OBJ 3D model loader.

If you make any neat demo scenes or adjustments and would like to see them included please feel free to raise a pull request, or if you have any problems with the code you're welcome to raise an issue.

Build

This project comes configured to build in Visual Studio 2022 on the Windows platform and via a Code::Blocks project in Linux.

Simply download a zip of the code & extract it or clone the repo, then:

  • For Windows: Open the VisualStudio2022_Windows\cpp_glfw3_basecode.sln file,

or

  • For Linux: Open the CodeBlocks_Linux/cpp_glfw3_basecode.cbp file.

License

This project is provided under a MIT license (see the top-level LICENSE file), however the integrated libraries have their own licenses - see the libs folder and its contained library subfolders for further details.

TODO:

  • Run a clean-up sweep through every file in the codebase fixing up any warnings and applying linting/best-practice where appropriate,
  • Modify Point/Line/Quad/TexturedQuad classes to provide both 2D and 3D versions,
  • Create a YouTube video demonstration and link it in this readme,
  • Create additional demo scenes with further functionality (i.e., screen-space effect shaders, use the tessalation shaders, scissor testing, geometry shaders, bump / displacement mapping, stochastic sampling etc.),
  • Integrate a better 3D model loader rather than the simple .OBJ file loader I wrote, (probably use TinyObjLoader - https://github.com/tinyobjloader) and
  • Create a Code::Blocks project for Windows (the Linux one now exists, but there's no harm in adding a Windows version for those who want something lighter than VS2022).

MAYBE:

  • Add a Light struct and adjust the ambient/diffuse/specular shaders to use it so you can pass in an array of lights? (Possibly no need - TinyObjLoader takes lights as part of the OBJs)

cpp_glfw3_basecode's People

Contributors

alansley avatar

Stargazers

 avatar

Watchers

 avatar

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.