Skip to content

Commit bee236d

Browse files
committed
Initial Commit
0 parents  commit bee236d

File tree

2,242 files changed

+641553
-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.

2,242 files changed

+641553
-0
lines changed

.gitignore

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
9+
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
13+
14+
# Compiled Dynamic libraries
15+
*.so
16+
*.dylib
17+
*.dll
18+
19+
# Fortran module files
20+
*.mod
21+
*.smod
22+
23+
# Compiled Static libraries
24+
*.lai
25+
*.la
26+
*.a
27+
*.lib
28+
29+
# Executables
30+
*.exe
31+
*.out
32+
*.app
33+
34+
*.pdb
35+
imgui.ini
36+
Tutorial6
37+
38+
DO_NOT_UPLOAD
39+
40+
.vs
41+
out
42+
OGL_Log.txt
43+
*.zip
44+
*.ini
45+
*.mp4
46+
*.pdf

CMakeLists.txt

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# CMakeList.txt : Top-level CMake project file
2+
3+
cmake_minimum_required (VERSION 3.8)
4+
5+
# Project Name
6+
project ("Assignment6")
7+
8+
# C++ Standard Version
9+
set(CMAKE_CXX_STANDARD 20)
10+
11+
######################################
12+
## C++ Compiling Flags
13+
set(CMAKE_CXX_STANDARD 20)
14+
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
15+
# using Clang
16+
set(CMAKE_CXX_FLAGS "")
17+
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") # Debug + Compile Time Optimization
18+
set(CMAKE_CXX_FLAGS_RELEASE "-O3") # Runtime Optimization
19+
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
20+
# using GCC
21+
set(CMAKE_CXX_FLAGS "")
22+
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") # Debug + Compile Time Optimization
23+
set(CMAKE_CXX_FLAGS_RELEASE "-O3") # Runtime Optimization
24+
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
25+
# using Visual Studio C++
26+
set(CMAKE_CXX_FLAGS "")
27+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Od -DEBUG") # Debug + Compile Time Optimization
28+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -DNDEBUG") # Runtime Optimization
29+
endif()
30+
31+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR})
32+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR})
33+
34+
# Library Directory
35+
add_subdirectory("lib")
36+
37+
# Library Directory
38+
add_subdirectory("Documentation")
39+
40+
# Assignment2 Executable
41+
file (GLOB ASSIGNMENT_SOURCES
42+
*.cpp
43+
OGL_Implementation/*.cpp
44+
OGL_Implementation/DebugInfo/*.cpp
45+
OGL_Implementation/Mesh/*.cpp
46+
OGL_Implementation/Shader/*.cpp
47+
OGL_Implementation/Entity/*.cpp
48+
OGL_Implementation/EntityAttribute/*.cpp
49+
OGL_Implementation/Entity/ParticleSystem/*.cpp
50+
OGL_Implementation/Entity/ParticleSystem/Spirals/*.cpp
51+
OGL_Implementation/Entity/ParticleSystem/Snow/*.cpp
52+
OGL_Implementation/Image/*.cpp
53+
OGL_Implementation/Light/*.cpp
54+
OGL_Implementation/Rendering/*.cpp
55+
OGL_Implementation/Text/*.cpp
56+
OGL_Implementation/Tools/*.cpp
57+
)
58+
59+
file (GLOB ASSIGNMENT_HEADERS
60+
*.hpp
61+
OGL_Implementation/*.hpp
62+
OGL_Implementation/DebugInfo/*.hpp
63+
OGL_Implementation/Mesh/*.inl
64+
OGL_Implementation/Mesh/*.hpp
65+
OGL_Implementation/Shader/*.hpp
66+
OGL_Implementation/Entity/*.hpp
67+
OGL_Implementation/EntityAttribute/*.hpp
68+
OGL_Implementation/EntityAttribute/*.inl
69+
OGL_Implementation/Entity/*.inl
70+
OGL_Implementation/Entity/ParticleSystem/*.hpp
71+
OGL_Implementation/Entity/ParticleSystem/*.inl
72+
OGL_Implementation/Entity/ParticleSystem/Spirals/*.hpp
73+
OGL_Implementation/Entity/ParticleSystem/Snow/*.hpp
74+
OGL_Implementation/Image/*.hpp
75+
OGL_Implementation/Light/*.hpp
76+
OGL_Implementation/Rendering/*.hpp
77+
OGL_Implementation/Text/*.hpp
78+
OGL_Implementation/Tools/*.hpp
79+
)
80+
81+
add_executable(Assignment6
82+
${ASSIGNMENT_SOURCES}
83+
${ASSIGNMENT_HEADERS}
84+
)
85+
86+
# Linking libraries to Assignment2
87+
target_link_libraries(Assignment6 opengl32 glad glfw glm ImGui SOIL freetype
88+
)
89+
90+
# Profiling
91+
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/PROFILE")
92+
93+
#--------------------------------------------------------------------
94+
# Hide the console window in visual studio projects - Release
95+
#--------------------------------------------------------------------
96+
if(MSVC)
97+
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
98+
endif()
99+
100+
# Including root directory & libraries directories
101+
target_include_directories(Assignment6 PUBLIC
102+
${PROJECT_SOURCE_DIR}
103+
$<INSTALL_INTERFACE:include>
104+
)
105+
106+
# Installation Procedure
107+
install(
108+
TARGETS Assignment6
109+
CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES}
110+
)

CMakeSettings.json

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "x64-Debug",
5+
"generator": "Visual Studio 16 2019 Win64",
6+
"configurationType": "Debug",
7+
"inheritEnvironments": [ "msvc_x64_x64" ],
8+
"buildRoot": "${projectDir}\\out\\build\\${name}",
9+
"installRoot": "${projectDir}\\out\\install\\${name}",
10+
"cmakeCommandArgs": "",
11+
"buildCommandArgs": "",
12+
"ctestCommandArgs": "",
13+
"variables": [
14+
{
15+
"name": "BUILD_SHARED_LIBS",
16+
"value": "False",
17+
"type": "BOOL"
18+
},
19+
{
20+
"name": "GLFW_BUILD_DOCS",
21+
"value": "False",
22+
"type": "BOOL"
23+
}
24+
]
25+
},
26+
{
27+
"name": "x64-Release",
28+
"generator": "Visual Studio 16 2019 Win64",
29+
"configurationType": "Release",
30+
"buildRoot": "${projectDir}\\out\\build\\${name}",
31+
"installRoot": "${projectDir}\\out\\install\\${name}",
32+
"cmakeCommandArgs": "",
33+
"buildCommandArgs": "",
34+
"ctestCommandArgs": "",
35+
"inheritEnvironments": [ "msvc_x64_x64" ],
36+
"variables": [
37+
{
38+
"name": "BUILD_SHARED_LIBS",
39+
"value": "False",
40+
"type": "BOOL"
41+
},
42+
{
43+
"name": "GLFW_BUILD_DOCS",
44+
"value": "False",
45+
"type": "BOOL"
46+
}
47+
]
48+
}
49+
]
50+
}

Constants.hpp

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/*****************************************************************//**
2+
* \file Constants.hpp
3+
* \brief Contains all constants/constexpr variables associated
4+
* with settings
5+
*
6+
* \author Kevin Pruvost ([email protected])
7+
* \date April, 04 2022
8+
*********************************************************************/
9+
#pragma once
10+
11+
namespace Constants
12+
{
13+
namespace Window
14+
{
15+
constexpr const char * windowName = "Assignment 6: Pruvost Kevin 2021400603";
16+
}; // !Constants::Window
17+
18+
namespace Paths
19+
{
20+
// Window
21+
constexpr const char * windowIcon = "resources/Icons/tsinghua_icon.png";
22+
// Shaders
23+
constexpr const char * pointShaderVertex = "resources/Shaders/point.vert.glsl";
24+
constexpr const char * pointShaderFrag = "resources/Shaders/point.frag.glsl";
25+
constexpr const char * faceShaderVertex = "resources/Shaders/face.vert.glsl";
26+
constexpr const char * faceShaderFrag = "resources/Shaders/face.frag.glsl";
27+
constexpr const char * face2DShaderVertex = "resources/Shaders/face2D.vert.glsl";
28+
constexpr const char * face2DShaderFrag = "resources/Shaders/face2D.frag.glsl";
29+
constexpr const char * wireframeShaderVertex = "resources/Shaders/wireframe.vert.glsl";
30+
constexpr const char * wireframeShaderFrag = "resources/Shaders/wireframe.frag.glsl";
31+
constexpr const char * lightShaderVertex = "resources/Shaders/light.vert.glsl";
32+
constexpr const char * lightShaderFrag = "resources/Shaders/light.frag.glsl";
33+
34+
constexpr const char * text2DShaderVertex = "resources/Shaders/text2D.vert.glsl";
35+
constexpr const char * text2DShaderFrag = "resources/Shaders/text2D.frag.glsl";
36+
constexpr const char * text3DShaderVertex = "resources/Shaders/text3D.vert.glsl";
37+
constexpr const char * text3DShaderFrag = "resources/Shaders/text3D.frag.glsl";
38+
39+
constexpr const char * particleShaderVertex = "resources/Shaders/particle.vert.glsl";
40+
constexpr const char * particleShaderFrag = "resources/Shaders/particle.frag.glsl";
41+
constexpr const char * snowShaderVertex = "resources/Shaders/snow.vert.glsl";
42+
constexpr const char * snowShaderFrag = "resources/Shaders/snow.frag.glsl";
43+
44+
constexpr const char * bezierShaderFrag = "resources/Shaders/bezier.frag.glsl";
45+
constexpr const char * bezierShaderVertex = "resources/Shaders/bezier.vert.glsl";
46+
constexpr const char * bezierShaderTcs = "resources/Shaders/bezier.tcs.glsl";
47+
constexpr const char * bezierShaderTes = "resources/Shaders/bezier.tes.glsl";
48+
49+
constexpr const char * bezierWireframeShader = "bezier_wireframe";
50+
constexpr const char * bezierWireframeShaderFrag = "resources/Shaders/wireframe.frag.glsl";
51+
constexpr const char * bezierWireframeShaderVertex = "resources/Shaders/wireframe.vert.glsl";
52+
constexpr const char * bezierWireframeShaderTcs = "resources/Shaders/bezier.tcs.glsl";
53+
constexpr const char * bezierWireframeShaderTes = "resources/Shaders/bezier.tes.glsl";
54+
55+
constexpr const char * axisDisplayerShaderVertex = "resources/Shaders/axisdisplayer.vert.glsl";
56+
constexpr const char * axisDisplayerShaderFrag = "resources/Shaders/axisdisplayer.frag.glsl";
57+
// Planets
58+
constexpr const char * star = "resources/Textures/Star.bmp";
59+
// Snow
60+
constexpr const char * snowflake = "resources/Textures/snow2.png";
61+
constexpr const char * snowyBackground = "resources/Textures/snowy_background.png";
62+
// Bezier
63+
constexpr const char * ground1 = "resources/Textures/ground1.png";
64+
// Fonts
65+
constexpr const char * arialFont = "resources/Fonts/arial.ttf";
66+
constexpr const char * starFont = "resources/Fonts/star.ttf";
67+
constexpr const char * notesFont = "resources/Fonts/notes.ttf";
68+
namespace Models
69+
{
70+
namespace Rat
71+
{
72+
constexpr const char * objFile = "resources/Models/real_rat.obj";
73+
constexpr const char * material = "resources/Models/real_rat.mtl";
74+
constexpr const char * texture = "resources/Models/rat.png";
75+
}; // !Constants::Paths::Models::Rat
76+
namespace Torus
77+
{
78+
constexpr const char * objFile = "resources/Models/eight.uniform.obj";
79+
}; // !Constants::Paths::Models::Torus
80+
}; // !Constants::Paths::Models
81+
}; // !Constants::Paths
82+
83+
namespace UBO // Uniform Buffer Objects
84+
{
85+
namespace Names
86+
{
87+
constexpr const char * cameraProps = "CameraProps";
88+
constexpr const char * lights = "Lights";
89+
constexpr const char * projection = "Projection";
90+
}; // !Constants::UBO::Names
91+
namespace Ids
92+
{
93+
constexpr const GLuint cameraProps = 0;
94+
constexpr const GLuint lights = 1;
95+
constexpr const GLuint projection = 2;
96+
};
97+
}; // !Constants::UBO
98+
}; // !Constants

Documentation/CMakeLists.txt

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# CMakeList.txt : Top-level CMake project file, do global configuration
2+
# and include sub-projects here.
3+
#
4+
cmake_minimum_required (VERSION 3.8)
5+
6+
# first we can indicate the documentation build as an option and set it to ON by default
7+
option(BUILD_DOC "Build documentation" ON)
8+
9+
find_package(Doxygen REQUIRED)
10+
if (DOXYGEN_FOUND)
11+
#if (CMAKE_BUILD_TYPE MATCHES "^[Rr]elease")
12+
# set input and output files
13+
set(DOXYGEN_IN "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile")
14+
set(DOXYGEN_OUT "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.out")
15+
16+
# request to configure the file
17+
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
18+
message("Doxygen build started")
19+
20+
# note the option ALL which allows to build the docs together with the application
21+
add_custom_target(Docs ALL
22+
COMMAND "${DOXYGEN_EXECUTABLE}" "${DOXYGEN_OUT}"
23+
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
24+
COMMENT "Generating API documentation with Doxygen"
25+
VERBATIM
26+
)
27+
#endif()
28+
else (DOXYGEN_FOUND)
29+
message("Doxygen need to be installed to generate the doxygen documentation")
30+
endif(DOXYGEN_FOUND)

0 commit comments

Comments
 (0)