Giter Club home page Giter Club logo

glskeleton's Introduction

glskeleton

This is template OpenGL cmake project for project for computer graphics course in gist.

Due to the scope of the lecture, the OpenGL version is intentionally set to 3.1.

Dependancies

You should install CMake and Git on your system. Other libraries will be installed automatically.

Installation

Use git recursive clone to download the template.

You should use Your link in your repository.

git clone --recursive https://github.com/YOUR-ASSIGNMENT-REPO/glskeleton.git

Build

For windows user

  1. Create build folder in project root

  2. Run cmake gui(Configure and Generate)

You need to re-run cmake whenever you add more source files (*.h, *.cpp) See more deatil about this at here.

  1. Set path for build and source folder cmake-gui-setup

Set source code directory to project-root.

Set build directory to project-root/build.

  1. Configure

Alt text

  1. Generate

Alt text

  1. Build the project

  2. Go to build folder

  3. Open glSkeleton.sln file

  4. Make glSkeleton as startup project and build it

After the build process you will get directory structure like this.

.
├── build 
│   ├── CMakeFiles
│   ├── bin                                                # you can find your executable here
│   ├── extern
│   ├── lib                                                # you can find your static libraries
│   ├── src
│   └── glskeleton.sln                                     # your project file
├── extern                                                 # external projects
│   ├── CMakeLists.txt                                     # DO NOT TOUCH THIS
│   ├── glad
│   ├── glm
│   └── tinyobjloader
├── doc                                                    # your report/report template
└── src                                                    # your source code
    └── CMakeLists.txt
└── CMakeLists.txt
12 directories

For linux user

  1. Run cmake

You need to re-run cmake command whenever you add more source files (*.h, *.cpp) See more deatil about this at here.

cd <PROJECT_ROOT>
mkdir build
cd build
cmake ..
  1. Build and compile
make -j4

After the build process you will get directory structure like this.

.
├── build 
│   ├── CMakeFiles
│   ├── bin                                                # you can find your executable here
│   ├── extern
│   ├── lib                                                # you can find your static libraries
│   └── src
├── extern                                                 # external projects
│   ├── CMakeLists.txt                                     # DO NOT TOUCH THIS
│   ├── glad
│   ├── glm
│   └── tinyobjloader
├── doc                                                    # your report/report template
└── src                                                    # your source code
    └── CMakeLists.txt
└── CMakeLists.txt
12 directories

How to

Add more source files

If you want to add more sources to build your executable, see following instruction

  1. Open the CMakeLists.txt in src folder
  2. Add your sources (headers(.h) or sources(.cpp))
add_executable(glskeleton
  main.cpp
  ...
  your_source_file.h
  your_source_file.cpp
  ...
  )
  1. Rerun cmake (See here for details)

Change the project name

  1. Open the CMakeLists.txt in project root
  2. Change the string in project function
project(glskeleton)                                          # Change this

Change the executable name

  1. Open the CMakeLists.txt in src folder
  2. Change the glskeleton to
add_executable(glskeleton                                   # Change this word
  main.cpp
  ...
  )

Submodule init and update

If you didn't use recursive option when you cloned the repo, you should init and update submodules by following commands.

git submodule init
git submodule update

use higher version of OpenGL

WARNING, if you are taking our course, you should not change the OpenGL version

Go to src/main.cpp. Edit following lines.

Original

    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_ANY_PROFILE);

OpenGL 4.5 with core profile

    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

glskeleton's People

Contributors

sleepyeye avatar jooijin avatar

glskeleton's Issues

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.