Skip to content

Commit

Permalink
rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
mohlek committed Aug 16, 2020
1 parent 6bec39b commit a6f0259
Show file tree
Hide file tree
Showing 38 changed files with 16 additions and 1,100 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "engine"]
path = engine
url = [email protected]:mohlek/opengl_engine.git
89 changes: 5 additions & 84 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,90 +1,11 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.5)

PROJECT(MEDIEVAL_SOMETHING)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
file(GLOB_RECURSE src_medieval "src/*.cpp")

set(SOURCE
src/engine/Window.cpp
src/engine/Buffer.cpp
src/engine/VertexArrayObject.cpp
src/engine/Object.cpp
src/engine/Camera.cpp
src/engine/shader/ShaderLoader.cpp
src/engine/shader/Shader.cpp
src/engine/shader/ShaderProgram.cpp
src/engine/model/3ds/Model3DS.cpp
src/shader/MainShader.cpp
src/main.cpp
)
add_subdirectory(engine/)

set(SHADERS
src/shader/main.frag
src/shader/main.vert
)
add_executable(medievalSomething ${src_medieval})

set(RESOURCES
resource/dragon.3ds
)

#########################################################
# FIND OpenGL
#########################################################
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIRS})
link_directories(${OPENGL_LIBRARY_DIRS})
add_definitions(${OPENGL_DEFINITIONS})
if(NOT OPENGL_FOUND)
message(ERROR " OpenGL not found!")
endif(NOT OPENGL_FOUND)

#########################################################
# FIND GLEW
#########################################################
find_package(GLEW REQUIRED)
include_directories(${GLEW_INCLUDE_DIRS})
link_directories(${GLEW_LIBRARY_DIRS})
add_definitions(${GLEW_DEFINITIONS})
if(NOT GLEW_FOUND)
message(ERROR " GLEW not found!")
endif(NOT GLEW_FOUND)

#########################################################
# FIND GLFW
#########################################################
find_package(PkgConfig REQUIRED)
pkg_search_module(GLFW REQUIRED glfw3)
# find_package(glfw3 3.2 REQUIRED)
include_directories(${GLFW_INCLUDE_DIRS})
link_directories(${GLFW_LIBRARY_DIRS})
add_definitions(${GLDFW_DEFINITIONS})
if(NOT GLFW_FOUND)
message(ERROR " GLFW not found!")
endif(NOT GLFW_FOUND)

########################################################
# FIND LIB3DS
########################################################
find_package(Lib3ds)
include_directories(${LIB3DS_INCLUDE_DIRS})
link_directories(${LIB3DS_LIBRARY_DIRS})
if(NOT LIB3DS_FOUND)
message(ERROR " LIB3DS not found!")
endif(NOT LIB3DS_FOUND)


########################################################
# COPY SHADER
########################################################

foreach(SHADER ${SHADERS})
message(STATUS "copy shader " ${SHADER})
file(COPY ${SHADER} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/shader/)
endforeach(SHADER)

message(STATUS "copy resources")
file(COPY ${RESOURCES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/resource/)

add_executable(medievalSomething ${SOURCE})

target_link_libraries(medievalSomething ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} ${GLFW_LIBRARIES} ${LIB3DS_LIBRARY})
target_link_libraries(medievalSomething engine)
37 changes: 0 additions & 37 deletions cmake/modules/FindLib3ds.cmake

This file was deleted.

1 change: 1 addition & 0 deletions engine
Submodule engine added at 1d49b8
Binary file removed resource/dragon.3ds
Binary file not shown.
Binary file removed resource/textures/Ani_Fire_A.png
Binary file not shown.
Binary file removed resource/textures/Dragon_Bump_Col2.jpg
Binary file not shown.
Binary file removed resource/textures/Dragon_Nor.jpg
Binary file not shown.
Binary file removed resource/textures/Dragon_Nor_mirror2.jpg
Binary file not shown.
Binary file removed resource/textures/Dragon_ground_color.jpg
Binary file not shown.
Binary file removed resource/textures/Fire_A_2.png
Binary file not shown.
Binary file removed resource/textures/Floor_C.jpg
Binary file not shown.
Binary file removed resource/textures/Floor_N.jpg
Binary file not shown.
Binary file removed resource/textures/Floor_S.jpg
Binary file not shown.
65 changes: 0 additions & 65 deletions src/engine/Buffer.cpp

This file was deleted.

36 changes: 0 additions & 36 deletions src/engine/Buffer.h

This file was deleted.

25 changes: 0 additions & 25 deletions src/engine/Camera.cpp

This file was deleted.

16 changes: 0 additions & 16 deletions src/engine/Camera.h

This file was deleted.

9 changes: 0 additions & 9 deletions src/engine/Object.cpp

This file was deleted.

17 changes: 0 additions & 17 deletions src/engine/Object.h

This file was deleted.

37 changes: 0 additions & 37 deletions src/engine/VertexArrayObject.cpp

This file was deleted.

22 changes: 0 additions & 22 deletions src/engine/VertexArrayObject.h

This file was deleted.

Loading

0 comments on commit a6f0259

Please sign in to comment.