Skip to content

Commit de96fc3

Browse files
committed
demo: 光照贴图
1 parent bca9bf5 commit de96fc3

File tree

290 files changed

+74397
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

290 files changed

+74397
-0
lines changed

2.4-light-lighting-map/CMakeLists.txt

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# 最低版本
2+
cmake_minimum_required (VERSION 2.8)
3+
4+
# 项目信息
5+
project(learnOpenGL)
6+
7+
include_directories(${CMAKE_SOURCE_DIR}/include)
8+
9+
link_directories(${CMAKE_SOURCE_DIR}/lib)
10+
link_libraries(GLFW3)
11+
# link_libraries(SOIL)
12+
13+
list(APPEND CMAKE_CXX_FLAGS "-std=c++11")
14+
15+
if(WIN32)
16+
set(LIBS glfw3 opengl32 assimp)
17+
elseif(UNIX AND NOT APPLE)
18+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")
19+
find_package(OpenGL REQUIRED)
20+
add_definitions(${OPENGL_DEFINITIONS})
21+
find_package(X11 REQUIRED)
22+
# note that the order is important for setting the libs
23+
# use pkg-config --libs $(pkg-config --print-requires --print-requires-private glfw3) in a terminal to confirm
24+
set(LIBS ${GLFW3_LIBRARY} X11 Xrandr Xinerama Xi Xxf86vm Xcursor GL dl pthread ${ASSIMP_LIBRARY})
25+
set (CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -ldl")
26+
elseif(APPLE)
27+
INCLUDE_DIRECTORIES(/System/Library/Frameworks)
28+
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
29+
FIND_LIBRARY(OpenGL_LIBRARY OpenGL)
30+
FIND_LIBRARY(GLUT_LIBRARY GLUT)
31+
FIND_LIBRARY(IOKit_LIBRARY IOKit)
32+
FIND_LIBRARY(CoreVideo_LIBRARY CoreVideo)
33+
MARK_AS_ADVANCED(COCOA_LIBRARY OpenGL_LIBRARY)
34+
SET(APPLE_LIBS ${COCOA_LIBRARY} ${IOKit_LIBRARY} ${OpenGL_LIBRARY} ${GLUT_LIBRARY} ${CoreVideo_LIBRARY})
35+
set(LIBS ${LIBS} ${APPLE_LIBS})
36+
else()
37+
set(LIBS )
38+
endif(WIN32)
39+
40+
# set(LIBS ${LIBS} ${GLFW3} ${SOIL})
41+
set(LIBS ${LIBS} ${GLFW3})
42+
43+
# glad库
44+
add_library(GLAD "src/glad.c")
45+
set(LIBS ${LIBS} GLAD)
46+
47+
# stb_image库
48+
add_library(STB_IMAGE "src/stb_image.cpp")
49+
set(LIBS ${LIBS} STB_IMAGE)
50+
51+
# 指定生成目标
52+
add_executable(main "src/main.cpp")
53+
54+
target_link_libraries(main ${LIBS})
55+
56+
39.9 KB
Loading
181 KB
Loading
457 KB
Loading
Loading

2.4-light-lighting-map/img/matrix.jpg

291 KB
Loading

2.4-light-lighting-map/img/wall.jpg

251 KB
Loading

0 commit comments

Comments
 (0)