GithubHelp home page GithubHelp logo

learningopengl's Introduction

LearningOpenGL

Introduction

This repo stores my answers to the exercises of the tutorial of https://learnopengl-cn.github.io/

OpenGL Environments

IDLE: Clion + cmake

Main steps follows: https://learnopengl-cn.github.io/

Install GLFW:

Download source package
Use CMake GUI  with Unix makefiles to generate build file
Generate Library and store in /usr/local/include (head file) /usr/local/lib (library)
cd <build-root>
make
make install

Clion + Cmake:

(cmake source code)

    cmake_minimum_required(VERSION 3.15)
    project(test)
    
    find_package(OpenGL REQUIRED)
    find_package(GLUT REQUIRED)
    include_directories(${OPENGL_INCLUDE_DIR})
    include_directories(${GLUT_INCLUDE_DIR})
    
    set(CMAKE_CXX_STANDARD 14)
    
    add_executable(test main.cpp glad.c)
    
    # specify the search location may change due to computer
    set( _glfw3_HEADER_SEARCH_DIRS "/usr/local/include")
    set( _glfw3_LIB_SEARCH_DIRS "/usr/local/lib")
    
    set( _glfw3_ENV_ROOT $ENV{GLFW3_ROOT} )
    if( NOT GLFW3_ROOT AND _glfw3_ENV_ROOT )
        set(GLFW3_ROOT ${_glfw3_ENV_ROOT} )
    endif()
    
    # Put user specified location at beginning of search
    if( GLFW3_ROOT )
        list( INSERT _glfw3_HEADER_SEARCH_DIRS 0 "${GLFW3_ROOT}/include" )
        list( INSERT _glfw3_LIB_SEARCH_DIRS 0 "${GLFW3_ROOT}/lib" )
    endif()
    
    # Search for the header
    FIND_PATH(GLFW3_INCLUDE_DIR "GLFW/glfw3.h" PATHS ${_glfw3_HEADER_SEARCH_DIRS})
    
    # Search for the library
    FIND_LIBRARY(GLFW3_LIBRARY NAMES libglfw.3.4.dylib PATHS ${_glfw3_LIB_SEARCH_DIRS} )
    
    #include header file directory
    include_directories(${GLFW3_INCLUDE_DIR})
    
    #include library file directory
    link_directories(${_glfw3_LIB_SEARCH_DIRS})
    
    #link library file
    target_link_libraries(test ${GLFW3_LIBRARY})
    
    # include all header file directories
    link_libraries(test ${GLFW3_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIRS})

GLAD:

Download the zip file
put glad file into /usr/local/include ( header file for glad)
put glad.c file inside Project
add glad.c to cmake file (inside add_executable)

GLM

Down load the source code from https://github.com/g-truc/glm
place the glm directory in the root directory of your project
include the directory in CMakeLists

Assimp

Using homebrew
reference:
    https://brewinstall.org/install-assimp-on-mac-with-brew/
    https://stackoverflow.com/questions/29910217/homebrew-installation-on-mac-os-x-failed-to-connect-to-raw-githubusercontent-com

learningopengl's People

Contributors

artanic30 avatar

Watchers

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