Giter Club home page Giter Club logo

opengl-cpp-course's Introduction

OpenGL C++ Course

!! Please not that this repository is under construction !!

Purpose and expectations

This repository contains the source code for the OpenGL C++ course. The course teaches students how to effectively use C++ in conjunction with OpenGL to build graphical programs. The course is made in a concise manner and we refer often to external resources which we expect the student to read (or at least glance through). The learning strategy employed here is "Learning by example" and "Learning by doing". This means that example code is provided and the student is given the opportunity to practice with the material in the form of exercises.

We assume that the student is relatively comfortable reading C++ code and has some previous experience with it. The exercises are constructed in such a way that the student only has to change a few lines of code. Furthermore, we expect that the reader is familiar with matrix-vector multiplication and has some understanding of mathematics. Finally, we expect that the user is a bit familiar using the Windows command prompt.

This course focuses on running OpenGL in a Windows environment, although it should also run under Linux (we have tested it for Linux Debian). If you want to compile the programs on Linux, please read below as the instructions for CMake differ slightly. OpenGL and the libraries we are using are cross-platform and thus work on Windows, Mac OS X as well as Linux.

Feedback on this course is always much appreciated if provided in a constructive manner. Feel free to use the Issues system on Github for this purpose.

Lesson overview

  1. Compiling and running an OpenGL program
  2. Model, View, Perspective
  3. Creating a Shader class
  4. Models
  5. Lighting
  6. Textures
  7. Anaglyph

Prerequisite software

In order to compile the software, you need to download and install the following packages.

  • CMake - During the installation, you need to select Add CMAKE to the system PATH for all users.
  • Microsoft Visual Studio Community Edition - Use the 2017 version. Under 'Workloads', you only need to select 'Desktop Development with C++'
  • Git - You can use the default settings during the installation procedure.
  • Python - Use the latest Python 3 version!

Dependencies

  • GLFW
  • Boost
  • Glew
  • GLM

You can easily download these dependencies by double-clicking on download_dep.py in the vendor folder. This might take a while though!

Compilation instructions for Windows

Open the Native x64 Native Tools Command Prompt and go to the repository root folder.

Create a build directory and execute CMake; note that you need to change XX to the lesson of interest.

mkdir build
cd build
cmake ..\lessonXX -G "NMake Makefiles"
nmake

Compilation instructions for Linux

Open a terminal, go to the root folder of the repository and use the following commands.

mkdir build
cd build
cmake ..\lessonXX
make -j5

Troubleshooting

Framerate is very low

If you are working with Intel Integrated Graphics, open the Intel (U)HD Graphics Control Panel. Go to 3D and add the executable to the Select Application window using the Browse button. Then under Vertical Sync, select Use Driver Settings.

Alternatively, try disabling the following line:

// set swap interval
glfwSwapInterval(1);

opengl-cpp-course's People

Contributors

ifilot avatar lkkmpn 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.