Showing preview only (6,171K chars total). Download the full file or copy to clipboard to get everything.
Repository: MorcilloSanz/RendererGL
Branch: main
Commit: 7c83ec1f410f
Files: 575
Total size: 5.8 MB
Directory structure:
gitextract_oar47vq7/
├── .gitignore
├── CMakeLists.txt
├── LICENSE
├── README.md
├── compile.md
├── src/
│ ├── CMakeLists.txt
│ └── engine/
│ ├── CMakeLists.txt
│ ├── Vec3.h
│ ├── group/
│ │ ├── DynamicPolytope.cpp
│ │ ├── DynamicPolytope.h
│ │ ├── Group.cpp
│ │ ├── Group.h
│ │ ├── Polytope.cpp
│ │ ├── Polytope.h
│ │ ├── Scene.cpp
│ │ └── Scene.h
│ ├── lighting/
│ │ ├── DirectionalLight.cpp
│ │ ├── DirectionalLight.h
│ │ ├── Light.cpp
│ │ ├── Light.h
│ │ ├── Material.h
│ │ ├── PBRMaterial.h
│ │ ├── PhongMaterial.h
│ │ ├── PointLight.cpp
│ │ └── PointLight.h
│ ├── model/
│ │ ├── Model.cpp
│ │ └── Model.h
│ ├── opengl/
│ │ ├── buffer/
│ │ │ ├── Buffer.h
│ │ │ ├── FrameBuffer.cpp
│ │ │ ├── FrameBuffer.h
│ │ │ ├── IndexBuffer.cpp
│ │ │ ├── IndexBuffer.h
│ │ │ ├── MultiSampleRenderBuffer.cpp
│ │ │ ├── MultiSampleRenderBuffer.h
│ │ │ ├── RenderBuffer.cpp
│ │ │ ├── RenderBuffer.h
│ │ │ ├── VertexArray.cpp
│ │ │ ├── VertexArray.h
│ │ │ ├── VertexBuffer.cpp
│ │ │ └── VertexBuffer.h
│ │ ├── glsl/
│ │ │ ├── BlinnPhong.frag
│ │ │ ├── BlinnPhong.vert
│ │ │ ├── Default.frag
│ │ │ ├── Default.vert
│ │ │ ├── HDR.frag
│ │ │ ├── HDR.vert
│ │ │ ├── PBR.frag
│ │ │ ├── PBR.vert
│ │ │ ├── Selection.frag
│ │ │ ├── Selection.vert
│ │ │ ├── SimpleDepth.frag
│ │ │ ├── SimpleDepth.vert
│ │ │ ├── SkyBox.frag
│ │ │ ├── SkyBox.vert
│ │ │ ├── TexturedQuad.frag
│ │ │ └── TexturedQuad.vert
│ │ └── shader/
│ │ ├── Shader.cpp
│ │ └── Shader.h
│ ├── ptr.h
│ ├── renderer/
│ │ ├── Camera.cpp
│ │ ├── Camera.h
│ │ ├── FPSCamera.cpp
│ │ ├── FPSCamera.h
│ │ ├── FrameCapturer.h
│ │ ├── MouseRayCasting.cpp
│ │ ├── MouseRayCasting.h
│ │ ├── Renderer.cpp
│ │ ├── Renderer.h
│ │ ├── SkyBox.cpp
│ │ ├── SkyBox.h
│ │ ├── TrackballCamera.cpp
│ │ └── TrackballCamera.h
│ ├── shapes/
│ │ ├── Cube.cpp
│ │ ├── Cube.h
│ │ ├── Shape.cpp
│ │ ├── Shape.h
│ │ ├── Sphere.cpp
│ │ └── Sphere.h
│ └── texture/
│ ├── ColorBufferTexture.cpp
│ ├── ColorBufferTexture.h
│ ├── CubeMapTexture.cpp
│ ├── CubeMapTexture.h
│ ├── DepthTexture.cpp
│ ├── DepthTexture.h
│ ├── MultiSampleTexture.cpp
│ ├── MultiSampleTexture.h
│ ├── Texture.cpp
│ ├── Texture.h
│ └── vendor/
│ └── stb_image.h
├── test/
│ ├── CMakeLists.txt
│ ├── testCube/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── src/
│ │ └── main.cpp
│ ├── testHDRI/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── src/
│ │ ├── ImguiStyles.h
│ │ └── main.cpp
│ ├── testImGuiGLFW/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ ├── imgui.ini
│ │ └── src/
│ │ ├── ImguiStyles.h
│ │ └── main.cpp
│ ├── testLighting/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── src/
│ │ └── main.cpp
│ ├── testModelPBR/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── src/
│ │ ├── ImguiStyles.h
│ │ └── main.cpp
│ ├── testPBR/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── src/
│ │ └── main.cpp
│ ├── testPointCloud/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── src/
│ │ ├── ImguiStyles.h
│ │ └── main.cpp
│ └── third_party/
│ └── imgui/
│ ├── .editorconfig
│ ├── .gitattributes
│ ├── .gitignore
│ ├── LICENSE.txt
│ ├── backends/
│ │ ├── imgui_impl_glfw.cpp
│ │ ├── imgui_impl_glfw.h
│ │ ├── imgui_impl_opengl3.cpp
│ │ ├── imgui_impl_opengl3.h
│ │ ├── imgui_impl_opengl3_loader.h
│ │ ├── imgui_impl_vulkan.cpp
│ │ ├── imgui_impl_vulkan.h
│ │ └── vulkan/
│ │ ├── generate_spv.sh
│ │ ├── glsl_shader.frag
│ │ └── glsl_shader.vert
│ ├── imconfig.h
│ ├── imgui.cpp
│ ├── imgui.h
│ ├── imgui_demo.cpp
│ ├── imgui_draw.cpp
│ ├── imgui_internal.h
│ ├── imgui_tables.cpp
│ ├── imgui_widgets.cpp
│ ├── imstb_rectpack.h
│ ├── imstb_textedit.h
│ ├── imstb_truetype.h
│ └── misc/
│ ├── README.txt
│ ├── cpp/
│ │ ├── README.txt
│ │ ├── imgui_stdlib.cpp
│ │ └── imgui_stdlib.h
│ ├── debuggers/
│ │ ├── README.txt
│ │ ├── imgui.gdb
│ │ ├── imgui.natstepfilter
│ │ └── imgui.natvis
│ ├── fonts/
│ │ └── binary_to_compressed_c.cpp
│ ├── freetype/
│ │ ├── README.md
│ │ ├── imgui_freetype.cpp
│ │ └── imgui_freetype.h
│ └── single_file/
│ └── imgui_single_file.h
└── third_party/
├── CMakeLists.txt
└── glm/
├── CMakeLists.txt
├── common.hpp
├── detail/
│ ├── _features.hpp
│ ├── _fixes.hpp
│ ├── _noise.hpp
│ ├── _swizzle.hpp
│ ├── _swizzle_func.hpp
│ ├── _vectorize.hpp
│ ├── compute_common.hpp
│ ├── compute_vector_relational.hpp
│ ├── func_common.inl
│ ├── func_common_simd.inl
│ ├── func_exponential.inl
│ ├── func_exponential_simd.inl
│ ├── func_geometric.inl
│ ├── func_geometric_simd.inl
│ ├── func_integer.inl
│ ├── func_integer_simd.inl
│ ├── func_matrix.inl
│ ├── func_matrix_simd.inl
│ ├── func_packing.inl
│ ├── func_packing_simd.inl
│ ├── func_trigonometric.inl
│ ├── func_trigonometric_simd.inl
│ ├── func_vector_relational.inl
│ ├── func_vector_relational_simd.inl
│ ├── glm.cpp
│ ├── qualifier.hpp
│ ├── setup.hpp
│ ├── type_float.hpp
│ ├── type_half.hpp
│ ├── type_half.inl
│ ├── type_mat2x2.hpp
│ ├── type_mat2x2.inl
│ ├── type_mat2x3.hpp
│ ├── type_mat2x3.inl
│ ├── type_mat2x4.hpp
│ ├── type_mat2x4.inl
│ ├── type_mat3x2.hpp
│ ├── type_mat3x2.inl
│ ├── type_mat3x3.hpp
│ ├── type_mat3x3.inl
│ ├── type_mat3x4.hpp
│ ├── type_mat3x4.inl
│ ├── type_mat4x2.hpp
│ ├── type_mat4x2.inl
│ ├── type_mat4x3.hpp
│ ├── type_mat4x3.inl
│ ├── type_mat4x4.hpp
│ ├── type_mat4x4.inl
│ ├── type_mat4x4_simd.inl
│ ├── type_quat.hpp
│ ├── type_quat.inl
│ ├── type_quat_simd.inl
│ ├── type_vec1.hpp
│ ├── type_vec1.inl
│ ├── type_vec2.hpp
│ ├── type_vec2.inl
│ ├── type_vec3.hpp
│ ├── type_vec3.inl
│ ├── type_vec4.hpp
│ ├── type_vec4.inl
│ └── type_vec4_simd.inl
├── exponential.hpp
├── ext/
│ ├── matrix_clip_space.hpp
│ ├── matrix_clip_space.inl
│ ├── matrix_common.hpp
│ ├── matrix_common.inl
│ ├── matrix_double2x2.hpp
│ ├── matrix_double2x2_precision.hpp
│ ├── matrix_double2x3.hpp
│ ├── matrix_double2x3_precision.hpp
│ ├── matrix_double2x4.hpp
│ ├── matrix_double2x4_precision.hpp
│ ├── matrix_double3x2.hpp
│ ├── matrix_double3x2_precision.hpp
│ ├── matrix_double3x3.hpp
│ ├── matrix_double3x3_precision.hpp
│ ├── matrix_double3x4.hpp
│ ├── matrix_double3x4_precision.hpp
│ ├── matrix_double4x2.hpp
│ ├── matrix_double4x2_precision.hpp
│ ├── matrix_double4x3.hpp
│ ├── matrix_double4x3_precision.hpp
│ ├── matrix_double4x4.hpp
│ ├── matrix_double4x4_precision.hpp
│ ├── matrix_float2x2.hpp
│ ├── matrix_float2x2_precision.hpp
│ ├── matrix_float2x3.hpp
│ ├── matrix_float2x3_precision.hpp
│ ├── matrix_float2x4.hpp
│ ├── matrix_float2x4_precision.hpp
│ ├── matrix_float3x2.hpp
│ ├── matrix_float3x2_precision.hpp
│ ├── matrix_float3x3.hpp
│ ├── matrix_float3x3_precision.hpp
│ ├── matrix_float3x4.hpp
│ ├── matrix_float3x4_precision.hpp
│ ├── matrix_float4x2.hpp
│ ├── matrix_float4x2_precision.hpp
│ ├── matrix_float4x3.hpp
│ ├── matrix_float4x3_precision.hpp
│ ├── matrix_float4x4.hpp
│ ├── matrix_float4x4_precision.hpp
│ ├── matrix_int2x2.hpp
│ ├── matrix_int2x2_sized.hpp
│ ├── matrix_int2x3.hpp
│ ├── matrix_int2x3_sized.hpp
│ ├── matrix_int2x4.hpp
│ ├── matrix_int2x4_sized.hpp
│ ├── matrix_int3x2.hpp
│ ├── matrix_int3x2_sized.hpp
│ ├── matrix_int3x3.hpp
│ ├── matrix_int3x3_sized.hpp
│ ├── matrix_int3x4.hpp
│ ├── matrix_int3x4_sized.hpp
│ ├── matrix_int4x2.hpp
│ ├── matrix_int4x2_sized.hpp
│ ├── matrix_int4x3.hpp
│ ├── matrix_int4x3_sized.hpp
│ ├── matrix_int4x4.hpp
│ ├── matrix_int4x4_sized.hpp
│ ├── matrix_projection.hpp
│ ├── matrix_projection.inl
│ ├── matrix_relational.hpp
│ ├── matrix_relational.inl
│ ├── matrix_transform.hpp
│ ├── matrix_transform.inl
│ ├── matrix_uint2x2.hpp
│ ├── matrix_uint2x2_sized.hpp
│ ├── matrix_uint2x3.hpp
│ ├── matrix_uint2x3_sized.hpp
│ ├── matrix_uint2x4.hpp
│ ├── matrix_uint2x4_sized.hpp
│ ├── matrix_uint3x2.hpp
│ ├── matrix_uint3x2_sized.hpp
│ ├── matrix_uint3x3.hpp
│ ├── matrix_uint3x3_sized.hpp
│ ├── matrix_uint3x4.hpp
│ ├── matrix_uint3x4_sized.hpp
│ ├── matrix_uint4x2.hpp
│ ├── matrix_uint4x2_sized.hpp
│ ├── matrix_uint4x3.hpp
│ ├── matrix_uint4x3_sized.hpp
│ ├── matrix_uint4x4.hpp
│ ├── matrix_uint4x4_sized.hpp
│ ├── quaternion_common.hpp
│ ├── quaternion_common.inl
│ ├── quaternion_common_simd.inl
│ ├── quaternion_double.hpp
│ ├── quaternion_double_precision.hpp
│ ├── quaternion_exponential.hpp
│ ├── quaternion_exponential.inl
│ ├── quaternion_float.hpp
│ ├── quaternion_float_precision.hpp
│ ├── quaternion_geometric.hpp
│ ├── quaternion_geometric.inl
│ ├── quaternion_relational.hpp
│ ├── quaternion_relational.inl
│ ├── quaternion_transform.hpp
│ ├── quaternion_transform.inl
│ ├── quaternion_trigonometric.hpp
│ ├── quaternion_trigonometric.inl
│ ├── scalar_common.hpp
│ ├── scalar_common.inl
│ ├── scalar_constants.hpp
│ ├── scalar_constants.inl
│ ├── scalar_int_sized.hpp
│ ├── scalar_integer.hpp
│ ├── scalar_integer.inl
│ ├── scalar_packing.hpp
│ ├── scalar_packing.inl
│ ├── scalar_relational.hpp
│ ├── scalar_relational.inl
│ ├── scalar_uint_sized.hpp
│ ├── scalar_ulp.hpp
│ ├── scalar_ulp.inl
│ ├── vector_bool1.hpp
│ ├── vector_bool1_precision.hpp
│ ├── vector_bool2.hpp
│ ├── vector_bool2_precision.hpp
│ ├── vector_bool3.hpp
│ ├── vector_bool3_precision.hpp
│ ├── vector_bool4.hpp
│ ├── vector_bool4_precision.hpp
│ ├── vector_common.hpp
│ ├── vector_common.inl
│ ├── vector_double1.hpp
│ ├── vector_double1_precision.hpp
│ ├── vector_double2.hpp
│ ├── vector_double2_precision.hpp
│ ├── vector_double3.hpp
│ ├── vector_double3_precision.hpp
│ ├── vector_double4.hpp
│ ├── vector_double4_precision.hpp
│ ├── vector_float1.hpp
│ ├── vector_float1_precision.hpp
│ ├── vector_float2.hpp
│ ├── vector_float2_precision.hpp
│ ├── vector_float3.hpp
│ ├── vector_float3_precision.hpp
│ ├── vector_float4.hpp
│ ├── vector_float4_precision.hpp
│ ├── vector_int1.hpp
│ ├── vector_int1_sized.hpp
│ ├── vector_int2.hpp
│ ├── vector_int2_sized.hpp
│ ├── vector_int3.hpp
│ ├── vector_int3_sized.hpp
│ ├── vector_int4.hpp
│ ├── vector_int4_sized.hpp
│ ├── vector_integer.hpp
│ ├── vector_integer.inl
│ ├── vector_packing.hpp
│ ├── vector_packing.inl
│ ├── vector_relational.hpp
│ ├── vector_relational.inl
│ ├── vector_uint1.hpp
│ ├── vector_uint1_sized.hpp
│ ├── vector_uint2.hpp
│ ├── vector_uint2_sized.hpp
│ ├── vector_uint3.hpp
│ ├── vector_uint3_sized.hpp
│ ├── vector_uint4.hpp
│ ├── vector_uint4_sized.hpp
│ ├── vector_ulp.hpp
│ └── vector_ulp.inl
├── ext.hpp
├── fwd.hpp
├── geometric.hpp
├── glm.hpp
├── gtc/
│ ├── bitfield.hpp
│ ├── bitfield.inl
│ ├── color_space.hpp
│ ├── color_space.inl
│ ├── constants.hpp
│ ├── constants.inl
│ ├── epsilon.hpp
│ ├── epsilon.inl
│ ├── integer.hpp
│ ├── integer.inl
│ ├── matrix_access.hpp
│ ├── matrix_access.inl
│ ├── matrix_integer.hpp
│ ├── matrix_inverse.hpp
│ ├── matrix_inverse.inl
│ ├── matrix_transform.hpp
│ ├── matrix_transform.inl
│ ├── noise.hpp
│ ├── noise.inl
│ ├── packing.hpp
│ ├── packing.inl
│ ├── quaternion.hpp
│ ├── quaternion.inl
│ ├── quaternion_simd.inl
│ ├── random.hpp
│ ├── random.inl
│ ├── reciprocal.hpp
│ ├── reciprocal.inl
│ ├── round.hpp
│ ├── round.inl
│ ├── type_aligned.hpp
│ ├── type_precision.hpp
│ ├── type_precision.inl
│ ├── type_ptr.hpp
│ ├── type_ptr.inl
│ ├── ulp.hpp
│ ├── ulp.inl
│ └── vec1.hpp
├── gtx/
│ ├── associated_min_max.hpp
│ ├── associated_min_max.inl
│ ├── bit.hpp
│ ├── bit.inl
│ ├── closest_point.hpp
│ ├── closest_point.inl
│ ├── color_encoding.hpp
│ ├── color_encoding.inl
│ ├── color_space.hpp
│ ├── color_space.inl
│ ├── color_space_YCoCg.hpp
│ ├── color_space_YCoCg.inl
│ ├── common.hpp
│ ├── common.inl
│ ├── compatibility.hpp
│ ├── compatibility.inl
│ ├── component_wise.hpp
│ ├── component_wise.inl
│ ├── dual_quaternion.hpp
│ ├── dual_quaternion.inl
│ ├── easing.hpp
│ ├── easing.inl
│ ├── euler_angles.hpp
│ ├── euler_angles.inl
│ ├── extend.hpp
│ ├── extend.inl
│ ├── extended_min_max.hpp
│ ├── extended_min_max.inl
│ ├── exterior_product.hpp
│ ├── exterior_product.inl
│ ├── fast_exponential.hpp
│ ├── fast_exponential.inl
│ ├── fast_square_root.hpp
│ ├── fast_square_root.inl
│ ├── fast_trigonometry.hpp
│ ├── fast_trigonometry.inl
│ ├── float_notmalize.inl
│ ├── functions.hpp
│ ├── functions.inl
│ ├── gradient_paint.hpp
│ ├── gradient_paint.inl
│ ├── handed_coordinate_space.hpp
│ ├── handed_coordinate_space.inl
│ ├── hash.hpp
│ ├── hash.inl
│ ├── integer.hpp
│ ├── integer.inl
│ ├── intersect.hpp
│ ├── intersect.inl
│ ├── io.hpp
│ ├── io.inl
│ ├── log_base.hpp
│ ├── log_base.inl
│ ├── matrix_cross_product.hpp
│ ├── matrix_cross_product.inl
│ ├── matrix_decompose.hpp
│ ├── matrix_decompose.inl
│ ├── matrix_factorisation.hpp
│ ├── matrix_factorisation.inl
│ ├── matrix_interpolation.hpp
│ ├── matrix_interpolation.inl
│ ├── matrix_major_storage.hpp
│ ├── matrix_major_storage.inl
│ ├── matrix_operation.hpp
│ ├── matrix_operation.inl
│ ├── matrix_query.hpp
│ ├── matrix_query.inl
│ ├── matrix_transform_2d.hpp
│ ├── matrix_transform_2d.inl
│ ├── mixed_product.hpp
│ ├── mixed_product.inl
│ ├── norm.hpp
│ ├── norm.inl
│ ├── normal.hpp
│ ├── normal.inl
│ ├── normalize_dot.hpp
│ ├── normalize_dot.inl
│ ├── number_precision.hpp
│ ├── number_precision.inl
│ ├── optimum_pow.hpp
│ ├── optimum_pow.inl
│ ├── orthonormalize.hpp
│ ├── orthonormalize.inl
│ ├── perpendicular.hpp
│ ├── perpendicular.inl
│ ├── polar_coordinates.hpp
│ ├── polar_coordinates.inl
│ ├── projection.hpp
│ ├── projection.inl
│ ├── quaternion.hpp
│ ├── quaternion.inl
│ ├── range.hpp
│ ├── raw_data.hpp
│ ├── raw_data.inl
│ ├── rotate_normalized_axis.hpp
│ ├── rotate_normalized_axis.inl
│ ├── rotate_vector.hpp
│ ├── rotate_vector.inl
│ ├── scalar_multiplication.hpp
│ ├── scalar_relational.hpp
│ ├── scalar_relational.inl
│ ├── spline.hpp
│ ├── spline.inl
│ ├── std_based_type.hpp
│ ├── std_based_type.inl
│ ├── string_cast.hpp
│ ├── string_cast.inl
│ ├── texture.hpp
│ ├── texture.inl
│ ├── transform.hpp
│ ├── transform.inl
│ ├── transform2.hpp
│ ├── transform2.inl
│ ├── type_aligned.hpp
│ ├── type_aligned.inl
│ ├── type_trait.hpp
│ ├── type_trait.inl
│ ├── vec_swizzle.hpp
│ ├── vector_angle.hpp
│ ├── vector_angle.inl
│ ├── vector_query.hpp
│ ├── vector_query.inl
│ ├── wrap.hpp
│ └── wrap.inl
├── integer.hpp
├── mat2x2.hpp
├── mat2x3.hpp
├── mat2x4.hpp
├── mat3x2.hpp
├── mat3x3.hpp
├── mat3x4.hpp
├── mat4x2.hpp
├── mat4x3.hpp
├── mat4x4.hpp
├── matrix.hpp
├── packing.hpp
├── simd/
│ ├── common.h
│ ├── exponential.h
│ ├── geometric.h
│ ├── integer.h
│ ├── matrix.h
│ ├── neon.h
│ ├── packing.h
│ ├── platform.h
│ ├── trigonometric.h
│ └── vector_relational.h
├── trigonometric.hpp
├── vec2.hpp
├── vec3.hpp
├── vec4.hpp
└── vector_relational.hpp
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Compilation folder
/build
# Visual Studio Code
.vscode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix
================================================
FILE: CMakeLists.txt
================================================
#[[
MIT License
Copyright (c) 2022 Alberto Morcillo Sanz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]
cmake_minimum_required(VERSION 3.10.0...3.22)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif()
# Project
project(RendererGL
VERSION 0.1
DESCRIPTION "OpenGL renderer"
HOMEPAGE_URL "https://github.com/MorcilloSanz/RendererGL"
LANGUAGES CXX)
message(STATUS "\n${PROJECT_NAME} ${RendererGL_VERSION}")
message(STATUS ${RendererGL_DESCRIPTION})
message(STATUS ${RendererGL_HOMEPAGE_URL})
set (CMAKE_CXX_STANDARD 17)
set(CMAKE_DEBUG_POSTFIX d)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
add_definitions(-DUNICODE)
# Libraries
find_package(GLEW REQUIRED)
find_package(assimp REQUIRED)
# third party
add_subdirectory(third_party)
include_directories(third_party)
# Add src
include_directories(src)
add_subdirectory(src)
# Copy shaders into build folder
set(SHADERS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/engine/opengl/glsl")
file(GLOB shaderFiles ${SHADERS_PATH}/*.frag ${SHADERS_PATH}/*.vert)
foreach(filename ${shaderFiles} )
file(COPY ${filename} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/glsl)
endforeach()
# Add tests
add_subdirectory(test)
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2022 Alberto Morcillo Sanz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# RendererGL
RendererGL is a basic 3D renderer written in C++ and OpenGL that allows working with 3D graphics without the need to know computer graphics or OpenGL. So that both beginners and more experienced programmers can create a 3D scene with lighting, shadows and materials.
> [!IMPORTANT]
This project is still under development
Take a look at some [screenshots](#screenshots). *3D assets are not included*
## Features
* **Trackball and first person shooter camera**
* **Anti aliasing (MSAA)**
* **Textures**
* **Load 3D models and textures from files**
* **Skybox (cubemap)**
* **FrameCapturer:** create a texture of the scene
* **Blinn-Phong lighting:** Ambient, Diffuse, Specular, Emission
* **Physically Based Rendering (PBR):** Albedo, Metallic, Normal, Roughness, Ambient Occlusion, Emission
* **Shadow Mapping:** percentage closer filtering
* **Normal Mapping**
* **Gamma correction**
* **HDR**
* **Mouse ray casting:** object selection
### Scene Graph
A [scene graph](https://en.wikipedia.org/wiki/Scene_graph) is a general data structure which arranges the logical and often spatial representation of a graphical scene. It is a collection of nodes in a graph or tree structure:
* **Polytope:** A set of vertices and indices (optional) that defines a shape
* **Group:** A set of polytopes. It also defines the primitive (triangles, quads...) which the polytopes inside of it will be drawn.
* **Model:** A group which contains a set of polytopes that are loaded from a file (*.obj*, *.dae*, *...*)
* **Scene:** Contains a set of groups, models and other scenes
* **Renderer:** Contains a set of scenes. It's the one who deals with all the graphics stuff
*Take a look at the example below*
## Example: rotating cube with lighting
```cpp
#include <iostream>
#include <vector>
#include <engine/renderer/Renderer.h>
#include <engine/renderer/TrackballCamera.h>
#include <engine/shapes/Cube.h>
#include <GLFW/glfw3.h>
const int WIDTH = 1280;
const int HEIGHT = 900;
GLFWwindow* window;
Renderer::Ptr renderer;
int main() {
// Create window
if (!glfwInit()) {
std::cout << "Couldn't initialize window" << std::endl;
return -1;
}
window = glfwCreateWindow(WIDTH, HEIGHT, "Cube example", NULL, NULL);
if (!window) glfwTerminate();
glfwMakeContextCurrent(window);
// Renderer
renderer = Renderer::New(WIDTH, HEIGHT);
renderer->enableLight();
// Camera
double aspectRatio = static_cast<double>(WIDTH) / HEIGHT;
TrackballCamera::Ptr camera = TrackballCamera::perspectiveCamera(glm::radians(45.0f), aspectRatio, 0.1, 1000);
renderer->setCamera(std::dynamic_pointer_cast<Camera>(camera));
camera->zoom(-2.5);
// Light
DirectionalLight light(glm::vec3(1));
light.setColor(glm::vec3(1));
renderer->addLight(light);
// Scene
Cube::Ptr cube = Cube::New();
Group::Ptr group = Group::New();
group->add(cube);
Scene::Ptr scene = Scene::New();
scene->addGroup(group);
renderer->addScene(scene);
// Main loop
while (!glfwWindowShouldClose(window)) {
// Update scene
cube->rotate(0.55, glm::vec3(1, 0, 1));
// Draw scene
renderer->clear();
renderer->draw();
// Update window
glfwSwapBuffers(window);
glfwPollEvents();
}
// Destroy window
glfwTerminate();
return 0;
}
```
**Custom mesh**
```cpp
std::vector<Vec3f> vertices { ... };
std::vector<unsigned int> indices { ... };
Polytope::Ptr mesh = Polytope::New(vertices, indices);
Group::Ptr group = Group::New();
group->add(mesh);
```
## Screenshots
**Lighting (Blinn-Phong), shadow mapping and emission**



**PBR Materials**

**Point Cloud**

[Gabriel archangel by greypixel geometrics](https://skfb.ly/6GvWu)
**360 image visualization example**

## Contribution
RendererGL is an open source project under the MIT licence. Feel free to fork it and contribute
## Compilation
`CMake` is required for compilation. Take a look at [compile.md](compile.md)
## Dependencies
* [GLEW](https://github.com/nigels-com/glew) for loading OpenGL extensions
* [GLM](https://github.com/g-truc/glm) for linear algebra stuff
* [ASSIMP](https://github.com/assimp/assimp) for loading 3D models from files (*.obj*, *.dae*, *...*)
* [STB](https://github.com/nothings/stb) for loading images from files (*.png*, *.tga*, *.jpg*, *...*)
Optional dependencies used in tests:
* [GLFW](https://github.com/glfw/glfw) for creating a window with an OpenGL context
* [ImGui](https://github.com/ocornut/imgui) for GUI
## References
Dealing with OpenGL was much easier thanks to:
* [Learn OpenGL](https://learnopengl.com/)
* [The Cherno](https://www.youtube.com/@TheCherno)
* [ThinMatrix](https://www.youtube.com/@ThinMatrix)
================================================
FILE: compile.md
================================================
# Compile
Create build folder
```
mkdir build (if not created)
cd build
```
Call cmake in order to generate Makefile
```
cmake ..
```
Compile
```
make
```
================================================
FILE: src/CMakeLists.txt
================================================
#[[
MIT License
Copyright (c) 2022 Alberto Morcillo Sanz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]
add_subdirectory(engine)
================================================
FILE: src/engine/CMakeLists.txt
================================================
#[[
MIT License
Copyright (c) 2022 Alberto Morcillo Sanz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]
project(RendererGL)
# Header Files
set(HEADERS
Vec3.h
ptr.h
opengl/buffer/Buffer.h
opengl/buffer/VertexArray.h
opengl/buffer/VertexBuffer.h
opengl/buffer/IndexBuffer.h
opengl/buffer/FrameBuffer.h
opengl/buffer/RenderBuffer.h
opengl/buffer/MultiSampleRenderBuffer.h
opengl/shader/Shader.h
group/Polytope.h
group/DynamicPolytope.h
group/Group.h
group/Scene.h
renderer/Renderer.h
renderer/FrameCapturer.h
renderer/Camera.h
renderer/TrackballCamera.h
renderer/FPSCamera.h
renderer/SkyBox.h
renderer/MouseRayCasting.h
lighting/Material.h
lighting/PhongMaterial.h
lighting/PBRMaterial.h
lighting/Light.h
lighting/DirectionalLight.h
lighting/PointLight.h
texture/vendor/stb_image.h
texture/Texture.h
texture/CubeMapTexture.h
texture/DepthTexture.h
texture/ColorBufferTexture.h
texture/MultiSampleTexture.h
model/Model.h
shapes/Shape.h
shapes/Cube.h
shapes/Sphere.h
)
# CPP files
set(SOURCES
opengl/buffer/VertexArray.cpp
opengl/buffer/VertexBuffer.cpp
opengl/buffer/IndexBuffer.cpp
opengl/buffer/FrameBuffer.cpp
opengl/buffer/RenderBuffer.cpp
opengl/buffer/MultiSampleRenderBuffer.cpp
opengl/shader/Shader.cpp
group/Polytope.cpp
group/DynamicPolytope.cpp
group/Group.cpp
group/Scene.cpp
renderer/Renderer.cpp
renderer/Camera.cpp
renderer/TrackballCamera.cpp
renderer/FPSCamera.cpp
renderer/SkyBox.cpp
renderer/MouseRayCasting.cpp
lighting/Light.cpp
lighting/DirectionalLight.cpp
lighting/PointLight.cpp
texture/Texture.cpp
texture/CubeMapTexture.cpp
texture/DepthTexture.cpp
texture/ColorBufferTexture.cpp
texture/MultiSampleTexture.cpp
model/Model.cpp
shapes/Shape.cpp
shapes/Cube.cpp
shapes/Sphere.cpp
)
# Compile files
add_library(${PROJECT_NAME} ${SOURCES} ${HEADERS})
# Link libraries
target_link_libraries(${PROJECT_NAME}
assimp
$<$<BOOL:${UNIX}>:GL>
$<$<BOOL:${UNIX}>:dl>
$<$<BOOL:${UNIX}>:X11>
GLEW::GLEW
)
================================================
FILE: src/engine/Vec3.h
================================================
#pragma once
template<typename T>
struct Vec3 {
T x, y, z;
T r, g, b;
T nx, ny, nz;
T tx, ty;
T tanx, tany, tanz;
T bitanx, bitany, bitanz;
bool hasTangents;
Vec3(T _x, T _y, T _z, float _r = 1, float _g = 1, float _b = 1)
: x(_x), y(_y), z(_z), r(_r), g(_g), b(_b), nx(0), ny(0), nz(0),
tx(0), ty(0), tanx(0), tany(0), tanz(0), bitanx(0), bitany(0), bitanz(0),
hasTangents(false) {
}
Vec3(T _x, T _y, T _z, float _r, float _g, float _b, T _nx, T _ny, T _nz)
: x(_x), y(_y), z(_z), r(_r), g(_g), b(_b), nx(_nx), ny(_ny), nz(_nz), tx(0), ty(0),
tanx(0), tany(0), tanz(0), bitanx(0), bitany(0), bitanz(0), hasTangents(false) {
}
Vec3(T _x, T _y, T _z, float _r, float _g, float _b, T _nx, T _ny, T _nz, T _tx, T _ty)
: x(_x), y(_y), z(_z), r(_r), g(_g), b(_b), nx(_nx), ny(_ny), nz(_nz), tx(_tx), ty(_ty),
tanx(0), tany(0), tanz(0), bitanx(0), bitany(0), bitanz(0), hasTangents(false) {
}
Vec3()
: x(0), y(0), z(0), r(1), g(1), b(1), nx(0), ny(0),
nz(0), tx(0), ty(0), hasTangents(false) {
}
~Vec3() = default;
inline double getModule() { return sqrt(x * x + y * y + z * z); }
inline double operator * (const Vec3& vec) { return vec.x * x + vec.y * y + vec.z * z; }
inline Vec3 operator ^ (const Vec3& vec) { return Vec3(y * vec.z - z * vec.y, -x * vec.z + z * vec.x, x * vec.y - y * vec.x); }
inline Vec3 operator + (const Vec3& vec) { return Vec3(vec.x + x, vec.y + y, vec.z + z); }
inline Vec3 operator - (const Vec3& vec) { return Vec3(vec.x - x, vec.y - y, vec.z - z); }
Vec3& operator * (T value) {
x *= value;
y *= value;
z *= value;
return *this;
}
Vec3 getUnit() {
double norm = getModule();
return Vec3(x / norm, y / norm, z / norm);
}
};
typedef Vec3<float> Vec3f;
typedef Vec3<int> Vec3i;
================================================
FILE: src/engine/group/DynamicPolytope.cpp
================================================
#include "DynamicPolytope.h"
DynamicPolytope::DynamicPolytope(size_t length)
: Polytope(length), pos(0) {
}
void DynamicPolytope::addVertex(const Vec3f& vertex) {
for(int i = pos; i < vertexLength; i ++) updateVertex(i, vertex);
pos ++;
}
================================================
FILE: src/engine/group/DynamicPolytope.h
================================================
#pragma once
#include "Polytope.h"
/*
TODO: Resize if needed
*/
class DynamicPolytope : public Polytope {
GENERATE_PTR(DynamicPolytope)
private:
size_t pos;
public:
DynamicPolytope() = default;
DynamicPolytope(size_t length);
public:
void addVertex(const Vec3f& vertex);
};
================================================
FILE: src/engine/group/Group.cpp
================================================
#include "Group.h"
unsigned long Group::groupCount = 0;
Group::Group(unsigned int _primitive, bool _showWire)
: primitive(_primitive), showWire(_showWire), modelMatrix(1.f), visible(true),
pointSize(POINT_SIZE), lineWidth(LINE_WIDTH), outliningWidth(OUTLINING_WIDTH),
id(groupCount) {
groupCount ++;
}
Group::Group()
: primitive(GL_TRIANGLES), showWire(false), modelMatrix(1.f), visible(true),
pointSize(POINT_SIZE), lineWidth(LINE_WIDTH), outliningWidth(OUTLINING_WIDTH),
id(groupCount) {
groupCount ++;
}
void Group::removePolytope(Polytope::Ptr& polytope) {
unsigned int index = 0;
for(auto& p : polytopes) {
if(p.get() == polytope.get()) {
removePolytope(index);
break;
}
index ++;
}
}
bool Group::isSelected() {
bool selected = true;
for(auto& p : polytopes) {
if(!p->isSelected()) selected = false;
}
return selected;
}
void Group::setSelected(bool selected) {
for(auto& p : polytopes) p->setSelected(selected);
}
================================================
FILE: src/engine/group/Group.h
================================================
#pragma once
#include <iostream>
#include <vector>
#include <memory>
#include "Polytope.h"
#include "DynamicPolytope.h"
#include "engine/ptr.h"
#define POINT_SIZE 1.0
#define LINE_WIDTH 1.0
#define OUTLINING_WIDTH 3.0
class Group {
GENERATE_PTR(Group)
private:
std::vector<Polytope::Ptr> polytopes;
unsigned int primitive;
float pointSize, lineWidth, outliningWidth;
bool showWire, visible;
glm::mat4 modelMatrix;
static unsigned long groupCount;
unsigned long id;
public:
Group(unsigned int _primitive, bool _showWire = false);
Group();
~Group() = default;
public:
void removePolytope(Polytope::Ptr& polytope);
bool isSelected();
void setSelected(bool selected);
public:
inline void translate(const glm::vec3& v) { modelMatrix = glm::translate(modelMatrix, v); }
inline void rotate(float degrees, const glm::vec3& axis) { modelMatrix = glm::rotate(modelMatrix, glm::radians(degrees), axis); }
inline void scale(const glm::vec3& s) { modelMatrix = glm::scale(modelMatrix, s); }
inline void add(const Polytope::Ptr& polytope) { polytopes.push_back(polytope); }
inline std::vector<Polytope::Ptr>& getPolytopes() { return polytopes; }
inline void removePolytope(int index) { polytopes.erase(polytopes.begin() + index); }
inline void setVisible(bool visible) { this->visible = visible; }
inline bool isVisible() const { return visible; }
inline void setShowWire(bool showWire) { this->showWire = showWire; }
inline bool isShowWire() const { return showWire; }
inline void setPrimitive(unsigned int primitive) { this->primitive = primitive; }
inline unsigned int getPrimitive() const { return primitive; }
inline void setModelMatrix(const glm::mat4& modelMatrix) { this->modelMatrix = modelMatrix; }
inline glm::mat4& getModelMatrix() { return modelMatrix; }
inline float getPointSize() const { return pointSize; }
inline float getLineWidth() const { return lineWidth; }
inline float getOutliningWidth() const { return outliningWidth; }
inline void setPointSize(float pointSize) { this->pointSize = pointSize; }
inline void setLineWidth(float lineWidth) { this->lineWidth = lineWidth; }
inline void setOutliningWidth(float outliningWidth) { this->outliningWidth = outliningWidth; }
inline unsigned long getID() const { return id; }
};
================================================
FILE: src/engine/group/Polytope.cpp
================================================
#include "Polytope.h"
#include <GL/glew.h>
Polytope::Polytope(size_t length)
: vertexLength(length), modelMatrix(1.f), indicesLength(0), selected(false),
faceCulling(FaceCulling::BACK), emissionStrength(1.0) {
initPolytope(length);
}
Polytope::Polytope(std::vector<Vec3f>& vertices, bool _tangentAndBitangents)
: vertexLength(vertices.size()), modelMatrix(1.f), indicesLength(0), selected(false),
faceCulling(FaceCulling::BACK), emissionStrength(1.0), tangentAndBitangents(_tangentAndBitangents) {
initPolytope(vertices);
}
Polytope::Polytope(std::vector<Vec3f>& vertices, std::vector<unsigned int>& indices, bool _tangentAndBitangents)
: vertexLength(vertices.size()), modelMatrix(1.f), indicesLength(indices.size()), selected(false),
faceCulling(FaceCulling::BACK), emissionStrength(1.0), tangentAndBitangents(_tangentAndBitangents) {
initPolytope(vertices, indices);
}
Polytope::Polytope(const Polytope& polytope)
: vertexArray(polytope.vertexArray), vertexBuffer(polytope.vertexBuffer), textures(polytope.textures),
vertexLength(polytope.vertexLength), indicesLength(polytope.indicesLength), material(polytope.material),
modelMatrix(polytope.modelMatrix), selected(polytope.selected), faceCulling(polytope.faceCulling),
emissionStrength(polytope.emissionStrength), tangentAndBitangents(polytope.tangentAndBitangents) {
}
Polytope::Polytope(Polytope&& polytope) noexcept
: vertexArray(std::move(polytope.vertexArray)), vertexBuffer(std::move(polytope.vertexBuffer)),
textures(std::move(polytope.textures)), vertexLength(polytope.vertexLength), indicesLength(polytope.indicesLength),
material(std::move(polytope.material)), modelMatrix(std::move(polytope.modelMatrix)), selected(polytope.selected),
faceCulling(polytope.faceCulling), emissionStrength(polytope.emissionStrength),
tangentAndBitangents(polytope.tangentAndBitangents) {
}
void Polytope::setTangentsAndBitangents(Vec3f& vertex0, Vec3f& vertex1, Vec3f& vertex2) {
glm::vec3 pos1(vertex0.x, vertex0.y, vertex0.z);
glm::vec3 pos2(vertex1.x, vertex1.y, vertex1.z);
glm::vec3 pos3(vertex2.x, vertex2.y, vertex2.z);
glm::vec2 uv1(vertex0.tx, vertex0.ty);
glm::vec2 uv2(vertex1.tx, vertex1.ty);
glm::vec2 uv3(vertex2.tx, vertex2.ty);
glm::vec3 edge1 = pos2 - pos1;
glm::vec3 edge2 = pos3 - pos1;
glm::vec2 deltaUV1 = uv2 - uv1;
glm::vec2 deltaUV2 = uv3 - uv1;
float f = 1.0f / (deltaUV1.x * deltaUV2.y - deltaUV2.x * deltaUV1.y);
vertex0.tanx = vertex1.tanx = vertex2.tanx = f * (deltaUV2.y * edge1.x - deltaUV1.y * edge2.x);
vertex0.tany = vertex1.tany = vertex2.tany = f * (deltaUV2.y * edge1.y - deltaUV1.y * edge2.y);
vertex0.tanz = vertex1.tanz = vertex2.tanz = f * (deltaUV2.y * edge1.z - deltaUV1.y * edge2.z);
vertex0.bitanx = vertex1.bitanx = vertex2.bitanx = f * (-deltaUV2.x * edge1.x + deltaUV1.x * edge2.x);
vertex0.bitany = vertex1.bitany = vertex2.bitany = f * (-deltaUV2.x * edge1.y + deltaUV1.x * edge2.y);
vertex0.bitanz = vertex1.bitanz = vertex2.bitanz = f * (-deltaUV2.x * edge1.z + deltaUV1.x * edge2.z);
}
void Polytope::calculateTangentsAndBitangents(std::vector<Vec3f>& vertices) {
if(!tangentAndBitangents) return;
for(int i = 0; i < vertices.size(); i += 3) {
Vec3f& vertex0 = vertices[i];
Vec3f& vertex1 = vertices[i + 1];
Vec3f& vertex2 = vertices[i + 2];
setTangentsAndBitangents(vertex0, vertex1, vertex2);
}
}
void Polytope::calculateTangentsAndBitangents(std::vector<Vec3f>& vertices, std::vector<unsigned int>& indices) {
if(!tangentAndBitangents) return;
for(int i = 0; i < indices.size(); i += 3) {
Vec3f& vertex0 = vertices[indices[i]];
Vec3f& vertex1 = vertices[indices[i + 1]];
Vec3f& vertex2 = vertices[indices[i + 2]];
setTangentsAndBitangents(vertex0, vertex1, vertex2);
}
}
void Polytope::initPolytope(size_t length) {
vertexArray = VertexArray::New();
vertexBuffer = VertexBuffer::New(length);
material = PhongMaterial::New(MATERIAL_DIFFUSE, MATERIAL_SPECULAR, MATERIAL_SHININESS);
unbind();
}
void Polytope::initPolytope(std::vector<Vec3f>& vertices) {
calculateTangentsAndBitangents(vertices);
vertexArray = VertexArray::New();
vertexBuffer = VertexBuffer::New(vertices);
material = PhongMaterial::New(MATERIAL_DIFFUSE, MATERIAL_SPECULAR, MATERIAL_SHININESS);
unbind();
}
void Polytope::initPolytope(std::vector<Vec3f>& vertices, std::vector<unsigned int>& indices) {
calculateTangentsAndBitangents(vertices, indices);
vertexArray = VertexArray::New();
vertexBuffer = VertexBuffer::New(vertices, indices);
material = PhongMaterial::New(MATERIAL_DIFFUSE, MATERIAL_SPECULAR, MATERIAL_SHININESS);
unbind();
}
void Polytope::bind() {
if(vertexArray != nullptr && vertexBuffer != nullptr)
vertexArray->bind();
}
void Polytope::unbind() {
if(vertexArray != nullptr && vertexBuffer != nullptr)
vertexArray->unbind();
}
void Polytope::updateVertices(std::vector<Vec3f>& vertices) {
if(vertexBuffer != nullptr) {
vertexBuffer->updateVertices(vertices);
vertexLength = vertices.size();
}
}
void Polytope::updateVertex(int pos, Vec3f newVertex) {
if(vertexBuffer != nullptr)
vertexBuffer->updateVertex(pos, newVertex);
}
void Polytope::updateIndices(std::vector<unsigned int>& indices) {
if(vertexBuffer != nullptr && vertexBuffer->getIndexBuffer() != nullptr) {
vertexBuffer->getIndexBuffer()->updateIndices(indices);
indicesLength = indices.size();
}
}
void Polytope::removeTexture(const Texture::Ptr& texture) {
unsigned int index = 0;
for(auto& t : textures) {
if(t.get() == texture.get()) {
removeTexture(index);
break;
}
index ++;
}
}
void Polytope::draw(unsigned int primitive, bool showWire) {
bind();
if(!showWire) glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
else glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
if(!vertexBuffer->HasIndexBuffer()) glDrawArrays(primitive, 0, vertexLength);
else glDrawElements(primitive, indicesLength, GL_UNSIGNED_INT, 0);
unbind();
}
================================================
FILE: src/engine/group/Polytope.h
================================================
#pragma once
#include <iostream>
#include <vector>
#include <memory>
#include <glm/vec3.hpp>
#include <glm/vec4.hpp>
#include <glm/mat4x4.hpp>
#include <glm/gtc/type_ptr.hpp>
#include "engine/opengl/buffer/VertexArray.h"
#include "engine/opengl/buffer/VertexBuffer.h"
#include "engine/lighting/Material.h"
#include "engine/lighting/PhongMaterial.h"
#include "engine/texture/Texture.h"
#include "engine/ptr.h"
#define MATERIAL_DIFFUSE glm::vec3(1.0f)
#define MATERIAL_SPECULAR glm::vec3(1.0f)
#define MATERIAL_SHININESS 64.f
class Polytope {
GENERATE_PTR(Polytope)
public:
enum class FaceCulling {
NONE, FRONT, BACK
};
protected:
VertexArray::Ptr vertexArray;
VertexBuffer::Ptr vertexBuffer;
std::vector<Texture::Ptr> textures;
unsigned int vertexLength, indicesLength;
Material::Ptr material;
glm::mat4 modelMatrix;
bool selected;
FaceCulling faceCulling;
float emissionStrength;
bool tangentAndBitangents;
public:
Polytope(size_t length);
Polytope(std::vector<Vec3f>& vertices, bool _tangentAndBitangents = true);
Polytope(std::vector<Vec3f>& vertices, std::vector<unsigned int>& indices, bool _tangentAndBitangents = true);
Polytope(const Polytope& polytope);
Polytope(Polytope&& polytope) noexcept;
Polytope() = default;
virtual ~Polytope() = default;
protected:
void setTangentsAndBitangents(Vec3f& vertex0, Vec3f& vertex1, Vec3f& vertex2);
void calculateTangentsAndBitangents(std::vector<Vec3f>& vertices);
void calculateTangentsAndBitangents(std::vector<Vec3f>& vertices, std::vector<unsigned int>& indices);
public:
void initPolytope(size_t length);
void initPolytope(std::vector<Vec3f>& vertices);
void initPolytope(std::vector<Vec3f>& vertices, std::vector<unsigned int>& indices);
void bind();
void unbind();
void updateVertices(std::vector<Vec3f>& vertices);
void updateVertex(int pos, Vec3f newVertex);
void updateIndices(std::vector<unsigned int>& indices);
void removeTexture(const Texture::Ptr& texture);
void draw(unsigned int primitive, bool showWire = false);
public:
inline void translate(const glm::vec3& v) { modelMatrix = glm::translate(modelMatrix, v); }
inline void rotate(float degrees, const glm::vec3& axis) { modelMatrix = glm::rotate(modelMatrix, glm::radians(degrees), axis); }
inline void scale(const glm::vec3& s) { modelMatrix = glm::scale(modelMatrix, s); }
inline VertexArray::Ptr& getVertexArray() { return vertexArray; }
inline VertexBuffer::Ptr& getVertexBuffer() { return vertexBuffer; }
inline IndexBuffer::Ptr& getIndexBuffer() { return vertexBuffer->getIndexBuffer(); }
inline void addTexture(const Texture::Ptr& texture) { textures.push_back(texture); }
inline void removeTexture(int index) { textures.erase(textures.begin() + index); }
inline std::vector<Texture::Ptr>& getTextures() { return textures; }
inline unsigned int getVertexLength() const { return vertexLength; }
inline void setModelMatrix(const glm::mat4& modelMatrix) { this->modelMatrix = modelMatrix; }
inline glm::mat4& getModelMatrix() { return modelMatrix; }
inline void setVetexArray(const VertexArray::Ptr& vertexArray) { this->vertexArray = vertexArray; }
inline void setVertexBuffer(const VertexBuffer::Ptr& vertexBuffer) { this->vertexBuffer = vertexBuffer; }
inline void setVertexLength(unsigned int vertexLength) { this->vertexLength = vertexLength; }
inline void setMaterial(const Material::Ptr& material) { this->material = material; }
inline Material::Ptr& getMaterial() { return material; }
inline std::vector<Vec3f> getVertices() { return vertexBuffer->getVertices(); }
inline std::vector<unsigned int> getIndices() { return vertexBuffer->getIndexBuffer()->getIndices(); }
inline bool isSelected() const { return selected; }
inline void setSelected(bool selected) { this->selected = selected; }
inline void setFaceCulling(const FaceCulling& faceCulling) { this->faceCulling = faceCulling; }
inline FaceCulling& getFaceCulling() { return faceCulling; }
inline void setEmissionStrength(float emissionStrength) { this->emissionStrength = emissionStrength; }
float getEmissionStrength() const { return emissionStrength; }
};
================================================
FILE: src/engine/group/Scene.cpp
================================================
#include "Scene.h"
Scene::Scene()
: modelMatrix(1.f), visible(true) {
}
void Scene::removeGroup(Group::Ptr& group) {
unsigned int index = 0;
for(auto& g : groups) {
if(g.get() == group.get()) {
removeGroup(index);
break;
}
index ++;
}
}
void Scene::removeScene(Scene::Ptr& scene) {
unsigned int index = 0;
for(auto& s : scenes) {
if(s.get() == scene.get()) {
removeScene(index);
break;
}
index ++;
}
}
void Scene::addModel(Model::Ptr& model) {
Group* group = dynamic_cast<Group*>(model.get());
Group::Ptr groupPtr = Group::New(*group);
groups.push_back(groupPtr);
}
void Scene::removeModel(Model::Ptr& model) {
Group* group = dynamic_cast<Group*>(model.get());
int index = 0;
for(auto& g : groups) {
if(g->getID() == group->getID()) {
removeGroup(index);
break;
}
index ++;
}
}
void Scene::translate(const glm::vec3& v) {
modelMatrix = glm::translate(modelMatrix, v);
for(auto& childScene : scenes) childScene->translate(v);
}
void Scene::rotate(float degrees, const glm::vec3& axis) {
modelMatrix = glm::rotate(modelMatrix, glm::radians(degrees), axis);
for(auto& childScene : scenes) childScene->rotate(degrees, axis);
}
void Scene::scale(const glm::vec3& s) {
modelMatrix = glm::scale(modelMatrix, s);
for(auto& childScene : scenes) childScene->scale(s);
}
================================================
FILE: src/engine/group/Scene.h
================================================
#pragma once
#include "Group.h"
#include "engine/model/Model.h"
#include "engine/ptr.h"
class Scene {
GENERATE_PTR(Scene)
private:
std::vector<Group::Ptr> groups;
std::vector<Scene::Ptr> scenes;
glm::mat4 modelMatrix;
bool visible;
public:
Scene();
~Scene() = default;
public:
void removeGroup(Group::Ptr& group);
void removeScene(Scene::Ptr& scene);
void addModel(Model::Ptr& model);
void removeModel(Model::Ptr& model);
void translate(const glm::vec3& v);
void rotate(float degrees, const glm::vec3& axis);
void scale(const glm::vec3& s);
public:
inline void addGroup(Group::Ptr& group) { groups.push_back(group); }
inline void addScene(Scene::Ptr& scene) { scenes.push_back(scene); }
inline void removeGroup(int index) { groups.erase(groups.begin() + index); }
inline void removeScene(int index) { scenes.erase(scenes.begin() + index); }
inline std::vector<Group::Ptr>& getGroups() { return groups; }
inline std::vector<Scene::Ptr>& getScenes() { return scenes; }
inline void setModelMatrix(const glm::mat4& modelMatrix) { this->modelMatrix = modelMatrix; }
inline glm::mat4& getModelMatrix() { return modelMatrix; }
inline void setVisible(bool visible) { this->visible = visible; }
inline bool isVisible() const { return visible; }
};
================================================
FILE: src/engine/lighting/DirectionalLight.cpp
================================================
#include "DirectionalLight.h"
DirectionalLight::DirectionalLight(const glm::vec3& direction)
: Light(direction) {
}
DirectionalLight::DirectionalLight(const glm::vec3& direction, const glm::vec3& color)
: Light(direction, color) {
}
void DirectionalLight::setDirection(const glm::vec3& direction) {
this->direction = direction;
position = direction;
}
================================================
FILE: src/engine/lighting/DirectionalLight.h
================================================
#pragma once
#include "Light.h"
// Its the same as Light, but replacing position by direction. JUST NOTATION
class DirectionalLight : public Light {
GENERATE_PTR(DirectionalLight)
private:
glm::vec3 direction;
public:
DirectionalLight(const glm::vec3& direction);
DirectionalLight(const glm::vec3& direction, const glm::vec3& color);
DirectionalLight() = default;
virtual ~DirectionalLight() = default;
public:
void setDirection(const glm::vec3& direction);
public:
inline glm::vec3& getDirection() { return direction; }
};
================================================
FILE: src/engine/lighting/Light.cpp
================================================
#include "Light.h"
#include <GL/glew.h>
bool Light::blinn = true;
Light::Light(const glm::vec3& position)
: Light(position, glm::vec3(1, 1, 1)) {
}
Light::Light(const glm::vec3& _position, const glm::vec3& _color)
: position(_position), color(_color), ambient(glm::vec3(AMBIENT_STRENGTH)),
diffuse(glm::vec3(DIFFUSE_STRENGTH)), specular(glm::vec3(SPECULAR_STRENGTH)),
intensity(1.0f) {
}
================================================
FILE: src/engine/lighting/Light.h
================================================
#pragma once
#include <iostream>
#include <memory>
#include <glm/vec3.hpp>
#include <glm/vec4.hpp>
#include <glm/mat4x4.hpp>
#include <glm/gtc/type_ptr.hpp>
#include "engine/opengl/shader/Shader.h"
#include "engine/ptr.h"
#define AMBIENT_STRENGTH 0.5f
#define DIFFUSE_STRENGTH 0.5f
#define SPECULAR_STRENGTH 0.5f
class Light {
GENERATE_PTR(Light)
protected:
glm::vec3 position;
glm::vec3 color;
glm::vec3 ambient, diffuse, specular;
float intensity;
public:
static bool blinn;
public:
Light(const glm::vec3& position);
Light(const glm::vec3& _position, const glm::vec3& _color);
Light() = default;
virtual ~Light() = default;
public:
inline void setPosition(const glm::vec3& position) { this->position = position; }
inline glm::vec3& getPosition() { return position; }
inline void setColor(const glm::vec3& color) { this->color = color; }
inline glm::vec3& getColor() { return color; }
inline void setAmbient(const glm::vec3& ambient) { this->ambient = ambient; }
inline glm::vec3& getAmbient() { return ambient; }
inline void setDiffuse(const glm::vec3& diffuse) { this->diffuse = diffuse; }
inline glm::vec3& getDiffuse() { return diffuse; }
inline void setSpecular(const glm::vec3& specular) { this->specular = specular; }
inline glm::vec3& getSpecular() { return specular; }
inline void setIntensity(float intensity) { this->intensity = intensity; }
inline float getIntensity() const { return intensity; }
};
================================================
FILE: src/engine/lighting/Material.h
================================================
#pragma once
#include <glm/vec3.hpp>
#include <glm/vec4.hpp>
#include <glm/mat4x4.hpp>
#include <glm/gtc/type_ptr.hpp>
#include "engine/ptr.h"
class Material {
GENERATE_PTR(Material)
public:
enum class MaterialType {
None, Phong, PBR
};
protected:
MaterialType materialType;
public:
Material(MaterialType _materialType)
: materialType(_materialType) {
}
Material(const Material& material)
: materialType(material.materialType) {
}
Material(Material&& material) noexcept
: materialType(material.materialType) {
}
Material() = default;
virtual ~Material() = default;
public:
inline MaterialType& getMaterialType() { return materialType; }
};
================================================
FILE: src/engine/lighting/PBRMaterial.h
================================================
#pragma once
#include "Material.h"
class PBRMaterial : public Material {
GENERATE_PTR(PBRMaterial)
private:
glm::vec3 albedo;
float metallic;
float roughness;
float ao;
public:
PBRMaterial(const glm::vec3& _albedo, float _metallic, float _roughness, float _ao)
: Material(Material::MaterialType::PBR), albedo(_albedo), metallic(_metallic),
roughness(_roughness), ao(_ao) {
}
PBRMaterial()
: Material(Material::MaterialType::PBR) {
}
~PBRMaterial() = default;
public:
inline void setAlbedo(const glm::vec3& albedo) { this->albedo = albedo; }
inline glm::vec3& getAlbedo() { return albedo; }
inline void setMetallic(float metallic) { this->metallic = metallic; }
inline float getMetallic() const { return metallic; }
inline void setRoughness(float roughness) { this->roughness = roughness; }
inline float getRoughness() const { return roughness; }
inline void setAmbientOcclusion(float ao) { this->ao = ao; }
inline float getAmbientOcclusion() const { return ao; }
};
================================================
FILE: src/engine/lighting/PhongMaterial.h
================================================
#pragma once
#include "Material.h"
class PhongMaterial : public Material {
GENERATE_PTR(PhongMaterial)
private:
glm::vec3 diffuse, specular;
float shininess;
public:
PhongMaterial(const glm::vec3& _diffuse, const glm::vec3& _specular, float _shininess)
: Material(Material::MaterialType::Phong), diffuse(_diffuse), specular(_specular),
shininess(_shininess) {
}
PhongMaterial() = default;
~PhongMaterial() = default;
public:
inline void setDiffuse(const glm::vec3& diffuse) { this->diffuse = diffuse; }
inline glm::vec3& getDiffuse() { return diffuse; }
inline void setSpecular(const glm::vec3& specular) { this->specular = specular; }
inline glm::vec3& getSpecular() { return specular; }
/**
* @brief shininess: 2, 4, 8, 16, 32, 64, ..., 256
*
* @param shininess
*/
inline void setShininess(const float shininess) { this->shininess = shininess; }
inline float getShininess() const { return shininess; }
};
================================================
FILE: src/engine/lighting/PointLight.cpp
================================================
#include "PointLight.h"
PointLight::PointLight(const glm::vec3& position)
: PointLight(position, glm::vec3(1)) {
}
PointLight::PointLight(const glm::vec3& position, const glm::vec3& color)
: PointLight(position, color, CONSTANT, LINEAR, QUADRATIC) {
}
PointLight::PointLight(const glm::vec3& position, const glm::vec3& color, float _constant, float _linear, float _quadratic)
: Light(position, color), constant(_constant), linear(_linear), quadratic(_quadratic) {
}
================================================
FILE: src/engine/lighting/PointLight.h
================================================
#pragma once
#include "Light.h"
#define CONSTANT 1.0f
#define LINEAR 0.09f
#define QUADRATIC 0.032f
class PointLight : public Light {
GENERATE_PTR(PointLight)
private:
float constant;
float linear;
float quadratic;
public:
PointLight(const glm::vec3& position);
PointLight(const glm::vec3& position, const glm::vec3& color);
PointLight(const glm::vec3& position, const glm::vec3& color, float _constant, float _linear, float _quadratic);
PointLight() = default;
virtual ~PointLight() = default;
public:
inline void setConstant(float constant) { this->constant = constant; }
inline float getConstant() const { return constant; }
inline void setLinear(float linear) { this->linear = linear; }
inline float getLinear() const { return linear; }
inline void setQuadratic(float quadratic) { this->quadratic = quadratic; }
inline float getQuadratic() const { return quadratic; }
};
================================================
FILE: src/engine/model/Model.cpp
================================================
#include "Model.h"
Model::Model(const std::string& _path, bool _pbr)
: path(_path), pbr(_pbr) {
loadModel();
}
void Model::loadModel() {
// read file via ASSIMP
Assimp::Importer importer;
const aiScene* scene = importer.ReadFile(path, aiProcess_Triangulate | aiProcess_GenSmoothNormals | aiProcess_FlipUVs | aiProcess_CalcTangentSpace);
// check for errors
if(!scene || scene->mFlags & AI_SCENE_FLAGS_INCOMPLETE || !scene->mRootNode) {
std::cout << "ERROR::ASSIMP:: " << importer.GetErrorString() << std::endl;
return;
}
// retrieve the directory path of the filepath
directory = path.substr(0, path.find_last_of('/'));
// process ASSIMP's root node recursively
processNode(scene->mRootNode, scene);
}
void Model::processNode(aiNode *node, const aiScene *scene) {
// process each mesh located at the current nodeDynamicPolytope::New
for(unsigned int i = 0; i < node->mNumMeshes; i++) {
// the node object only contains indices to index the actual objects in the scene.
// the scene contains all the data, node is just to keep stuff organized (like relations between nodes).
aiMesh* mesh = scene->mMeshes[node->mMeshes[i]];
Polytope::Ptr polytope = processMesh(mesh, scene); // may be freed?
add(polytope);
}
// after we've processed all of the meshes (if any) we then recursively process each of the children nodes
for(unsigned int i = 0; i < node->mNumChildren; i++) processNode(node->mChildren[i], scene);
}
Polytope::Ptr Model::processMesh(aiMesh *mesh, const aiScene *scene) {
// data to fill
std::vector<Vec3f> vertices;
std::vector<unsigned int> indices;
std::vector<Texture::Ptr> textures;
// walk through each of the mesh's vertices
for(unsigned int i = 0; i < mesh->mNumVertices; i++) {
Vec3f vertex;
glm::vec3 vector; // we declare a placeholder vector since assimp uses its own vector class that doesn't directly convert to glm's vec3 class so we transfer the data to this placeholder glm::vec3 first.
// positions
vertex.x = vector.x = mesh->mVertices[i].x;
vertex.y = vector.y = mesh->mVertices[i].y;
vertex.z = vector.z = mesh->mVertices[i].z;
vertex.r = vertex.g = vertex.b = 1.0f;
// normals
if (mesh->HasNormals()) {
vertex.nx = vector.x = mesh->mNormals[i].x;
vertex.ny = vector.y = mesh->mNormals[i].y;
vertex.nz = vector.z = mesh->mNormals[i].z;
}
// texture coordinates
if(mesh->mTextureCoords[0]) {
glm::vec2 vec;
// a vertex can contain up to 8 different texture coordinates. We thus make the assumption that we won't
// use models where a vertex can have multiple texture coordinates so we always take the first set (0).
vertex.tx = vec.x = mesh->mTextureCoords[0][i].x;
vertex.ty = vec.y = mesh->mTextureCoords[0][i].y;
// tangent
vertex.tanx = vector.x = mesh->mTangents[i].x;
vertex.tany = vector.y = mesh->mTangents[i].y;
vertex.tanz = vector.z = mesh->mTangents[i].z;
// bitangent
vertex.bitanx = vector.x = mesh->mBitangents[i].x;
vertex.bitany = vector.y = mesh->mBitangents[i].y;
vertex.bitanz = vector.z = mesh->mBitangents[i].z;
vertex.hasTangents = true;
}
else vertex.tx = vertex.ty = 0.0f;
vertices.push_back(vertex);
}
// now wak through each of the mesh's faces (a face is a mesh its triangle) and retrieve the corresponding vertex indices.
for(unsigned int i = 0; i < mesh->mNumFaces; i++) {
aiFace face = mesh->mFaces[i];
// retrieve all indices of the face and store them in the indices vector
for(unsigned int j = 0; j < face.mNumIndices; j++) indices.push_back(face.mIndices[j]);
}
// process materials
aiMaterial* material = scene->mMaterials[mesh->mMaterialIndex];
// Blinn-Phong materials
if(!pbr) {
std::vector<Texture::Ptr> diffuseMaps = loadMaterialTextures(material, aiTextureType_DIFFUSE, "texture_diffuse");
textures.insert(textures.end(), diffuseMaps.begin(), diffuseMaps.end());
std::vector<Texture::Ptr> specularMaps = loadMaterialTextures(material, aiTextureType_SPECULAR, "texture_specular");
textures.insert(textures.end(), specularMaps.begin(), specularMaps.end());
std::vector<Texture::Ptr> normalMaps = loadMaterialTextures(material, aiTextureType_HEIGHT, "texture_normal");
textures.insert(textures.end(), normalMaps.begin(), normalMaps.end());
std::vector<Texture::Ptr> heightMaps = loadMaterialTextures(material, aiTextureType_AMBIENT, "texture_height");
textures.insert(textures.end(), heightMaps.begin(), heightMaps.end());
}
// PBR materials
else {
std::vector<Texture::Ptr> pbrAlbedoMaps = loadMaterialTextures(material, aiTextureType_BASE_COLOR, "pbr_texture_albedo");
textures.insert(textures.end(), pbrAlbedoMaps.begin(), pbrAlbedoMaps.end());
std::vector<Texture::Ptr> pbrMetalnessMaps = loadMaterialTextures(material, aiTextureType_METALNESS, "pbr_texture_metallic");
textures.insert(textures.end(), pbrMetalnessMaps.begin(), pbrMetalnessMaps.end());
std::vector<Texture::Ptr> normalMaps = loadMaterialTextures(material, aiTextureType_NORMALS, "pbr_texture_normal");
textures.insert(textures.end(), normalMaps.begin(), normalMaps.end());
std::vector<Texture::Ptr> pbrEmissionMaps = loadMaterialTextures(material, aiTextureType_EMISSION_COLOR, "pbr_texture_emission");
textures.insert(textures.end(), pbrEmissionMaps.begin(), pbrEmissionMaps.end());
std::vector<Texture::Ptr> pbrRoughnessMaps = loadMaterialTextures(material, aiTextureType_DIFFUSE_ROUGHNESS, "pbr_texture_roughness");
textures.insert(textures.end(), pbrRoughnessMaps.begin(), pbrRoughnessMaps.end());
std::vector<Texture::Ptr> pbrAmbientOcclusion = loadMaterialTextures(material, aiTextureType_AMBIENT_OCCLUSION, "pbr_texture_ao");
textures.insert(textures.end(), pbrAmbientOcclusion.begin(), pbrAmbientOcclusion.end());
}
// Test
auto test = [&](const std::string& name, aiTextureType type) {
aiMaterial* mat = scene->mMaterials[mesh->mMaterialIndex];
for(unsigned int i = 0; i < mat->GetTextureCount(type); i++) {
aiString str;
mat->GetTexture(type, i, &str);
std::string texturePath = directory + "/" + str.C_Str();
std::cout << "Type: " << name << " at: " << texturePath << std::endl;
}
};
/*
test("none", aiTextureType_NONE);
test("diffuse", aiTextureType_DIFFUSE);
test("specular", aiTextureType_SPECULAR);
test("ambient", aiTextureType_AMBIENT);
test("emissive", aiTextureType_EMISSIVE);
test("height", aiTextureType_HEIGHT);
test("normals", aiTextureType_NORMALS);
test("shininess", aiTextureType_SHININESS);
test("opacity", aiTextureType_OPACITY);
test("displacement", aiTextureType_DISPLACEMENT);
test("lightmap", aiTextureType_LIGHTMAP);
test("reflection", aiTextureType_REFLECTION);
test("base color", aiTextureType_BASE_COLOR);
test("normal camera", aiTextureType_NORMAL_CAMERA);
test("emission color", aiTextureType_EMISSION_COLOR);
test("metalness", aiTextureType_METALNESS);
test("diffuse roughness", aiTextureType_DIFFUSE_ROUGHNESS);
test("ambient occlusion", aiTextureType_AMBIENT_OCCLUSION);
test("unknown", aiTextureType_UNKNOWN);
*/
// return a mesh object created from the extracted mesh data
Polytope::Ptr polytope = Polytope::New(vertices, indices, false);
for(auto& texture : textures) polytope->addTexture(texture);
return polytope;
}
std::vector<Texture::Ptr> Model::loadMaterialTextures(aiMaterial *mat, aiTextureType type, const std::string& typeName) {
std::vector<Texture::Ptr> textures;
for(unsigned int i = 0; i < mat->GetTextureCount(type); i++) {
aiString str;
mat->GetTexture(type, i, &str);
std::string texturePath = directory + "/" + str.C_Str();
Texture::Ptr texture = Texture::New(texturePath, Texture::Type::None, false);
// Phong lighting
if(!pbr) {
if(typeName == "texture_ambient") texture->setType(Texture::Type::TextureAmbient);
else if(typeName == "texture_diffuse") texture->setType(Texture::Type::TextureDiffuse);
else if(typeName == "texture_specular") texture->setType(Texture::Type::TextureSpecular);
else if(typeName == "texture_height") texture->setType(Texture::Type::TextureHeight);
else if(typeName == "texture_normal") texture->setType(Texture::Type::TextureNormal);
}
// PBR
else {
if(typeName == "pbr_texture_albedo") texture->setType(Texture::Type::TextureAlbedo);
else if(typeName == "pbr_texture_metallic") texture->setType(Texture::Type::TextureMetallic);
else if(typeName == "pbr_texture_normal") texture->setType(Texture::Type::TextureNormal);
else if(typeName == "pbr_texture_roughness") texture->setType(Texture::Type::TextureRoughness);
else if(typeName == "pbr_texture_ao") texture->setType(Texture::Type::TextureAmbientOcclusion);
else if(typeName == "pbr_texture_emission") texture->setType(Texture::Type::TextureEmission);
}
bool contained = false;
for(auto& tex : textures) {
if(tex->getPath() == texture->getPath()) {
contained = true;
break;
}
}
if(!contained) textures.push_back(texture);
}
return textures;
}
================================================
FILE: src/engine/model/Model.h
================================================
#pragma once
#include <iostream>
#include <vector>
#include <memory>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include "engine/group/Group.h"
#include "engine/texture/Texture.h"
#include "engine/lighting/Material.h"
#include "engine/ptr.h"
class Model : public Group {
GENERATE_PTR(Model)
private:
std::string directory, path;
std::vector<Texture::Ptr> texturesLoaded;
bool pbr;
public:
Model(const std::string& _path, bool _pbr = false);
Model() = default;
private:
void loadModel();
void processNode(aiNode *node, const aiScene *scene);
Polytope::Ptr processMesh(aiMesh *mesh, const aiScene *scene);
std::vector<Texture::Ptr> loadMaterialTextures(aiMaterial *mat, aiTextureType type, const std::string& typeName);
public:
inline bool isPBR() const { return pbr; }
};
================================================
FILE: src/engine/opengl/buffer/Buffer.h
================================================
#pragma once
#include <GL/glew.h>
#include "engine/ptr.h"
class Buffer {
protected:
unsigned int id;
virtual void initBuffer() = 0;
public:
Buffer() : id(0) {}
virtual ~Buffer() = default;
public:
virtual void bind() = 0;
virtual void unbind() = 0;
public:
inline unsigned int getID() const { return id; }
};
================================================
FILE: src/engine/opengl/buffer/FrameBuffer.cpp
================================================
#include "FrameBuffer.h"
FrameBuffer::FrameBuffer()
: Buffer() {
initBuffer();
}
FrameBuffer::~FrameBuffer() {
unbind();
glDeleteFramebuffers(1, &id);
}
void FrameBuffer::initBuffer() {
glGenFramebuffers(1, &id);
glBindFramebuffer(GL_FRAMEBUFFER, id);
}
void FrameBuffer::toTexture(int attachment, int texturePrimitive, int textureID) {
glFramebufferTexture2D(GL_FRAMEBUFFER, attachment, texturePrimitive, textureID, 0);
}
void FrameBuffer::blitFrom(FrameBuffer::Ptr& frameBuffer, unsigned int width, unsigned int height) {
glBindFramebuffer(GL_READ_FRAMEBUFFER, frameBuffer->getID());
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, id);
glBlitFramebuffer(0, 0, width, height, 0, 0, width, height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
}
void FrameBuffer::setRenderBuffer(int attachment, int renderBufferID) {
glFramebufferRenderbuffer(GL_FRAMEBUFFER, attachment, GL_RENDERBUFFER, renderBufferID);
}
void FrameBuffer::bind() {
glBindFramebuffer(GL_FRAMEBUFFER, id);
}
void FrameBuffer::unbind() {
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
bool FrameBuffer::isComplete() {
return glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE;
}
================================================
FILE: src/engine/opengl/buffer/FrameBuffer.h
================================================
#pragma once
#include "Buffer.h"
class FrameBuffer : public Buffer {
GENERATE_PTR(FrameBuffer)
public:
FrameBuffer();
~FrameBuffer();
protected:
void initBuffer() override;
public:
void toTexture(int attachment, int texturePrimitive, int textureID);
void blitFrom(FrameBuffer::Ptr& frameBuffer, unsigned int width, unsigned int height);
void setRenderBuffer(int attachment, int renderBufferID);
void bind() override;
void unbind() override;
bool isComplete();
};
================================================
FILE: src/engine/opengl/buffer/IndexBuffer.cpp
================================================
#include "IndexBuffer.h"
#include <string.h>
IndexBuffer::IndexBuffer() : Buffer() { }
IndexBuffer::IndexBuffer(const std::vector<unsigned int> indices)
: Buffer(), length(indices.size()) {
initBuffer(indices);
}
IndexBuffer::IndexBuffer(const IndexBuffer& indexBuffer)
: length(indexBuffer.length) {
id = indexBuffer.id;
}
IndexBuffer::IndexBuffer(IndexBuffer&& indexBuffer) noexcept
: length(indexBuffer.length) {
id = indexBuffer.id;
}
IndexBuffer& IndexBuffer::operator=(const IndexBuffer& indexBuffer) {
id = indexBuffer.id;
length = indexBuffer.length;
return *this;
}
IndexBuffer::~IndexBuffer() {
unbind();
glDeleteBuffers(1, &id);
}
void IndexBuffer::initBuffer(std::vector<unsigned int> indices) {
glGenBuffers(1, &id);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, id);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(unsigned int), &indices[0], GL_DYNAMIC_DRAW);
}
void IndexBuffer::initBuffer() { }
void IndexBuffer::bind() {
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, id);
}
void IndexBuffer::unbind() {
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
void IndexBuffer::updateIndices(const std::vector<unsigned int>& indices) {
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, id);
unsigned int* ptr = (unsigned int*)glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY);
memcpy(ptr, &indices[0], indices.size());
glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
std::vector<unsigned int> IndexBuffer::getIndices() {
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, id);
unsigned int* ptr = (unsigned int*)glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_READ_ONLY);
std::vector<unsigned int> indices;
for(int i = 0; i < length; i ++) indices.push_back(ptr[i]);
glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
return indices;
}
================================================
FILE: src/engine/opengl/buffer/IndexBuffer.h
================================================
#include <iostream>
#include <vector>
#include "Buffer.h"
class IndexBuffer : public Buffer {
GENERATE_PTR(IndexBuffer)
private:
size_t length;
public:
IndexBuffer();
IndexBuffer(const std::vector<unsigned int> indices);
IndexBuffer(const IndexBuffer& indexBuffer);
IndexBuffer(IndexBuffer&& indexBuffer) noexcept;
IndexBuffer& operator=(const IndexBuffer& indexBuffer);
~IndexBuffer();
private:
void initBuffer(std::vector<unsigned int> indices);
void initBuffer() override;
public:
void bind() override;
void unbind() override;
void updateIndices(const std::vector<unsigned int>& indices);
std::vector<unsigned int> getIndices();
};
================================================
FILE: src/engine/opengl/buffer/MultiSampleRenderBuffer.cpp
================================================
#include "MultiSampleRenderBuffer.h"
MultiSampleRenderBuffer::MultiSampleRenderBuffer(unsigned int width, unsigned int height, unsigned int _samples)
: RenderBuffer(width, height, GL_DEPTH24_STENCIL8), samples(_samples) {
initBuffer();
}
void MultiSampleRenderBuffer::initBuffer() {
glGenRenderbuffers(1, &id);
glBindRenderbuffer(GL_RENDERBUFFER, id);
glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, internalFormat, width, height);
glBindRenderbuffer(GL_RENDERBUFFER, 0);
}
================================================
FILE: src/engine/opengl/buffer/MultiSampleRenderBuffer.h
================================================
#pragma once
#include "RenderBuffer.h"
class MultiSampleRenderBuffer : public RenderBuffer {
GENERATE_PTR(MultiSampleRenderBuffer)
protected:
unsigned int samples;
public:
MultiSampleRenderBuffer(unsigned int width, unsigned int height, unsigned int _samples = 4);
MultiSampleRenderBuffer() = default;
virtual ~MultiSampleRenderBuffer() = default;
protected:
void initBuffer() override;
public:
inline unsigned int getSamples() const { return samples; }
};
================================================
FILE: src/engine/opengl/buffer/RenderBuffer.cpp
================================================
#include "RenderBuffer.h"
RenderBuffer::RenderBuffer(unsigned int _width, unsigned int _height, int _internalFormat)
: Buffer(), width(_width), height(_height), internalFormat(_internalFormat) {
initBuffer();
}
RenderBuffer::~RenderBuffer() {
unbind();
glDeleteRenderbuffers(1, &id);
}
void RenderBuffer::initBuffer() {
glGenRenderbuffers(1, &id);
glBindRenderbuffer(GL_RENDERBUFFER, id);
glRenderbufferStorage(GL_RENDERBUFFER, internalFormat, width, height);
}
void RenderBuffer::bind() {
glBindRenderbuffer(GL_RENDERBUFFER, id);
}
void RenderBuffer::unbind() {
glBindRenderbuffer(GL_RENDERBUFFER, 0);
}
================================================
FILE: src/engine/opengl/buffer/RenderBuffer.h
================================================
#pragma once
#include "Buffer.h"
class RenderBuffer : public Buffer {
GENERATE_PTR(RenderBuffer)
protected:
unsigned int width, height;
int internalFormat;
public:
RenderBuffer(unsigned int _width, unsigned int _height, int _internalFormat = GL_DEPTH_COMPONENT);
RenderBuffer() = default;
virtual ~RenderBuffer();
protected:
void initBuffer() override;
public:
void bind() override;
void unbind() override;
public:
inline unsigned int getWidth() const { return width; }
inline unsigned int getHeight() const { return height; }
inline int getInternalFormat() const { return internalFormat; }
};
================================================
FILE: src/engine/opengl/buffer/VertexArray.cpp
================================================
#include "VertexArray.h"
VertexArray::VertexArray()
: Buffer() {
initBuffer();
}
VertexArray::VertexArray(const VertexArray& vertexArray) {
id = vertexArray.id;
}
VertexArray::VertexArray(VertexArray&& vertexArray) noexcept {
id = vertexArray.id;
}
VertexArray& VertexArray::operator=(const VertexArray& vertexArray) {
id = vertexArray.id;
return *this;
}
VertexArray::~VertexArray() {
unbind();
glDeleteVertexArrays(1, &id);
}
void VertexArray::initBuffer() {
glGenVertexArrays(1, &id);
glBindVertexArray(id);
}
void VertexArray::bind() {
glBindVertexArray(id);
}
void VertexArray::unbind() {
glBindVertexArray(0);
}
================================================
FILE: src/engine/opengl/buffer/VertexArray.h
================================================
#pragma once
#include "Buffer.h"
class VertexArray : public Buffer {
GENERATE_PTR(VertexArray)
public:
VertexArray();
VertexArray(const VertexArray& vertexArray);
VertexArray(VertexArray&& vertexArray) noexcept;
VertexArray& operator=(const VertexArray& vertexArray);
~VertexArray();
protected:
void initBuffer() override;
public:
void bind() override;
void unbind() override;
};
================================================
FILE: src/engine/opengl/buffer/VertexBuffer.cpp
================================================
#include "VertexBuffer.h"
#include <string.h>
VertexBuffer::VertexBuffer() : Buffer() { }
VertexBuffer::VertexBuffer(size_t _length)
: Buffer(), length(_length), hasIndexBuffer(false) {
initBuffer();
}
VertexBuffer::VertexBuffer(std::vector<Vec3f>& vertices)
: Buffer(), length(vertices.size()), hasIndexBuffer(false) {
initBuffer(vertices, {});
}
VertexBuffer::VertexBuffer(std::vector<Vec3f>& vertices, std::vector<unsigned int> indices)
: Buffer(), length(vertices.size()), hasIndexBuffer(true) {
initBuffer(vertices, indices);
}
VertexBuffer::VertexBuffer(const VertexBuffer& vertexBuffer)
: length(vertexBuffer.length), hasIndexBuffer(vertexBuffer.hasIndexBuffer) {
if(vertexBuffer.indexBuffer != nullptr) indexBuffer = vertexBuffer.indexBuffer;
id = vertexBuffer.id;
}
VertexBuffer::VertexBuffer(VertexBuffer&& vertexBuffer) noexcept
: length(vertexBuffer.length), hasIndexBuffer(vertexBuffer.hasIndexBuffer) {
if(indexBuffer != nullptr) indexBuffer = std::move(vertexBuffer.indexBuffer);
id = vertexBuffer.id;
}
VertexBuffer& VertexBuffer::operator=(const VertexBuffer& vertexBuffer) {
id = vertexBuffer.id;
length = vertexBuffer.length;
hasIndexBuffer = vertexBuffer.hasIndexBuffer;
if(indexBuffer != nullptr) indexBuffer = vertexBuffer.indexBuffer;
return *this;
}
VertexBuffer::~VertexBuffer() {
unbind();
glDeleteBuffers(1, &id);
}
void VertexBuffer::vertexAttributes() {
// position attribute
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 17 * sizeof(float), (void*)0);
// color attribute
glEnableVertexAttribArray(1);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 17 * sizeof(float), (void*)(3 * sizeof(float)));
// normal attribute
glEnableVertexAttribArray(2);
glVertexAttribPointer(2, 3, GL_FLOAT, GL_FALSE, 17 * sizeof(float), (void*)(6 * sizeof(float)));
// texture coordinates attribute
glEnableVertexAttribArray(3);
glVertexAttribPointer(3, 2, GL_FLOAT, GL_FALSE, 17 * sizeof(float), (void*)(9 * sizeof(float)));
// tangent attribute
glEnableVertexAttribArray(4);
glVertexAttribPointer(4, 3, GL_FLOAT, GL_FALSE, 17 * sizeof(float), (void*)(11 * sizeof(float)));
// bitangent attribute
glEnableVertexAttribArray(5);
glVertexAttribPointer(5, 3, GL_FLOAT, GL_FALSE, 17 * sizeof(float), (void*)(14 * sizeof(float)));
}
void VertexBuffer::initBuffer(std::vector<Vec3f>& vertices, std::vector<unsigned int> indices) {
// Load vertices
unsigned int index = 0;
float* glVertices = new float[vertices.size() * 17];
for(Vec3f& vertex : vertices) {
glVertices[index] = vertex.x; glVertices[index + 1] = vertex.y; glVertices[index + 2] = vertex.z;
glVertices[index + 3] = vertex.r; glVertices[index + 4] = vertex.g; glVertices[index + 5] = vertex.b;
glVertices[index + 6] = vertex.nx; glVertices[index + 7] = vertex.ny; glVertices[index + 8] = vertex.nz;
glVertices[index + 9] = vertex.tx; glVertices[index + 10] = vertex.ty;
glVertices[index + 11] = vertex.tanx; glVertices[index + 12] = vertex.tany; glVertices[index + 13] = vertex.tanz;
glVertices[index + 14] = vertex.bitanx; glVertices[index + 15] = vertex.bitany; glVertices[index + 16] = vertex.bitanz;
index += 17;
}
// Vertex buffer
glGenBuffers(1, &id);
glBindBuffer(GL_ARRAY_BUFFER, id);
glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof(float) * 17, glVertices, GL_DYNAMIC_DRAW);
delete[] glVertices;
// Index Buffer
if(hasIndexBuffer && !indices.empty()) indexBuffer = std::make_shared<IndexBuffer>(indices);
// Vertex Attributes
vertexAttributes();
// Unbind VBO
unbind();
}
void VertexBuffer::initBuffer() {
// Vertex buffer
glGenBuffers(1, &id);
glBindBuffer(GL_ARRAY_BUFFER, id);
glBufferData(GL_ARRAY_BUFFER, length * sizeof(float) * 17, nullptr, GL_DYNAMIC_DRAW);
// Vertex Attributes
vertexAttributes();
// Unbind VBO
unbind();
}
void VertexBuffer::updateVertices(std::vector<Vec3f>& vertices) {
glBindBuffer(GL_ARRAY_BUFFER, id);
float* ptr = (float*)glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE);
unsigned int index = 0;
for(Vec3f& vertex : vertices) {
ptr[index] = vertex.x; ptr[index + 1] = vertex.y; ptr[index + 2] = vertex.z;
ptr[index + 3] = vertex.r; ptr[index + 4] = vertex.g; ptr[index + 5] = vertex.b;
ptr[index + 6] = vertex.nx; ptr[index + 7] = vertex.ny; ptr[index + 8] = vertex.nz;
ptr[index + 9] = vertex.tx; ptr[index + 10] = vertex.ty;
ptr[index + 11] = vertex.tanx; ptr[index + 12] = vertex.tany; ptr[index + 13] = vertex.tanz;
ptr[index + 14] = vertex.bitanx; ptr[index + 15] = vertex.bitany; ptr[index + 16] = vertex.bitanz;
index += 17;
}
glUnmapBuffer(GL_ARRAY_BUFFER);
glBindBuffer(GL_ARRAY_BUFFER, 0);
}
void VertexBuffer::updateVertex(int pos, Vec3f newVertex) {
glBindBuffer(GL_ARRAY_BUFFER, id);
float* ptr = (float*)glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE);
int index = pos * 17;
ptr[index] = newVertex.x; ptr[index + 1] = newVertex.y; ptr[index + 2] = newVertex.z;
ptr[index + 3] = newVertex.r; ptr[index + 4] = newVertex.g; ptr[index + 5] = newVertex.b;
ptr[index + 6] = newVertex.nx; ptr[index + 7] = newVertex.ny; ptr[index + 8] = newVertex.nz;
ptr[index + 9] = newVertex.tx; ptr[index + 10] = newVertex.ty;
ptr[index + 11] = newVertex.tanx; ptr[index + 12] = newVertex.tany; ptr[index + 13] = newVertex.tanz;
ptr[index + 14] = newVertex.bitanx; ptr[index + 15] = newVertex.bitany; ptr[index + 16] = newVertex.bitanz;
glUnmapBuffer(GL_ARRAY_BUFFER);
glBindBuffer(GL_ARRAY_BUFFER, 0);
}
std::vector<Vec3f> VertexBuffer::getVertices() {
glBindBuffer(GL_ARRAY_BUFFER, id);
float* ptr = (float*)glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE);
std::vector<Vec3f> vertices;
for(int i = 0; i < length; i ++) {
Vec3f vertex(
ptr[i * 17], ptr[i * 17 + 1], ptr[i * 17 + 2],
ptr[i * 17 + 3], ptr[i * 17 + 4], ptr[i * 17 + 5],
ptr[i * 17 + 6], ptr[i * 17 + 7], ptr[i * 17 + 8],
ptr[i * 17 + 9], ptr[i * 17 + 10]
);
vertex.tanx = ptr[i * 17 + 11];
vertex.tany = ptr[i * 17 + 12];
vertex.tanz = ptr[i * 17 + 13];
vertex.bitanx = ptr[i * 17 + 14];
vertex.bitany = ptr[i * 17 + 15];
vertex.bitanz = ptr[i * 17 + 16];
vertices.push_back(vertex);
}
glUnmapBuffer(GL_ARRAY_BUFFER);
glBindBuffer(GL_ARRAY_BUFFER, 0);
return vertices;
}
void VertexBuffer::bind() {
glBindBuffer(GL_ARRAY_BUFFER, id);
}
void VertexBuffer::unbind() {
glBindBuffer(GL_ARRAY_BUFFER, 0);
}
================================================
FILE: src/engine/opengl/buffer/VertexBuffer.h
================================================
#pragma once
#include <iostream>
#include <vector>
#include <memory>
#include "Buffer.h"
#include "IndexBuffer.h"
#include "engine/Vec3.h"
class VertexBuffer : public Buffer {
GENERATE_PTR(VertexBuffer)
private:
IndexBuffer::Ptr indexBuffer;
bool hasIndexBuffer;
size_t length;
public:
VertexBuffer();
VertexBuffer(size_t _length);
VertexBuffer(std::vector<Vec3f>& vertices);
VertexBuffer(std::vector<Vec3f>& vertices, std::vector<unsigned int> indices);
VertexBuffer(const VertexBuffer& vertexBuffer);
VertexBuffer(VertexBuffer&& vertexBuffer) noexcept;
VertexBuffer& operator=(const VertexBuffer& vertexBuffer);
~VertexBuffer();
protected:
void vertexAttributes();
void initBuffer(std::vector<Vec3f>& vertices, std::vector<unsigned int> indices);
void initBuffer() override;
public:
void updateVertices(std::vector<Vec3f>& vertices);
void updateVertex(int pos, Vec3f newVertex);
std::vector<Vec3f> getVertices();
void bind() override;
void unbind() override;
public:
inline IndexBuffer::Ptr& getIndexBuffer() { return indexBuffer; }
inline bool HasIndexBuffer() const { return hasIndexBuffer; }
inline void setLength(size_t length) { this->length = length; }
inline size_t getLength() const { return length; }
};
================================================
FILE: src/engine/opengl/glsl/BlinnPhong.frag
================================================
#version 330 core
#define MAX_LIGHTS 64
#define MAX_TEXTURES 64
struct Material {
vec3 ambient;
vec3 diffuse;
vec3 specular;
float shininess;
};
struct Light {
vec3 position;
vec3 color;
vec3 ambient;
vec3 diffuse;
vec3 specular;
float constant;
float linear;
float quadratic;
bool pointLight;
};
struct MaterialMaps {
sampler2D diffuseMap;
sampler2D specularMap;
sampler2D normalMap;
sampler2D depthMap;
sampler2D emissionMap;
};
in vec3 ourColor;
in vec3 Normal;
in vec3 FragPos;
in vec2 TexCoord;
in vec4 FragPosLightSpace;
in vec3 TangentLightPos;
in vec3 TangentViewPos;
in vec3 TangentFragPos;
out vec4 FragColor;
uniform vec3 viewPos;
uniform Material material;
uniform Light lights[MAX_LIGHTS];
uniform int nLights;
uniform MaterialMaps materialMaps;
uniform bool hasDiffuse;
uniform bool hasSpecular;
uniform bool hasEmission;
uniform bool hasNormalMap;
uniform bool hasDepthMap;
uniform float emissionStrength;
uniform bool blinn;
uniform float heightScale;
uniform bool shadowMapping;
uniform sampler2D shadowMap;
uniform vec3 lightPos;
vec2 texCoord = TexCoord;
vec4 calculateAmbient(Light light) {
vec4 ambient = vec4(1.0);
vec4 lightAmbient = vec4(light.ambient, 1.0);
vec4 lightColor = vec4(light.color, 1.0);
if(hasDiffuse) {
vec4 textureDiffuse = texture(materialMaps.diffuseMap, texCoord);
ambient = lightAmbient * lightColor * textureDiffuse;
}
else ambient = lightAmbient * lightColor * vec4(ourColor, 1.0);
return ambient;
}
vec4 calculateDiffuse(Light light, vec3 normal, vec3 lightDir) {
vec4 diffuse = vec4(1.0);
float diff = max(dot(normal, lightDir), 0.0);
vec4 lightDiffuse = vec4(light.diffuse, 1.0);
vec4 materialDiffuse = vec4(material.diffuse, 1.0);
if(hasDiffuse) {
vec4 textureDiffuse = texture(materialMaps.diffuseMap, texCoord);
diffuse = lightDiffuse * diff * textureDiffuse;
}else diffuse = lightDiffuse * (diff * materialDiffuse);
return diffuse;
}
vec4 calculateSpecular(Light light, vec3 normal, vec3 lightDir) {
vec4 specular = vec4(1.0);
vec3 viewDir = normalize(viewPos - FragPos);
if(hasNormalMap) viewDir = normalize(TangentViewPos - TangentFragPos);
vec3 reflectDir = reflect(-lightDir, normal);
float spec = 0.0;
vec4 lightSpecular = vec4(light.specular, 1.0);
vec4 materialSpecular = vec4(material.specular, 1.0);
if(blinn) {
vec3 halfwayDir = normalize(lightDir + viewDir);
spec = pow(max(dot(normal, halfwayDir), 0.0), material.shininess);
} else spec = pow(max(dot(viewDir, reflectDir), 0.0), material.shininess);
if(hasSpecular) {
vec4 specularMapInfo = texture(materialMaps.specularMap, texCoord);
specular = lightSpecular * spec * specularMapInfo;
}else specular = lightSpecular * (spec * materialSpecular);
return specular;
}
vec4 calculateEmission() {
vec4 emission = vec4(0.0);
if(hasEmission) emission = texture(materialMaps.emissionMap, texCoord);
return emission * emissionStrength;
}
float calculateShadow(vec4 fragPosLightSpace) {
// perform perspective divide
vec3 projCoords = fragPosLightSpace.xyz / fragPosLightSpace.w;
// transform to [0,1] range
projCoords = projCoords * 0.5 + 0.5;
// get closest depth value from light's perspective (using [0,1] range fragPosLight as coords)
float closestDepth = texture(shadowMap, projCoords.xy).r;
// get depth of current fragment from light's perspective
float currentDepth = projCoords.z;
// calculate bias (based on depth map resolution and slope)
vec3 normal = normalize(Normal);
vec3 lightDir = normalize(lightPos - FragPos);
float bias = max(0.05 * (1.0 - dot(normal, lightDir)), 0.005);
// check whether current frag pos is in shadow
// float shadow = currentDepth - bias > closestDepth ? 1.0 : 0.0;
// PCF
float shadow = 0.0;
vec2 texelSize = 1.0 / textureSize(shadowMap, 0);
for(int x = -1; x <= 1; ++x) {
for(int y = -1; y <= 1; ++y) {
float pcfDepth = texture(shadowMap, projCoords.xy + vec2(x, y) * texelSize).r;
shadow += currentDepth - bias > pcfDepth ? 1.0 : 0.0;
}
}
shadow /= 9.0;
// keep the shadow at 0.0 when outside the far_plane region of the light's frustum.
if(projCoords.z > 1.0)
shadow = 0.0;
return shadow;
}
vec4 getLightColor(Light light) {
// Calculate ambient, diffuse and specular
vec3 norm = normalize(Normal);
vec3 lightDir = normalize(light.position - FragPos);
if(hasNormalMap) {
norm = texture(materialMaps.normalMap, texCoord).rgb;
// transform normal vector to range [-1,1]
norm = normalize(norm * 2.0 - 1.0); // this normal is in tangent space
lightDir = normalize(TangentLightPos - TangentFragPos);
}
vec4 ambient = calculateAmbient(light);
vec4 diffuse = calculateDiffuse(light, norm, lightDir);
vec4 specular = calculateSpecular(light, norm, lightDir);
// Calculate emission
vec4 emission = calculateEmission();
// Calculate attenuation
if(light.pointLight) {
float distance = length(light.position - FragPos);
float attenuation = 1.0 / (light.constant + light.linear * distance + light.quadratic * (distance * distance));
ambient *= attenuation;
diffuse *= attenuation;
specular *= attenuation;
}
// Calculate shadow
float shadow = 0.0;
if(shadowMapping) shadow = calculateShadow(FragPosLightSpace);
vec4 lightColor = vec4(light.color, 1.0);
return (ambient + (1.0 - shadow) * (diffuse + specular) + emission) * lightColor;
}
vec2 parallaxMapping(vec2 texCoords, vec3 viewDir) {
if(!hasDepthMap)
return texCoords;
// number of depth layers
const float minLayers = 8;
const float maxLayers = 32;
float numLayers = mix(maxLayers, minLayers, abs(dot(vec3(0.0, 0.0, 1.0), viewDir)));
// calculate the size of each layer
float layerDepth = 1.0 / numLayers;
// depth of current layer
float currentLayerDepth = 0.0;
// the amount to shift the texture coordinates per layer (from vector P)
vec2 P = viewDir.xy / viewDir.z * heightScale;
vec2 deltaTexCoords = P / numLayers;
// get initial values
vec2 currentTexCoords = texCoords;
float currentDepthMapValue = texture(materialMaps.depthMap, currentTexCoords).r;
while(currentLayerDepth < currentDepthMapValue) {
// shift texture coordinates along direction of P
currentTexCoords -= deltaTexCoords;
// get depthmap value at current texture coordinates
currentDepthMapValue = texture(materialMaps.depthMap, currentTexCoords).r;
// get depth of next layer
currentLayerDepth += layerDepth;
}
// get texture coordinates before collision (reverse operations)
vec2 prevTexCoords = currentTexCoords + deltaTexCoords;
// get depth after and before collision for linear interpolation
float afterDepth = currentDepthMapValue - currentLayerDepth;
float beforeDepth = texture(materialMaps.depthMap, prevTexCoords).r - currentLayerDepth + layerDepth;
// interpolation of texture coordinates
float weight = afterDepth / (afterDepth - beforeDepth);
vec2 finalTexCoords = prevTexCoords * weight + currentTexCoords * (1.0 - weight);
return finalTexCoords;
}
void main() {
vec3 viewDir = normalize(TangentViewPos - TangentFragPos);
texCoord = parallaxMapping(texCoord, viewDir);
vec4 lightColor = vec4(0.0);
for(int i = 0; i < nLights; i ++) lightColor += getLightColor(lights[i]);
// Apply transparency for blending
if(hasDiffuse) {
vec4 textureDiffuse = texture(materialMaps.diffuseMap, texCoord);
lightColor.a = textureDiffuse.a;
}
FragColor = lightColor;
}
================================================
FILE: src/engine/opengl/glsl/BlinnPhong.vert
================================================
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aColor;
layout (location = 2) in vec3 aNormal;
layout (location = 3) in vec2 aTexCoord;
layout (location = 4) in vec3 aTangent;
layout (location = 5) in vec3 aBitangent;
out vec3 FragPos;
out vec3 ourColor;
out vec3 Normal;
out vec2 TexCoord;
out vec4 FragPosLightSpace;
out vec3 TangentLightPos;
out vec3 TangentViewPos;
out vec3 TangentFragPos;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
uniform mat4 lightSpaceMatrix;
uniform vec3 lightPos;
uniform vec3 viewPos;
void main() {
FragPos = vec3(model * vec4(aPos, 1.0));
ourColor = aColor;
Normal = mat3(transpose(inverse(model))) * aNormal;
TexCoord = aTexCoord;
FragPosLightSpace = lightSpaceMatrix * vec4(FragPos, 1.0);
mat3 normalMatrix = transpose(inverse(mat3(model)));
vec3 T = normalize(normalMatrix * aTangent);
vec3 N = normalize(normalMatrix * aNormal);
T = normalize(T - dot(T, N) * N);
vec3 B = cross(N, T);
mat3 TBN = transpose(mat3(T, B, N));
TangentLightPos = TBN * lightPos;
TangentViewPos = TBN * viewPos;
TangentFragPos = TBN * FragPos;
gl_Position = projection * view * vec4(FragPos, 1.0);
}
================================================
FILE: src/engine/opengl/glsl/Default.frag
================================================
#version 330 core
out vec4 FragColor;
in vec3 ourColor;
in vec3 Normal;
in vec2 TexCoord;
uniform sampler2D tex;
uniform bool hasTexture;
void main() {
vec4 color = vec4(ourColor, 1.0);
color = hasTexture ? color * texture(tex, TexCoord).rgba : color;
FragColor = color;
}
================================================
FILE: src/engine/opengl/glsl/Default.vert
================================================
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aColor;
layout (location = 2) in vec3 aNormal;
layout (location = 3) in vec2 aTexCoord;
uniform mat4 mvp;
out vec3 ourColor;
out vec3 Normal;
out vec2 TexCoord;
void main() {
gl_Position = mvp * vec4(aPos, 1.0);
ourColor = aColor;
Normal = aNormal;
TexCoord = aTexCoord;
}
================================================
FILE: src/engine/opengl/glsl/HDR.frag
================================================
#version 330 core
out vec4 FragColor;
in vec2 TexCoords;
uniform sampler2D hdrBuffer;
uniform bool hdr;
uniform float exposure;
uniform bool gammaCorrection;
void main() {
const float gamma = 2.2;
vec3 hdrColor = texture(hdrBuffer, TexCoords).rgb;
if(hdr) {
// reinhard
// vec3 result = hdrColor / (hdrColor + vec3(1.0));
// exposure
vec3 result = vec3(1.0) - exp(-hdrColor * exposure);
// also gamma correct while we're at it
if(gammaCorrection) result = pow(result, vec3(1.0 / gamma));
FragColor = vec4(result, 1.0);
}
else
{
vec3 result = gammaCorrection ? pow(hdrColor, vec3(1.0 / gamma)) : hdrColor;
FragColor = vec4(result, 1.0);
}
}
================================================
FILE: src/engine/opengl/glsl/HDR.vert
================================================
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 3) in vec2 aTexCoords;
out vec2 TexCoords;
void main() {
TexCoords = aTexCoords;
gl_Position = vec4(aPos, 1.0);
}
================================================
FILE: src/engine/opengl/glsl/PBR.frag
================================================
#version 330 core
#define MAX_LIGHTS 64
#define MAX_TEXTURES 64
struct Material {
vec3 albedo;
float metallic;
float roughness;
float ao;
vec3 emission;
};
struct Light {
vec3 position;
vec3 color;
float constant;
float linear;
float quadratic;
bool pointLight;
};
struct MaterialMaps {
sampler2D albedo;
sampler2D metallic;
sampler2D roughness;
sampler2D normalMap;
sampler2D depthMap;
sampler2D ao;
sampler2D emission;
};
in vec3 ourColor;
in vec3 Normal;
in vec3 FragPos;
in vec2 TexCoord;
in vec4 FragPosLightSpace;
in vec3 TangentLightPos;
in vec3 TangentViewPos;
in vec3 TangentFragPos;
out vec4 FragColor;
uniform Light lights[MAX_LIGHTS];
uniform int nLights;
uniform Material material;
uniform MaterialMaps materialMaps;
uniform bool hasAlbedo;
uniform bool hasMetallic;
uniform bool hasRoughness;
uniform bool hasNormalMap;
uniform bool hasDepthMap;
uniform bool hasAmbientOcclusion;
uniform bool hasEmission;
uniform float heightScale;
vec2 texCoord = TexCoord;
uniform vec3 viewPos;
const float PI = 3.14159265359;
float distributionGGX(vec3 N, vec3 H, float roughness) {
float a = roughness * roughness;
float a2 = a * a;
float NdotH = max(dot(N, H), 0.0);
float NdotH2 = NdotH*NdotH;
float nom = a2;
float denom = (NdotH2 * (a2 - 1.0) + 1.0);
denom = PI * denom * denom;
return nom / denom;
}
float geometrySchlickGGX(float NdotV, float roughness) {
float r = (roughness + 1.0);
float k = (r * r) / 8.0;
float nom = NdotV;
float denom = NdotV * (1.0 - k) + k;
return nom / denom;
}
float geometrySmith(vec3 N, vec3 V, vec3 L, float roughness) {
float NdotV = max(dot(N, V), 0.0);
float NdotL = max(dot(N, L), 0.0);
float ggx2 = geometrySchlickGGX(NdotV, roughness);
float ggx1 = geometrySchlickGGX(NdotL, roughness);
return ggx1 * ggx2;
}
vec3 fresnelSchlick(float cosTheta, vec3 F0) {
return F0 + (1.0 - F0) * pow(clamp(1.0 - cosTheta, 0.0, 1.0), 5.0);
}
vec3 getNormalFromMap() {
vec3 tangentNormal = texture(materialMaps.normalMap, texCoord).xyz * 2.0 - 1.0;
vec3 Q1 = dFdx(FragPos);
vec3 Q2 = dFdy(FragPos);
vec2 st1 = dFdx(texCoord);
vec2 st2 = dFdy(texCoord);
vec3 N = normalize(Normal);
vec3 T = normalize(Q1 * st2.t - Q2 * st1.t);
vec3 B = -normalize(cross(N, T));
mat3 TBN = mat3(T, B, N);
return normalize(TBN * tangentNormal);
}
vec3 calculateAlbedo() {
vec3 albedo = material.albedo;
if(hasAlbedo) albedo = pow(texture(materialMaps.albedo, texCoord).rgb, vec3(2.2));
albedo *= ourColor;
return albedo;
}
float calculateMetallic() {
float metallic = material.metallic;
if(hasMetallic) metallic = texture(materialMaps.metallic, texCoord).r;
return metallic;
}
float calculateRoughness() {
float roughness = material.roughness;
if(hasRoughness) roughness = texture(materialMaps.roughness, texCoord).r;
return roughness;
}
float calculateAmbientOcclusion() {
float ao = material.ao;
if(hasAmbientOcclusion) ao = texture(materialMaps.ao, texCoord).r;
return ao;
}
vec3 calculateNormal() {
vec3 N = normalize(Normal);
if(hasNormalMap) N = getNormalFromMap();
return N;
}
vec3 calculateEmission() {
vec3 emission = material.emission;
if(hasEmission) emission = vec3(texture(materialMaps.emission, texCoord));
return emission;
}
vec2 parallaxMapping(vec2 texCoords) {
vec2 uvs = texCoords;
if(hasDepthMap) {
// Calculate viewDir
vec3 Q1 = dFdx(FragPos);
vec3 Q2 = dFdy(FragPos);
vec2 st1 = dFdx(texCoord);
vec2 st2 = dFdy(texCoord);
vec3 N = normalize(Normal);
vec3 T = normalize(Q1 * st2.t - Q2 * st1.t);
vec3 B = -normalize(cross(N, T));
mat3 TBN = mat3(T, B, N);
vec3 tangentViewPos = TBN * viewPos;
vec3 tangentFragPos = TBN * FragPos;
vec3 viewDir = normalize(tangentViewPos - tangentFragPos);
// Paralax mapping
float height = texture(materialMaps.depthMap, texCoords).r;
vec2 offset = viewDir.xy * (height * heightScale);
return texCoords - offset;
}
return uvs;
}
void main() {
// Paralax mapping
texCoord = parallaxMapping(TexCoord);
if(texCoord.x > 1.0 || texCoord.y > 1.0 || texCoord.x < 0.0 || texCoord.y < 0.0)
discard;
// Material
vec3 albedo = calculateAlbedo();
float metallic = calculateMetallic();
float roughness = calculateRoughness();
float ao = calculateAmbientOcclusion();
vec3 N = calculateNormal();
vec3 emission = calculateEmission();
// V
vec3 V = normalize(viewPos - FragPos);
// calculate reflectance at normal incidence; if dia-electric (like plastic) use F0
// of 0.04 and if it's a metal, use the albedo color as F0 (metallic workflow)
vec3 F0 = vec3(0.04);
F0 = mix(F0, albedo, metallic);
// reflectance equation
vec3 Lo = vec3(0.0);
for(int i = 0; i < nLights; i ++) {
// calculate per-light radiance
vec3 L = normalize(lights[i].position - FragPos);
vec3 H = normalize(V + L);
vec3 radiance = lights[i].color;
if(lights[i].pointLight) {
float distance = length(lights[i].position - FragPos);
float attenuation = 1.0 / (lights[i].constant + lights[i].linear * distance + lights[i].quadratic * (distance * distance));
radiance *= attenuation;
}
// Cook-Torrance BRDF
float NDF = distributionGGX(N, H, roughness);
float G = geometrySmith(N, V, L, roughness);
vec3 F = fresnelSchlick(max(dot(H, V), 0.0), F0);
vec3 numerator = NDF * G * F;
float denominator = 4.0 * max(dot(N, V), 0.0) * max(dot(N, L), 0.0) + 0.0001; // + 0.0001 to prevent divide by zero
vec3 specular = numerator / denominator;
// kS is equal to Fresnel
vec3 kS = F;
// for energy conservation, the diffuse and specular light can't
// be above 1.0 (unless the surface emits light); to preserve this
// relationship the diffuse component (kD) should equal 1.0 - kS.
vec3 kD = vec3(1.0) - kS;
// multiply kD by the inverse metalness such that only non-metals
// have diffuse lighting, or a linear blend if partly metal (pure metals
// have no diffuse light).
kD *= 1.0 - metallic;
// scale light by NdotL
float NdotL = max(dot(N, L), 0.0);
// add to outgoing radiance Lo
Lo += (kD * albedo / PI + specular) * radiance * NdotL; // note that we already multiplied the BRDF by the Fresnel (kS) so we won't multiply by kS again
}
// replace this ambient lighting with environment lighting).
vec3 ambient = vec3(0.03) * albedo * ao;
vec3 color = ambient + emission + Lo;
// HDR tonemapping
color = color / (color + vec3(1.0));
// gamma correct
color = pow(color, vec3(1.0/2.2));
// Apply transparency
float transparency = 1.0;
if(hasAlbedo) {
vec4 textureAlbedo = texture(materialMaps.albedo, texCoord);
transparency = textureAlbedo.a;
}
// Color
FragColor = vec4(color, transparency);
}
================================================
FILE: src/engine/opengl/glsl/PBR.vert
================================================
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aColor;
layout (location = 2) in vec3 aNormal;
layout (location = 3) in vec2 aTexCoord;
layout (location = 4) in vec3 aTangent;
layout (location = 5) in vec3 aBitangent;
out vec3 FragPos;
out vec3 ourColor;
out vec3 Normal;
out vec2 TexCoord;
out vec4 FragPosLightSpace;
out vec3 TangentLightPos;
out vec3 TangentViewPos;
out vec3 TangentFragPos;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
uniform mat4 lightSpaceMatrix;
uniform vec3 lightPos;
uniform vec3 viewPos;
void main() {
FragPos = vec3(model * vec4(aPos, 1.0));
ourColor = aColor;
Normal = mat3(transpose(inverse(model))) * aNormal;
TexCoord = aTexCoord;
FragPosLightSpace = lightSpaceMatrix * vec4(FragPos, 1.0);
mat3 normalMatrix = transpose(inverse(mat3(model)));
vec3 T = normalize(normalMatrix * aTangent);
vec3 N = normalize(normalMatrix * aNormal);
T = normalize(T - dot(T, N) * N);
vec3 B = cross(N, T);
mat3 TBN = transpose(mat3(T, B, N));
TangentLightPos = TBN * lightPos;
TangentViewPos = TBN * viewPos;
TangentFragPos = TBN * FragPos;
gl_Position = projection * view * vec4(FragPos, 1.0);
}
================================================
FILE: src/engine/opengl/glsl/Selection.frag
================================================
#version 330 core
out vec4 FragColor;
void main() {
FragColor = vec4(1.0, 1.0, 1.0, 0.60);
}
================================================
FILE: src/engine/opengl/glsl/Selection.vert
================================================
#version 330 core
layout (location = 0) in vec3 aPos;
uniform mat4 mvp;
void main() {
vec4 pos = mvp * vec4(aPos, 1.0);
gl_Position = pos.xyzw;
}
================================================
FILE: src/engine/opengl/glsl/SimpleDepth.frag
================================================
#version 330 core
/*
Since we have no color buffer and disabled the draw and read buffers,
the resulting fragments do not require any processing so we can simply
use an empty fragment shader
*/
void main()
{
// gl_FragDepth = gl_FragCoord.z;
}
================================================
FILE: src/engine/opengl/glsl/SimpleDepth.vert
================================================
#version 330 core
layout (location = 0) in vec3 aPos;
uniform mat4 lightSpaceMatrix;
uniform mat4 model;
void main()
{
gl_Position = lightSpaceMatrix * model * vec4(aPos, 1.0);
}
================================================
FILE: src/engine/opengl/glsl/SkyBox.frag
================================================
#version 330 core
out vec4 FragColor;
in vec3 TexCoords;
uniform samplerCube skybox;
void main() {
FragColor = texture(skybox, TexCoords);
}
================================================
FILE: src/engine/opengl/glsl/SkyBox.vert
================================================
#version 330 core
layout (location = 0) in vec3 aPos;
out vec3 TexCoords;
uniform mat4 projection;
uniform mat4 view;
void main() {
TexCoords = aPos;
vec4 pos = projection * view * vec4(aPos, 1.0);
gl_Position = pos.xyzw;
}
================================================
FILE: src/engine/opengl/glsl/TexturedQuad.frag
================================================
#version 330 core
out vec4 FragColor;
in vec2 TexCoords;
uniform sampler2D tex;
void main() {
vec3 color = texture(tex, TexCoords).rgb;
FragColor = vec4(color, 1.0);
}
================================================
FILE: src/engine/opengl/glsl/TexturedQuad.vert
================================================
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 3) in vec2 aTexCoords;
out vec2 TexCoords;
void main() {
TexCoords = aTexCoords;
gl_Position = vec4(aPos, 1.0);
}
================================================
FILE: src/engine/opengl/shader/Shader.cpp
================================================
#include "Shader.h"
#include <fstream>
Shader::Shader(const std::string& _code, const ShaderType& _shaderType)
: code(_code), shaderType(_shaderType) {
compileShader();
}
Shader::Shader() : code(""), filePath(""), shaderID(0), shaderType(ShaderType::None) {}
Shader::Shader(const Shader& shader)
: code(shader.code), filePath(shader.filePath), shaderID(shader.shaderID),
shaderType(shader.shaderType) {
}
Shader::Shader(Shader&& shader) noexcept
: code(std::move(shader.code)), filePath(std::move(shader.filePath)),
shaderID(shader.shaderID), shaderType(std::move(shader.shaderType)) {
}
Shader& Shader::operator=(const Shader& shader) {
code = shader.code;
filePath = shader.filePath;
shaderID = shader.shaderID;
shaderType = shader.shaderType;
return *this;
}
std::string Shader::readFile(const std::string& path) {
std::ifstream file(path);
std::string line = "", code = "";
if(file.is_open()) {
while ( getline(file, line) ) code += line + "\n";
file.close();
}
return code;
}
void Shader::compileShader() {
// Create shader
std::string debugShader = "";
switch (shaderType) {
case ShaderType::Vertex:
shaderID = glCreateShader(GL_VERTEX_SHADER);
debugShader = "Vertex";
break;
case ShaderType::Fragment:
shaderID = glCreateShader(GL_FRAGMENT_SHADER);
debugShader = "Fragment";
break;
default:
debugShader = "Not implemented yet";
break;
}
const char* chrCode = code.c_str();
glShaderSource(shaderID, 1, &chrCode, NULL);
glCompileShader(shaderID);
// Show error if any
int success;
char infoLog[512];
glGetShaderiv(shaderID, GL_COMPILE_STATUS, &success);
if (!success) {
glGetShaderInfoLog(shaderID, 512, NULL, infoLog);
std::cout << debugShader << " shader compilation error: " << infoLog << std::endl;
}
}
ShaderProgram::ShaderProgram(const Shader& _vertexShader, const Shader& _fragmentShader)
: vertexShader(_vertexShader), fragmentShader(_fragmentShader), shaderProgramID(0) {
link();
}
ShaderProgram::ShaderProgram() : shaderProgramID(0) {}
ShaderProgram::ShaderProgram(const ShaderProgram& shaderProgram)
: vertexShader(shaderProgram.vertexShader), fragmentShader(shaderProgram.fragmentShader),
shaderProgramID(shaderProgram.shaderProgramID) {
}
ShaderProgram::ShaderProgram(ShaderProgram&& shaderProgram) noexcept
: vertexShader(std::move(shaderProgram.vertexShader)), fragmentShader(std::move(shaderProgram.fragmentShader)),
shaderProgramID(shaderProgram.shaderProgramID) {
}
ShaderProgram::~ShaderProgram() {
glDeleteProgram(shaderProgramID);
}
ShaderProgram& ShaderProgram::operator=(const ShaderProgram& shaderProgram) {
vertexShader = shaderProgram.vertexShader;
fragmentShader = shaderProgram.fragmentShader;
shaderProgramID = shaderProgram.shaderProgramID;
return *this;
}
void ShaderProgram::link() {
// Link program
shaderProgramID = glCreateProgram();
glAttachShader(shaderProgramID, vertexShader.getShaderID());
glAttachShader(shaderProgramID, fragmentShader.getShaderID());
glLinkProgram(shaderProgramID);
// Check for linking errors
int success;
char infoLog[512];
glGetProgramiv(shaderProgramID, GL_LINK_STATUS, &success);
if (!success) {
glGetProgramInfoLog(shaderProgramID, 512, NULL, infoLog);
std::cout << "Couldn't link shaders\n" << infoLog << std::endl;
}
// Delete shaders
vertexShader.deleteShader();
fragmentShader.deleteShader();
}
void ShaderProgram::uniformInt(const std::string& uniform, int value) {
int location = glGetUniformLocation(shaderProgramID, uniform.c_str());
glUniform1i(location, value);
}
void ShaderProgram::uniformFloat(const std::string& uniform, float value) {
int location = glGetUniformLocation(shaderProgramID, uniform.c_str());
glUniform1f(location, value);
}
void ShaderProgram::uniformVec3(const std::string& uniform, const glm::vec3& vec) {
int location = glGetUniformLocation(shaderProgramID, uniform.c_str());
glUniform3fv(location, 1, &vec[0]);
}
void ShaderProgram::uniformMat4(const std::string& uniform, const glm::mat4& mat) {
int location = glGetUniformLocation(shaderProgramID, uniform.c_str());
glUniformMatrix4fv(location, 1, GL_FALSE, glm::value_ptr(mat));
}
void ShaderProgram::uniformTextureArray(const std::string& uniform, std::vector<int>& textures) {
int location = glGetUniformLocation(shaderProgramID, uniform.c_str());
glUniform1iv(location, textures.size(), &textures[0]);
}
================================================
FILE: src/engine/opengl/shader/Shader.h
================================================
#pragma once
#include <iostream>
#include <vector>
#include <string>
#include <GL/glew.h>
#include <glm/vec3.hpp>
#include <glm/vec4.hpp>
#include <glm/mat4x4.hpp>
#include <glm/gtc/type_ptr.hpp>
#include "engine/ptr.h"
class Shader {
public:
enum class ShaderType {
None, Vertex, Fragment
};
private:
std::string code, filePath;
ShaderType shaderType;
unsigned int shaderID;
private:
static std::string readFile(const std::string& path);
void compileShader();
public:
Shader(const std::string& _code, const ShaderType& _shaderType);
Shader();
~Shader() = default;
Shader(const Shader& shader);
Shader(Shader&& shader) noexcept;
Shader& operator=(const Shader& shader);
public:
inline static Shader fromFile(const std::string& filePath, const ShaderType& shaderType) {
return Shader(readFile(filePath), shaderType);
}
inline static Shader fromCode(const std::string& code, const ShaderType& shaderType) {
return Shader(code, shaderType);
}
inline void deleteShader() { glDeleteShader(shaderID); }
public:
inline std::string& getCode() { return code; }
inline unsigned int getShaderID() const { return shaderID; }
inline ShaderType& getShaderType() { return shaderType; }
};
class ShaderProgram {
GENERATE_PTR(ShaderProgram)
private:
unsigned int shaderProgramID;
Shader vertexShader, fragmentShader;
public:
ShaderProgram(const Shader& _vertexShader, const Shader& _fragmentShader);
ShaderProgram();
ShaderProgram(const ShaderProgram& shaderProgram);
ShaderProgram(ShaderProgram&& shaderProgram) noexcept;
~ShaderProgram();
ShaderProgram& operator=(const ShaderProgram& shaderProgram);
private:
void link();
public:
void uniformInt(const std::string& uniform, int value);
void uniformFloat(const std::string& uniform, float value);
void uniformVec3(const std::string& uniform, const glm::vec3& vec);
void uniformMat4(const std::string& uniform, const glm::mat4& mat);
void uniformTextureArray(const std::string& uniform, std::vector<int>& textures);
public:
inline void useProgram() { glUseProgram(shaderProgramID); }
inline unsigned int getShaderProgramID() const { return shaderProgramID; }
inline Shader& getVertexShader() { return vertexShader; }
inline Shader& getFragmentShader() { return fragmentShader; }
};
================================================
FILE: src/engine/ptr.h
================================================
#pragma once
#include <iostream>
#include <memory>
#define GENERATE_PTR(clazz) public: \
using Ptr = std::shared_ptr<clazz>; \
template<class... Args> \
inline static Ptr New(Args&&... args) { \
return std::make_shared<clazz>(std::forward<Args>(args)...); \
}\
template<typename Base, typename T>
inline bool instanceof(const T *ptr) {
return dynamic_cast<const Base*>(ptr) != nullptr;
}
================================================
FILE: src/engine/renderer/Camera.cpp
================================================
#include "Camera.h"
Camera::Camera(const glm::mat4& _projectionMatrix, const glm::mat4& _viewMatrix)
: projectionMatrix(_projectionMatrix), viewMatrix(_viewMatrix), eye(glm::vec3(0, 0, 0)) {
}
void Camera::lookAt(const glm::vec3& eye, const glm::vec3& center, const glm::vec3& up) {
this->eye = eye;
this->center = center;
this->up = up;
viewMatrix = glm::lookAt(eye, center, up);
}
================================================
FILE: src/engine/renderer/Camera.h
================================================
#pragma once
#include <glm/vec3.hpp>
#include <glm/vec4.hpp>
#include <glm/mat4x4.hpp>
#include <glm/gtc/type_ptr.hpp>
#include "engine/ptr.h"
class Camera {
GENERATE_PTR(Camera)
protected:
glm::mat4 projectionMatrix;
glm::mat4 viewMatrix;
glm::vec3 eye, center, up;
Camera(const glm::mat4& _projectionMatrix, const glm::mat4& _viewMatrix);
public:
Camera() = default;
~Camera() = default;
public:
virtual void lookAt(const glm::vec3& eye, const glm::vec3& center, const glm::vec3& up);
inline glm::mat4& getProjectionMatrix() { return projectionMatrix; }
inline glm::mat4 getInverseProjectionMatrix() { return glm::inverse(projectionMatrix); }
virtual glm::mat4& getViewMatrix() { return viewMatrix; }
inline glm::mat4 getInverseViewMatrix() { return glm::inverse(viewMatrix); }
inline glm::mat4 getViewProjectionMatrix() { return projectionMatrix * viewMatrix; }
inline glm::mat4 getInverseViewProjectionMatrix() { return glm::inverse(getViewProjectionMatrix()); }
inline void setProjectionMatrix(const glm::mat4& projectionMatrix) { this->projectionMatrix = projectionMatrix; }
inline void setViewMatrix(const glm::mat4& viewMatrix) { this->viewMatrix = viewMatrix; }
virtual glm::vec3& getEye() { return eye; }
virtual glm::vec3& getCenter() { return center; }
virtual glm::vec3& getUp() { return up; }
inline void setEye(const glm::vec3& eye) { this->eye = eye; }
inline void setCenter(const glm::vec3& center) { this->center = center; }
inline void setUp(const glm::vec3& up) { this->up = up; }
};
================================================
FILE: src/engine/renderer/FPSCamera.cpp
================================================
#include "FPSCamera.h"
#include <iostream>
#define DEFAULT_SENSITIVITY 0.1
#define DEFAULT_CAMERA_SPEED 0.1
FPSCamera::FPSCamera(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix)
: Camera(projectionMatrix, viewMatrix), cameraFront(glm::vec3(0, 0, -1)), yaw(0.0f), pitch(0),
lastX(0), lastY(0), sensitivity(DEFAULT_SENSITIVITY), cameraSpeed(DEFAULT_CAMERA_SPEED) {
center = glm::vec3(0, 0, 0);
up = glm::vec3(0, -1, 0);
eye = glm::vec3(0, 0, 0);
this->viewMatrix = glm::lookAt(eye, center, up);
}
FPSCamera::Ptr FPSCamera::orthoCamera(float left, float right, float bottom, float top, float zNear, float zFar) {
glm::mat4 projection = glm::ortho(left, right, bottom, top, zNear, zFar);
glm::mat4 view(1.0f);
FPSCamera::Ptr camera = FPSCamera::New(projection, view);
return camera;
}
FPSCamera::Ptr FPSCamera::perspectiveCamera(float fovy, float aspect, float zNear, float zFar) {
glm::mat4 projection = glm::perspective(fovy, aspect, zNear, zFar);
glm::mat4 view(1.0f);
FPSCamera::Ptr camera = FPSCamera::New(projection, view);
return camera;
}
glm::mat4& FPSCamera::getViewMatrix() {
viewMatrix = glm::lookAt(eye, eye + cameraFront, up);
return viewMatrix;
}
void FPSCamera::move(const Movement& movement) {
switch (movement) {
case Movement::Forward:
eye += cameraSpeed * cameraFront;
break;
case Movement::Backward:
eye -= cameraSpeed * cameraFront;
break;
case Movement::Right:
eye += glm::normalize(glm::cross(cameraFront, up)) * cameraSpeed;
break;
case Movement::Left:
eye -= glm::normalize(glm::cross(cameraFront, up)) * cameraSpeed;
break;
default:
break;
}
}
void FPSCamera::lookAround(double xpos, double ypos) {
double xoffset = xpos - lastX;
double yoffset = lastY - ypos; // reversed since y-coordinates go from bottom to top
lastX = xpos;
lastY = ypos;
xoffset *= sensitivity;
yoffset *= sensitivity;
yaw -= xoffset;
pitch += yoffset;
// make sure that when pitch is out of bounds, screen doesn't get flipped
if (pitch > 89.0f) pitch = 89.0f;
if (pitch < -89.0f) pitch = -89.0f;
glm::vec3 direction;
direction.x = cos(glm::radians(yaw)) * cos(glm::radians(pitch));
direction.y = sin(glm::radians(pitch));
direction.z = sin(glm::radians(yaw)) * cos(glm::radians(pitch));
cameraFront = glm::normalize(direction);
}
================================================
FILE: src/engine/renderer/FPSCamera.h
================================================
#pragma once
#include "Camera.h"
class FPSCamera : public Camera {
GENERATE_PTR(FPSCamera)
public:
enum class Movement {
Forward, Backward, Right, Left
};
private:
glm::vec3 cameraFront;
unsigned int width, height;
float lastX, lastY;
float yaw, pitch;
float sensitivity, cameraSpeed;
public:
FPSCamera(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix);
FPSCamera() = default;
~FPSCamera() = default;
static FPSCamera::Ptr orthoCamera(float left, float right, float bottom, float top, float zNear, float zFar);
static FPSCamera::Ptr perspectiveCamera(float fovy, float aspect, float zNear, float zFar);
virtual glm::mat4& getViewMatrix() override;
virtual void move(const Movement& movement);
virtual void lookAround(double xpos, double ypos);
inline void setSensitivity(float sensitivity) { this->sensitivity = sensitivity; }
inline float getSensitivity() const { return sensitivity; }
inline void setCameraSpeed(float cameraSpeed) { this->cameraSpeed = cameraSpeed; }
inline float getCameraSpeed() const { return cameraSpeed; }
inline void setCameraFront(const glm::vec3& cameraFront) { this->cameraFront = cameraFront; }
inline glm::vec3& getCameraFront() { return cameraFront; }
inline unsigned int getWidth() const { return width; }
inline void setWidth(unsigned int width) { this->width = width; }
inline unsigned int getHeight() const { return height; }
inline void setHeight(unsigned int height) { this->height = height; }
};
================================================
FILE: src/engine/renderer/FrameCapturer.h
================================================
#pragma once
#include <iostream>
#include <GL/glew.h>
#include <glm/vec3.hpp>
#include "engine/opengl/buffer/FrameBuffer.h"
#include "engine/opengl/buffer/MultiSampleRenderBuffer.h"
#include "engine/texture/MultiSampleTexture.h"
class FrameCapturer {
GENERATE_PTR(FrameCapturer)
private:
unsigned int width, height;
unsigned int samples;
FrameBuffer::Ptr frameBuffer;
FrameBuffer::Ptr intermediateFrameBuffer;
MultiSampleTexture::Ptr textureColorBufferMultiSampled;
Texture::Ptr screenTexture;
MultiSampleRenderBuffer::Ptr rbo;
glm::vec3 backgroundColor;
public:
FrameCapturer(unsigned int _width, unsigned int _height, unsigned int _samples = 4)
: width(_width), height(_height), samples(_samples), backgroundColor(0.1f, 0.1f, 0.1f) {
updateViewPort(width, height, samples);
}
FrameCapturer()
: width(0), height(0), backgroundColor(0.1f, 0.1f, 0.1f) {
}
~FrameCapturer() = default;
public:
void updateViewPort(unsigned int width, unsigned int height, unsigned int samples = 4) {
this->width = width;
this->height = height;
this->samples = samples;
// Configure MSAA framebuffer
frameBuffer = FrameBuffer::New();
// Create a multisampled color attachment texture
textureColorBufferMultiSampled = MultiSampleTexture::New(width, height, samples);
frameBuffer->toTexture(GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, textureColorBufferMultiSampled->getID());
// Create a (also multisampled) renderbuffer object for depth and stencil attachments
rbo = MultiSampleRenderBuffer::New(width, height);
frameBuffer->setRenderBuffer(GL_DEPTH_STENCIL_ATTACHMENT, rbo->getID());
if (!frameBuffer->isComplete()) std::cout << "Error: framebuffer is not complete!" << std::endl;
frameBuffer->unbind();
// configure second post-processing framebuffer
intermediateFrameBuffer = FrameBuffer::New();
// create a color attachment texture
screenTexture = Texture::New(width, height);
intermediateFrameBuffer->toTexture(GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, screenTexture->getID());
if (!intermediateFrameBuffer->isComplete()) std::cout << "Error: Intermediate framebuffer is not complete!" << std::endl;
intermediateFrameBuffer->unbind();
}
void startCapturing() {
glDisable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
frameBuffer->bind();
glClearColor(backgroundColor.r, backgroundColor.g, backgroundColor.b, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
}
void finishCapturing() {
intermediateFrameBuffer->blitFrom(frameBuffer, width, height);
intermediateFrameBuffer->unbind();
glClearColor(backgroundColor.r, backgroundColor.g, backgroundColor.b, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
glDisable(GL_DEPTH_TEST);
}
void setBackgroundColor(float r, float g, float b) {
backgroundColor.r = r;
backgroundColor.g = g;
backgroundColor.b = b;
}
inline Texture::Ptr& getTexture() { return screenTexture; }
inline glm::vec3& getBackgroundColor() { return backgroundColor; }
};
================================================
FILE: src/engine/renderer/MouseRayCasting.cpp
================================================
#include "MouseRayCasting.h"
MouseRayCasting::MouseRayCasting(const Camera::Ptr& _camera, unsigned int _width, unsigned int _height)
: camera(_camera), width(_width), height(_height) {
}
glm::vec2 MouseRayCasting::getNormalizedDeviceCoords(const glm::vec2& mousePosition) {
float x = (2.0f * mousePosition.x) / width - 1.0f;
float y = (2.0f * mousePosition.y) / height - 1.0f;
return glm::vec2(x, y);
}
glm::vec4 MouseRayCasting::getHomogeneousClipCoords(const glm::vec2& normalizedDeviceCoords) {
return glm::vec4(normalizedDeviceCoords.x, normalizedDeviceCoords.y, -1.f, 1.f);
}
glm::vec4 MouseRayCasting::getEyeCoords(const glm::vec4& clipCoords) {
glm::vec4 eyeCoords = camera->getInverseProjectionMatrix() * clipCoords;
eyeCoords = glm::vec4(eyeCoords.x, eyeCoords.y, -1.0, 0.0);
return eyeCoords;
}
glm::vec3 MouseRayCasting::getWorldCoords(const glm::vec4& eyeCoords) {
glm::vec4 worldCoordinates = camera->getInverseViewMatrix() * eyeCoords;
glm::vec3 worldCoords(worldCoordinates.x, worldCoordinates.y, worldCoordinates.z);
worldCoords = glm::normalize(worldCoords);
return worldCoords;
}
MouseRayCasting::Ray MouseRayCasting::getRay(int mouseX, int mouseY) {
glm::vec2 normalizedDeviceCoords = getNormalizedDeviceCoords(glm::vec2(mouseX, mouseY));
glm::vec4 clipCoords = getHomogeneousClipCoords(normalizedDeviceCoords);
glm::vec4 eyeCoords = getEyeCoords(clipCoords);
glm::vec3 worldCoords = getWorldCoords(eyeCoords);
return Ray(camera->getEye(), worldCoords);
}
================================================
FILE: src/engine/renderer/MouseRayCasting.h
================================================
// Thanks to: https://antongerdelan.net/opengl/raycasting.html
#pragma once
#include "Camera.h"
class MouseRayCasting {
public:
/**
* r : (x, y, z) = (x0, y0, z0) + lambda * (v1, v2, v3)
* Where (x0, y0, z0) is the origin of the ray
* and (v1, v2, v3) is the direction vector of the ray
*/
struct Ray {
glm::vec3 rayDirection;
glm::vec3 origin;
Ray(const glm::vec3& _origin, const glm::vec3& _rayDirection)
: origin(_origin), rayDirection(_rayDirection) {
}
Ray() = default;
~Ray() = default;
glm::vec3 getPoint(double lambda) {
return glm::vec3(
origin.x + rayDirection.x * lambda,
origin.y + rayDirection.y * lambda,
origin.z + rayDirection.z * lambda
);
}
/**
* @brief Returns a 3D point which projection belongs to the Screen Plane (X, Y)
* @return glm::vec3
*/
inline glm::vec3 getScreenProjectedPoint() {
return getPoint(1);
}
};
private:
Camera::Ptr camera;
unsigned int width, height;
public:
MouseRayCasting(const Camera::Ptr& _camera, unsigned int _width, unsigned int _height);
MouseRayCasting() = default;
~MouseRayCasting() = default;
private:
glm::vec2 getNormalizedDeviceCoords(const glm::vec2& mousePosition);
glm::vec4 getHomogeneousClipCoords(const glm::vec2& normalizedDeviceCoords);
glm::vec4 getEyeCoords(const glm::vec4& clipCoords);
glm::vec3 getWorldCoords(const glm::vec4& eyeCoords);
public:
Ray getRay(int mouseX, int mouseY);
};
================================================
FILE: src/engine/renderer/Renderer.cpp
================================================
#include "Renderer.h"
#define SHADOW_MAP_WIDTH 1024
#define SHADOW_MAP_HEIGHT 1024
Renderer::Renderer(unsigned int _viewportWidth, unsigned int _viewportHeight)
: camera(nullptr),
hasCamera(false),
hasLight(false),
nLights(0),
projection(glm::mat4(1.f)),
view(glm::mat4(1.f)),
depthMapFBO(0),
depthMap(0),
viewportWidth(_viewportWidth),
viewportHeight(_viewportHeight),
shadowLightPos(0, 0, 0),
shadowMapping(false),
exposure(1.0f),
hdr(false),
gammaCorrection(false),
pbr(false),
backgroundColor(0.1f)
{
loadFunctionsGL();
initShaders();
enableBlending();
enableAntialiasing();
initShadowMapping();
initHDR();
initTextureQuad();
frameCapturer = FrameCapturer::New(viewportWidth, viewportHeight);
}
Renderer::Renderer()
: Renderer(0, 0) {
}
void Renderer::loadFunctionsGL() {
if (glewInit() != GLEW_OK) {
std::cout << "Couldn't initialize GLEW" << std::endl;
return;
}
}
void Renderer::initShaders() {
// Default shader program
Shader vertexShader = Shader::fromFile("glsl/Default.vert", Shader::ShaderType::Vertex);
Shader fragmentShader = Shader::fromFile("glsl/Default.frag", Shader::ShaderType::Fragment);
shaderProgram = ShaderProgram::New(vertexShader, fragmentShader);
// Lighting shader program
Shader vertexLightingShader = Shader::fromFile("glsl/BlinnPhong.vert", Shader::ShaderType::Vertex);
Shader fragmentLightingShader = Shader::fromFile("glsl/BlinnPhong.frag", Shader::ShaderType::Fragment);
shaderProgramLighting = ShaderProgram::New(vertexLightingShader, fragmentLightingShader);
// PBR shader program
Shader vertexPBRShader = Shader::fromFile("glsl/PBR.vert", Shader::ShaderType::Vertex);
Shader fragmentPBRShader = Shader::fromFile("glsl/PBR.frag", Shader::ShaderType::Fragment);
shaderProgramPBR = ShaderProgram::New(vertexPBRShader, fragmentPBRShader);
// Depth Map shader program
Shader vertexDepthMapShader = Shader::fromFile("glsl/SimpleDepth.vert", Shader::ShaderType::Vertex);
Shader fragmentDepthMapShader = Shader::fromFile("glsl/SimpleDepth.frag", Shader::ShaderType::Fragment);
shaderProgramDepthMap = ShaderProgram::New(vertexDepthMapShader, fragmentDepthMapShader);
// HDR shader program
Shader vertexHDRShader = Shader::fromFile("glsl/HDR.vert", Shader::ShaderType::Vertex);
Shader fragmentHDRShader = Shader::fromFile("glsl/HDR.frag", Shader::ShaderType::Fragment);
shaderProgramHDR = ShaderProgram::New(vertexHDRShader, fragmentHDRShader);
// SkyBox shader program
Shader vertexSkyBoxShader = Shader::fromFile("glsl/SkyBox.vert", Shader::ShaderType::Vertex);
Shader fragmentSkyBoxShader = Shader::fromFile("glsl/SkyBox.frag", Shader::ShaderType::Fragment);
shaderProgramSkyBox = ShaderProgram::New(vertexSkyBoxShader, fragmentSkyBoxShader);
// Selection shader program
Shader vertexSelectionShader = Shader::fromFile("glsl/Selection.vert", Shader::ShaderType::Vertex);
Shader fragmentSelectionShader = Shader::fromFile("glsl/Selection.frag", Shader::ShaderType::Fragment);
shaderProgramSelection = ShaderProgram::New(vertexSelectionShader, fragmentSelectionShader);
// Textured quad shader program
Shader vertexTexturedQuadShader = Shader::fromFile("glsl/TexturedQuad.vert", Shader::ShaderType::Vertex);
Shader fragmentTexturedQuadShader = Shader::fromFile("glsl/TexturedQuad.frag", Shader::ShaderType::Fragment);
shaderProgramTexturedQuad = ShaderProgram::New(vertexTexturedQuadShader, fragmentTexturedQuadShader);
}
void Renderer::initTextureQuad() {
std::vector<Vec3f> quadVertices = {
Vec3f(-1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f),
Vec3f(-1.0f, -1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f),
Vec3f( 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f),
Vec3f( 1.0f, -1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f)
};
quadVAO = VertexArray::New();
quadVBO = VertexBuffer::New(quadVertices);
quadVAO->unbind();
}
void Renderer::removeScene(Scene::Ptr& scene) {
unsigned int index = 0;
for(auto& s : scenes) {
if(s.get() == scene.get()) {
removeScene(index);
break;
}
index ++;
}
}
void Renderer::removeLight(Light& light) {
unsigned int index = 0;
for(Light* l : lights) {
if(l == &light) {
removeLight(index);
break;
}
index ++;
}
}
void Renderer::textureUniformDefault(ShaderProgram::Ptr& shaderProgram, Polytope::Ptr& polytope) {
std::vector<Texture::Ptr> textures = polytope->getTextures();
if(!textures.empty()) {
for(auto& texture : textures) {
const int uniformSlot = texture->getSlot() - 0x84C0;
if(texture->getType() == Texture::Type::TextureDiffuse) {
texture->bind();
shaderProgram->uniformInt("tex", uniformSlot);
shaderProgram->uniformInt("hasTexture", true);
}
}
}else shaderProgram->uniformInt("hasTexture", false);
}
void Renderer::textureUniformLighting(ShaderProgram::Ptr& shaderProgram, Polytope::Ptr& polytope) {
unsigned int nDiffuseMaps = 0, nSpecularMaps = 0, nEmissionMap = 0, nNormalMaps = 0, nDepthMaps = 0;
for(auto& texture : polytope->getTextures()) {
texture->bind();
const int uniformSlot = texture->getSlot() - 0x84C0;
switch(texture->getType()) {
case Texture::Type::TextureDiffuse:
shaderProgram->uniformInt("materialMaps.diffuseMap", uniformSlot);
nDiffuseMaps ++;
break;
case Texture::Type::TextureSpecular:
shaderProgram->uniformInt("materialMaps.specularMap", uniformSlot);
nSpecularMaps ++;
break;
case Texture::Type::TextureEmission:
shaderProgram->uniformInt("materialMaps.emissionMap", uniformSlot);
nEmissionMap ++;
break;
case Texture::Type::TextureNormal:
shaderProgram->uniformInt("materialMaps.normalMap", uniformSlot);
nNormalMaps ++;
break;
case Texture::Type::TextureHeight:
shaderProgram->uniformInt("materialMaps.depthMap", uniformSlot);
nDepthMaps ++;
break;
}
}
shaderProgram->uniformInt("hasDiffuse", nDiffuseMaps > 0);
shaderProgram->uniformInt("hasSpecular", nSpecularMaps > 0);
shaderProgram->uniformInt("hasNormalMap", nNormalMaps > 0);
shaderProgram->uniformInt("hasDepthMap", nDepthMaps > 0);
shaderProgram->uniformInt("hasEmission", nEmissionMap > 0);
const float heightScale = 0.1f;
shaderProgram->uniformFloat("heightScale", heightScale);
}
void Renderer::textureUniformPBR(ShaderProgram::Ptr& shaderProgram, Polytope::Ptr& polytope) {
unsigned int nAlbedoMaps = 0, nMetallicMaps = 0, nRoughnessMap = 0, nNormalMaps = 0,
nAmbientOcclusionMaps = 0, nEmissionMaps = 0, nDepthMaps = 0;
for(auto& texture : polytope->getTextures()) {
texture->bind();
const int uniformSlot = texture->getSlot() - 0x84C0;
switch(texture->getType()) {
case Texture::Type::TextureAlbedo:
shaderProgram->uniformInt("materialMaps.albedo", uniformSlot);
nAlbedoMaps ++;
break;
case Texture::Type::TextureMetallic:
shaderProgram->uniformInt("materialMaps.metallic", uniformSlot);
nMetallicMaps ++;
break;
case Texture::Type::TextureRoughness:
shaderProgram->uniformInt("materialMaps.roughness", uniformSlot);
nRoughnessMap ++;
break;
case Texture::Type::TextureNormal:
shaderProgram->uniformInt("materialMaps.normalMap", uniformSlot);
nNormalMaps ++;
break;
case Texture::Type::TextureHeight:
shaderProgram->uniformInt("materialMaps.depthMap", uniformSlot);
nDepthMaps ++;
break;
case Texture::Type::TextureAmbientOcclusion:
shaderProgram->uniformInt("materialMaps.ao", uniformSlot);
nAmbientOcclusionMaps ++;
break;
case Texture::Type::TextureEmission:
shaderProgram->uniformInt("materialMaps.emission", uniformSlot);
nEmissionMaps ++;
break;
}
}
shaderProgram->uniformInt("hasAlbedo", nAlbedoMaps > 0);
shaderProgram->uniformInt("hasMetallic", nMetallicMaps > 0);
shaderProgram->uniformInt("hasNormal", nNormalMaps > 0);
shaderProgram->uniformInt("hasDepthMap", nDepthMaps > 0);
shaderProgram->uniformInt("hasRoughness", nRoughnessMap > 0);
shaderProgram->uniformInt("hasAmbientOcclusion", nAmbientOcclusionMaps > 0);
shaderProgram->uniformInt("hasEmission", nEmissionMaps > 0);
const float heightScale = 0.5f;
shaderProgram->uniformFloat("heightScale", heightScale);
}
void Renderer::textureUniform(ShaderProgram::Ptr& shaderProgram, Polytope::Ptr& polytope) {
if(pbr) textureUniformPBR(shaderProgram, polytope);
else if(hasLight) textureUniformLighting(shaderProgram, polytope);
else textureUniformDefault(shaderProgram, polytope);
}
void Renderer::primitiveSettings(Group::Ptr& group) {
glPointSize(group->getPointSize());
glLineWidth(group->getLineWidth());
}
void Renderer::defaultPrimitiveSettings() {
glPointSize(1.0f);
glLineWidth(1.0f);
}
void Renderer::lightShaderUniforms() {
shaderProgramLighting->uniformInt("nLights", nLights);
for(int i = 0; i < nLights; i ++) {
float intensity = hdr ? lights[i]->getIntensity() : 1.0f;
// Directional Light
std::string lightUniform = "lights[" + std::to_string(i) + "]";
shaderProgramLighting->uniformVec3(lightUniform + ".position", lights[i]->getPosition());
shaderProgramLighting->uniformVec3(lightUniform + ".color", lights[i]->getColor() * intensity);
shaderProgramLighting->uniformVec3(lightUniform + ".ambient", lights[i]->getAmbient());
shaderProgramLighting->uniformVec3(lightUniform + ".diffuse", lights[i]->getDiffuse());
shaderProgramLighting->uniformVec3(lightUniform + ".specular", lights[i]->getSpecular());
// Point Light
if(instanceof<PointLight>(lights[i])) {
PointLight* pointLight = dynamic_cast<PointLight*>(lights[i]);
shaderProgramLighting->uniformInt(lightUniform + ".pointLight", true);
shaderProgramLighting->uniformFloat(lightUniform + ".constant", pointLight->getConstant());
shaderProgramLighting->uniformFloat(lightUniform + ".linear", pointLight->getLinear());
shaderProgramLighting->uniformFloat(lightUniform + ".quadratic", pointLight->getQuadratic());
}else shaderProgramLighting->uniformInt(lightUniform + ".pointLight", false);
}
shaderProgramLighting->uniformInt("blinn", Light::blinn);
shaderProgramLighting->uniformVec3("viewPos", camera->getEye());
shaderProgramLighting->uniformInt("shadowMapping", shadowMapping);
}
void Renderer::pbrShaderUniforms() {
shaderProgramPBR->uniformInt("nLights", nLights);
for(int i = 0; i < nLights; i ++) {
float intensity = hdr ? lights[i]->getIntensity() : 1.0f;
// Directional Light
std::string lightUniform = "lights[" + std::to_string(i) + "]";
shaderProgramPBR->uniformVec3(lightUniform + ".position", lights[i]->getPosition());
shaderProgramPBR->uniformVec3(lightUniform + ".color", lights[i]->getColor() * intensity);
// Point Light
if(instanceof<PointLight>(lights[i])) {
PointLight* pointLight = dynamic_cast<PointLight*>(lights[i]);
shaderProgramPBR->uniformInt(lightUniform + ".pointLight", true);
shaderProgramPBR->uniformFloat(lightUniform + ".constant", pointLight->getConstant());
shaderProgramPBR->uniformFloat(lightUniform + ".linear", pointLight->getLinear());
shaderProgramPBR->uniformFloat(lightUniform + ".quadratic", pointLight->getQuadratic());
}else shaderProgramPBR->uniformInt(lightUniform + ".pointLight", false);
}
shaderProgramPBR->uniformVec3("viewPos", camera->getEye());
//shaderProgramPBR->uniformInt("shadowMapping", shadowMapping);
}
void Renderer::lightMaterialUniforms(const Polytope::Ptr& polytope) {
Material::Ptr material = polytope->getMaterial();
// Phong materials
if(material->getMaterialType() == Material::MaterialType::Phong) {
PhongMaterial* phongMaterial = dynamic_cast<PhongMaterial*>(material.get());
shaderProgramLighting->uniformVec3("material.diffuse", phongMaterial->getDiffuse());
shaderProgramLighting->uniformVec3("material.specular", phongMaterial->getSpecular());
shaderProgramLighting->uniformFloat("material.shininess", phongMaterial->getShininess());
}
shaderProgramLighting->uniformFloat("emissionStrength", polytope->getEmissionStrength());
}
void Renderer::pbrMaterialUniforms(const Polytope::Ptr& polytope) {
Material::Ptr material = polytope->getMaterial();
// PBR materials
if(material->getMaterialType() == Material::MaterialType::PBR) {
PBRMaterial* pbrMaterial = dynamic_cast<PBRMaterial*>(material.get());
shaderProgramPBR->uniformVec3("material.albedo", pbrMaterial->getAlbedo());
shaderProgramPBR->uniformFloat("material.metallic", pbrMaterial->getMetallic());
shaderProgramPBR->uniformFloat("material.roughness", pbrMaterial->getRoughness());
shaderProgramPBR->uniformFloat("material.ao", pbrMaterial->getAmbientOcclusion());
}
}
void Renderer::mvpUniform(ShaderProgram::Ptr& shaderProgram, const glm::mat4& model) {
shaderProgram->uniformMat4("model", model);
shaderProgram->uniformMat4("view", view);
shaderProgram->uniformMat4("projection", projection);
}
void Renderer::lightMVPuniform(const glm::mat4& model) {
mvpUniform(shaderProgramLighting, model);
}
void Renderer::pbrMVPuniform(const glm::mat4& model) {
mvpUniform(shaderProgramPBR, model);
}
void Renderer::shadowMappingUniforms() {
if(!shadowMapping) return;
depthMap->bind();
shaderProgramLighting->uniformInt("shadowMap", depthMap->getID() - 1);
shaderProgramLighting->uniformMat4("lightSpaceMatrix", lightSpaceMatrix);
shaderProgramLighting->uniformVec3("lightPos", shadowLightPos);
}
void Renderer::setFaceCulling(const Polytope::Ptr& polytope) {
switch(polytope->getFaceCulling()) {
case Polytope::FaceCulling::FRONT:
enableFrontFaceCulling();
break;
case Polytope::FaceCulling::BACK:
enableBackFaceCulling();
break;
case Polytope::FaceCulling::NONE:
disableFaceCulling();
break;
}
}
void Renderer::setViewport(unsigned int viewportWidth, unsigned int viewportHeight) {
this->viewportWidth = viewportWidth;
this->viewportHeight = viewportHeight;
frameCapturer->updateViewPort(viewportWidth, viewportHeight);
}
void Renderer::initShadowMapping() {
depthMapFBO = FrameBuffer::New();
depthMap = DepthTexture::New(SHADOW_MAP_WIDTH, SHADOW_MAP_WIDTH);
depthMap->bind();
depthMapFBO->bind();
depthMapFBO->toTexture(GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, depthMap->getID());
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);
depthMapFBO->unbind();
shaderProgramLighting->useProgram();
shaderProgramLighting->uniformInt("shadowMap", depthMap->getID() - 1);
}
void Renderer::initHDR() {
hdrFBO = FrameBuffer::New();
colorBufferTexture = ColorBufferTexture::New(viewportWidth, viewportHeight);
colorBufferTexture->bind();
// create depth buffer (renderbuffer)
rboDepth = RenderBuffer::New(viewportWidth, viewportHeight);
// attach buffers
hdrFBO->bind();
hdrFBO->toTexture(GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorBufferTexture->getID());
hdrFBO->setRenderBuffer(GL_DEPTH_ATTACHMENT, rboDepth->getID());
if (!hdrFBO->isComplete()) std::cout << "Framebuffer not complete!" << std::endl;
hdrFBO->unbind();
}
void Renderer::renderScenesToDepthMap(std::vector<Scene::Ptr>& scenes) {
for(auto& scene : scenes) {
if(scene->isVisible()) {
// Render groups
for(auto& group : scene->getGroups()) {
if(!group->isVisible()) continue;
for(auto& polytope : group->getPolytopes()) {
glm::mat4 model = scene->getModelMatrix() * group->getModelMatrix() * polytope->getModelMatrix();
shaderProgramDepthMap->uniformMat4("model", model);
glCullFace(GL_BACK);
polytope->draw(group->getPrimitive(), group->isShowWire());
glCullFace(GL_FRONT);
}
}
// Render child scenes
renderScenesToDepthMap(scene->getScenes());
}
}
}
void Renderer::renderScenes(std::vector<Scene::Ptr>& scenes) {
for(auto& scene : scenes) {
if(scene->isVisible()) {
// Draw groups
for(auto& group : scene->getGroups()) {
if(group->isVisible()) drawGroup(scene, group);
}
// Draw child scenes
renderScenes(scene->getScenes());
}
}
}
void Renderer::renderToDepthMap() {
if(!hasLight) return;
loadPreviousFBO();
glViewport(0, 0, SHADOW_MAP_WIDTH, SHADOW_MAP_WIDTH);
depthMapFBO->bind();
// Shaders
float nearPlane = 0.1f, farPlane = 17.5f;
glm::mat4 lightProjection = glm::ortho(-10.f, 10.f, -10.f, 10.f, nearPlane, farPlane);
glm::mat4 lightView = glm::lookAt(shadowLightPos, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f));
lightSpaceMatrix = lightProjection * lightView;
shaderProgramDepthMap->useProgram();
shaderProgramDepthMap->uniformMat4("lightSpaceMatrix", lightSpaceMatrix);
// Draw
glClear(GL_DEPTH_BUFFER_BIT);
renderScenesToDepthMap(scenes);
bindPreviousFBO();
}
void Renderer::drawGroup(Scene::Ptr& scene, Group::Ptr& group) {
if(!group->isVisible()) return;
glViewport(0, 0, viewportWidth, viewportHeight);
primitiveSettings(group);
enableBlending();
glEnable(GL_DEPTH_TEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
for(auto& polytope : group->getPolytopes()) {
// Compute model matrix from polytope, group and scene
glm::mat4 model = scene->getModelMatrix() * group->getModelMatrix() * polytope->getModelMatrix();
glm::mat4 mvp = projection * view * model;
// PBR
if(pbr) {
shaderProgramPBR->useProgram();
pbrShaderUniforms();
pbrMaterialUniforms(polytope);
textureUniform(shaderProgramPBR, polytope);
pbrMVPuniform(model);
//shadowMappingUniforms();
}
// Phong lighting
else if(hasLight) {
shaderProgramLighting->useProgram();
lightShaderUniforms();
lightMaterialUniforms(polytope);
textureUniform(shaderProgramLighting, polytope);
lightMVPuniform(model);
shadowMappingUniforms();
}
// Default
else {
shaderProgram->useProgram();
shaderProgram->uniformMat4("mvp", mvp);
textureUniform(shaderProgram, polytope);
}
// Set face culling
setFaceCulling(polytope);
// Draw polytope
polytope->draw(group->getPrimitive(), group->isShowWire());
// Draw selected polytope if selected
if(polytope->isSelected()) {
shaderProgramSelection->useProgram();
shaderProgramSelection->uniformMat4("mvp", mvp);
glDisable(GL_DEPTH_TEST);
polytope->draw(group->getPrimitive(), group->isShowWire());
glEnable(GL_DEPTH_TEST);
}
// unbind textures
for(auto& texture : polytope->getTextures()) texture->unbind();
}
// Set default primitive settings
defaultPrimitiveSettings();
}
void Renderer::drawSkyBox() {
if(skyBox == nullptr) return;
shaderProgramSkyBox->useProgram();
// remove translation from the view matrix
view = glm::mat4(glm::mat3(camera->getViewMatrix()));
skyBox->getTextureCubeMap()->bind();
shaderProgramSkyBox->uniformInt("skybox", skyBox->getTextureCubeMap()->getID() - 1);
shaderProgramSkyBox->uniformMat4("view", view);
shaderProgramSkyBox->uniformMat4("projection", projection);
// Draw call
glDepthRange(0.999,1.0);
skyBox->bind();
skyBox->draw();
glDepthRange(0.0,1.0);
// set depth function back to default
glDepthFunc(GL_LESS);
}
void Renderer::renderQuad() {
shaderProgramHDR->useProgram();
shaderProgramHDR->uniformInt("hdr", hdr);
shaderProgramHDR->uniformFloat("exposure", exposure);
shaderProgramHDR->uniformInt("gammaCorrection", gammaCorrection);
colorBufferTexture->bind();
shaderProgramHDR->uniformInt("hdrBuffer", colorBufferTexture->getID() - 1);
quadVAO->bind();
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
quadVAO->unbind();
}
void Renderer::render() {
frameCapturer->startCapturing();
enableAntialiasing();
enableBlending();
if(hasCamera) {
projection = camera->getProjectionMatrix();
view = camera->getViewMatrix();
}
if(shadowMapping) renderToDepthMap();
// FBO HDR
if(hdr) {
loadPreviousFBO();
hdrFBO->bind();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
// Draw scenes
renderScenes(scenes);
// Draw skybox
drawSkyBox();
// Draw HDR texture to quad
if(hdr) {
bindPreviousFBO();
renderQuad();
}
frameCapturer->finishCapturing();
}
void Renderer::draw() {
render();
shaderProgramTexturedQuad->useProgram();
frameCapturer->getTexture()->bind();
shaderProgramTexturedQuad->uniformInt("tex", frameCapturer->getTexture()->getID() - 1);
quadVAO->bind();
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
quadVAO->unbind();
}
void Renderer::setBackgroundColor(float r, float g, float b) {
backgroundColor.r = r;
backgroundColor.g = g;
backgroundColor.b = b;
frameCapturer->setBackgroundColor(r, g, b);
}
void Renderer::setCamera(const Camera::Ptr& camera) {
hasCamera = true;
this->camera = camera;
}
void Renderer::addLight(Light& light) {
hasLight = true;
lights.push_back(&light);
nLights ++;
}
void Renderer::clear() {
glStencilMask(0xFF);
glClearColor(backgroundColor.r, backgroundColor.g, backgroundColor.b, 1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
}
void Renderer::enableBlending() {
glEnable(GL_BLEND & GL_DEPTH_TEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glDepthFunc(GL_LESS);
}
void Renderer::enableAntialiasing() {
glEnable(GL_MULTISAMPLE);
}
void Renderer::enableBackFaceCulling() {
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glFrontFace(GL_CCW);
}
void Renderer::enableFrontFaceCulling() {
glEnable(GL_CULL_FACE);
glCullFace(GL_FRONT);
glFrontFace(GL_CCW);
}
void Renderer::disableFaceCulling() {
glDisable(GL_CULL_FACE);
}
void Renderer::loadPreviousFBO() {
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &previousFBO);
}
void Renderer::bindPreviousFBO() {
glBindFramebuffer(GL_FRAMEBUFFER, previousFBO);
}
================================================
FILE: src/engine/renderer/Renderer.h
================================================
#pragma once
#include <iostream>
#include <vector>
#define GLEW_STATIC
#include <GL/glew.h>
#include "engine/group/Scene.h"
#include "engine/opengl/shader/Shader.h"
#include "Camera.h"
#include "engine/lighting/Light.h"
#include "engine/lighting/DirectionalLight.h"
#include "engine/lighting/PointLight.h"
#include "engine/lighting/PBRMaterial.h"
#include "engine/texture/DepthTexture.h"
#include "engine/texture/ColorBufferTexture.h"
#include "engine/opengl/buffer/FrameBuffer.h"
#include "engine/opengl/buffer/RenderBuffer.h"
#include "SkyBox.h"
#include "FrameCapturer.h"
class Renderer {
GENERATE_PTR(Renderer)
private:
// Shaders
ShaderProgram::Ptr shaderProgram;
ShaderProgram::Ptr shaderProgramLighting;
ShaderProgram::Ptr shaderProgramPBR;
ShaderProgram::Ptr shaderProgramDepthMap;
ShaderProgram::Ptr shaderProgramHDR;
ShaderProgram::Ptr shaderProgramSkyBox;
ShaderProgram::Ptr shaderProgramSelection;
ShaderProgram::Ptr shaderProgramTexturedQuad;
// Scenes visualization
glm::mat4 projection;
glm::mat4 view;
std::vector<Scene::Ptr> scenes;
// Camera
Camera::Ptr camera;
bool hasCamera;
// Lighting
std::vector<Light*> lights;
unsigned int nLights;
bool hasLight;
bool pbr;
// Previous FBO
int previousFBO;
// Shadow Mapping
FrameBuffer::Ptr depthMapFBO;
DepthTexture::Ptr depthMap;
glm::mat4 lightSpaceMatrix;
glm::vec3 shadowLightPos;
bool shadowMapping;
// HDR
FrameBuffer::Ptr hdrFBO;
ColorBufferTexture::Ptr colorBufferTexture;
RenderBuffer::Ptr rboDepth;
bool hdr;
float exposure;
bool gammaCorrection;
// Texture Quad
VertexArray::Ptr quadVAO;
VertexBuffer::Ptr quadVBO;
// Background and skybox
glm::vec3 backgroundColor;
SkyBox::Ptr skyBox;
unsigned int viewportWidth, viewportHeight;
// Frame capturer
FrameCapturer::Ptr frameCapturer;
public:
Renderer(unsigned int _viewportWidth, unsigned int _viewportHeight);
Renderer();
~Renderer() = default;
private:
void loadFunctionsGL();
void initShaders();
void initTextureQuad();
void textureUniformDefault(ShaderProgram::Ptr& shaderProgram, Polytope::Ptr& polytope);
void textureUniformLighting(ShaderProgram::Ptr& shaderProgram, Polytope::Ptr& polytope);
void textureUniformPBR(ShaderProgram::Ptr& shaderProgram, Polytope::Ptr& polytope);
void textureUniform(ShaderProgram::Ptr& shaderProgram, Polytope::Ptr& polytope);
void initShadowMapping();
void initHDR();
void primitiveSettings(Group::Ptr& group);
void defaultPrimitiveSettings();
void lightShaderUniforms();
void pbrShaderUniforms();
void lightMaterialUniforms(const Polytope::Ptr& polytope);
void pbrMaterialUniforms(const Polytope::Ptr& polytope);
void mvpUniform(ShaderProgram::Ptr& shaderProgram, const glm::mat4& model);
void lightMVPuniform(const glm::mat4& model);
void pbrMVPuniform(const glm::mat4& model);
void shadowMappingUniforms();
void renderScenesToDepthMap(std::vector<Scene::Ptr>& scenes);
void renderScenes(std::vector<Scene::Ptr>& scenes);
void renderToDepthMap();
void renderQuad();
void drawGroup(Scene::Ptr& scene, Group::Ptr& group);
void drawSkyBox();
void loadPreviousFBO();
void bindPreviousFBO();
public:
void removeScene(Scene::Ptr& scene);
void removeLight(Light& light);
/**
* Renders the whole scene into the frame capturer texture
*
* You can get it and draw it in ImGui... etc
*/
void render();
/**
* Renders the whole scene into the frame capturer texture
* and then it draws the texture in a quad
*/
void draw();
void setBackgroundColor(float r, float g, float b);
void setCamera(const Camera::Ptr& camera);
void addLight(Light& light);
void clear();
void enableBlending();
void enableAntialiasing();
void enableBackFaceCulling(); // Counter-clockwise order
void enableFrontFaceCulling(); // Counter-clockwise order
void disableFaceCulling();
void setFaceCulling(const Polytope::Ptr& polytope);
void setViewport(unsigned int viewportWidth, unsigned int viewportHeight);
public:
inline void addScene(Scene::Ptr& scene) { scenes.push_back(scene); }
inline void removeScene(int index) { scenes.erase(scenes.begin() + index); }
inline Scene::Ptr getScene(int index) { return scenes[index]; }
inline std::vector<Scene::Ptr>& getScenes() { return scenes; }
inline Camera::Ptr getCamera() { return camera; }
inline void enableLight() { hasLight = true; }
inline void disableLight() { hasLight = false; }
inline void setLightEnabled(bool enable) { hasLight = enable; }
inline void removeLight(int index) { lights.erase(lights.begin() + index); nLights --; }
inline Light* getLight(int index) { return lights[index]; }
inline std::vector<Light*>& getLights() { return lights; }
inline void enablePBR() { pbr = true; }
inline void disablePBR() { pbr = false; }
inline void setPBREnabled(bool enable) { pbr = enable; }
inline void setShadowLightPos(const glm::vec3& shadowLightPos) { this->shadowLightPos = shadowLightPos; }
inline glm::vec3& getShadowLightPos() { return shadowLightPos; }
inline void setShadowMapping(bool shadowMapping) { this->shadowMapping = shadowMapping; }
inline bool isShadowMapping() const { return shadowMapping; }
inline ShaderProgram::Ptr& getShaderProgram() { return shaderProgram; }
inline glm::vec3& getBackgroundColor() { return backgroundColor; }
inline void setSkyBox(const SkyBox::Ptr& skyBox) { this->skyBox = skyBox; }
inline void setViewportWidth(unsigned int viewportWidth) { this->viewportWidth = viewportWidth; }
inline unsigned int getViewportWidth() const { return viewportWidth; }
inline void setViewportHeight(unsigned int viewportHeight) { this->viewportHeight = viewportHeight; }
inline unsigned int getViewportHeight() const { return viewportHeight; }
inline DepthTexture::Ptr& getDepthMap() { return depthMap; }
inline void setHDR(bool hdr) { this->hdr = hdr; }
inline bool isHDR() const { return hdr; }
inline void setExposure(float exposure) { this->exposure = exposure; }
inline float getExposure() const { return exposure; }
inline void setGammaCorrection(bool gammaCorrection) { this->gammaCorrection = gammaCorrection; }
inline bool isGammaCorrection() const { return gammaCorrection; }
inline FrameCapturer::Ptr getFrameCapturer() { return frameCapturer; }
};
================================================
FILE: src/engine/renderer/SkyBox.cpp
================================================
#include "SkyBox.h"
#include "engine/texture/Texture.h"
#include "engine/Vec3.h"
SkyBox::SkyBox(const std::vector<std::string>& _faces)
: Buffer(), faces(_faces) {
initBuffer();
}
SkyBox::~SkyBox() {
unbind();
}
void SkyBox::initBuffer() {
std::vector<Vec3f> sbv = {
Vec3f(-1.0f, 1.0f, -1.0f), Vec3f(-1.0f, -1.0f, -1.0f), Vec3f(1.0f, -1.0f, -1.0f ),
Vec3f(1.0f, -1.0f, -1.0f ), Vec3f(1.0f, 1.0f, -1.0f ), Vec3f(-1.0f, 1.0f, -1.0f),
Vec3f(-1.0f, -1.0f, 1.0f), Vec3f(-1.0f, -1.0f, -1.0f), Vec3f(-1.0f, 1.0f, -1.0f),
Vec3f(-1.0f, 1.0f, -1.0f), Vec3f(-1.0f, 1.0f, 1.0f), Vec3f(-1.0f, -1.0f, 1.0f),
Vec3f(1.0f, -1.0f, -1.0f), Vec3f(1.0f, -1.0f, 1.0f), Vec3f(1.0f, 1.0f, 1.0f),
Vec3f(1.0f, 1.0f, 1.0f), Vec3f(1.0f, 1.0f, -1.0f), Vec3f(1.0f, -1.0f, -1.0f),
Vec3f(-1.0f, -1.0f, 1.0f), Vec3f(-1.0f, 1.0f, 1.0f), Vec3f(1.0f, 1.0f, 1.0f ),
Vec3f(1.0f, 1.0f, 1.0f ), Vec3f(1.0f, -1.0f, 1.0f ), Vec3f(-1.0f, -1.0f, 1.0f),
Vec3f(-1.0f, 1.0f, -1.0f), Vec3f(1.0f, 1.0f, -1.0f ), Vec3f(1.0f, 1.0f, 1.0f ),
Vec3f(1.0f, 1.0f, 1.0f ), Vec3f(-1.0f, 1.0f, 1.0f), Vec3f(-1.0f, 1.0f, -1.0f),
Vec3f(-1.0f, -1.0f, -1.0f), Vec3f(-1.0f, -1.0f, 1.0f), Vec3f(1.0f, -1.0f, -1.0f ),
Vec3f(1.0f, -1.0f, -1.0f ), Vec3f(-1.0f, -1.0f, 1.0f), Vec3f(1.0f, -1.0f, 1.0f)
};
vertexArray = VertexArray::New();
vertexBuffer = VertexBuffer::New(sbv);
cubeMap = CubeMapTexture::New(faces);
unbind();
}
void SkyBox::bind() {
vertexArray->bind();
}
void SkyBox::unbind() {
vertexArray->unbind();
}
void SkyBox::draw() {
glDepthFunc(GL_LEQUAL);
glDrawArrays(GL_TRIANGLES, 0, 36);
glDepthFunc(GL_LESS);
}
================================================
FILE: src/engine/renderer/SkyBox.h
================================================
#pragma once
#include <iostream>
#include <vector>
#include <memory>
#include "engine/opengl/buffer/VertexArray.h"
#include "engine/opengl/buffer/VertexBuffer.h"
#include "engine/opengl/shader/Shader.h"
#include "engine/texture/CubeMapTexture.h"
class SkyBox : public Buffer {
GENERATE_PTR(SkyBox)
private:
VertexArray::Ptr vertexArray;
VertexBuffer::Ptr vertexBuffer;
std::vector<std::string> faces;
CubeMapTexture::Ptr cubeMap;
public:
SkyBox() = default;
/**
Loads a cubemap texture from 6 individual texture faces
order:
+X (right)
-X (left)
+Y (top)
-Y (bottom)
+Z (front)
-Z (back)
*/
SkyBox(const std::vector<std::string>& _faces);
~SkyBox();
private:
void initBuffer() override;
public:
void bind() override;
void unbind() override;
void draw();
public:
inline std::vector<std::string>& getFaces() { return faces; }
inline VertexArray::Ptr& getVertexArray() { return vertexArray; }
inline CubeMapTexture::Ptr& getTextureCubeMap() { return cubeMap; }
};
================================================
FILE: src/engine/renderer/TrackballCamera.cpp
================================================
#include "TrackballCamera.h"
#include <iostream>
TrackballCamera::TrackballCamera(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix)
: Camera(projectionMatrix, viewMatrix), theta(M_PI), phi(M_PI * 2), radius(0) {
}
TrackballCamera::Ptr TrackballCamera::orthoCamera(float left, float right, float bottom, float top, float zNear, float zFar) {
glm::mat4 projection = glm::ortho(left, right, bottom, top, zNear, zFar);
glm::mat4 view(1.0f);
TrackballCamera::Ptr camera = TrackballCamera::New(projection, view);
camera->lookAt(glm::vec3(0, 0, 1), glm::vec3(0, 0, 0), glm::vec3(0, 1, 0));
return camera;
}
TrackballCamera::Ptr TrackballCamera::perspectiveCamera(float fovy, float aspect, float zNear, float zFar) {
glm::mat4 projection = glm::perspective(fovy, aspect, zNear, zFar);
glm::mat4 view(1.0f);
TrackballCamera::Ptr camera = TrackballCamera::New(projection, view);
camera->lookAt(glm::vec3(0, 0, 1), glm::vec3(0, 0, 0), glm::vec3(0, 1, 0));
return camera;
}
glm::vec4 TrackballCamera::toCartesianCoords() {
return glm::vec4(
radius * sinf(phi) * sinf(theta),
radius * cosf(phi),
radius * sinf(phi) * cosf(theta),
1
);
}
glm::vec3 TrackballCamera::getCameraPosition() {
glm::vec4 cartesianCoords = toCartesianCoords();
glm::vec3 cameraPosition(center.x + cartesianCoords.x, center.y + cartesianCoords.y, center.z + cartesianCoords.z);
return cameraPosition;
}
glm::mat4& TrackballCamera::getViewMatrix() {
eye = getCameraPosition();
lookAt(eye, center, up);
return viewMatrix;
}
void TrackballCamera::rotate(float dTheta, float dPhi) {
if (up.y > 0.0f) theta += dTheta;
else theta -= dTheta;
phi += dPhi;
// If phi is between 0 to PI or -PI to -2PI, make 'up' be positive Y, other wise make it negative Y
const float PI2 = 2 * M_PI;
if(phi > PI2) phi -= PI2;
else if(phi < -PI2) phi += PI2;
// If phi is between 0 to PI or -PI to -2PI, make 'up' be positive Y, other wise make it negative Y
if ((phi > 0 && phi < M_PI) || (phi < -M_PI && phi > -PI2)) up.y = 1.0f;
else up.y = -1.0f;
}
void TrackballCamera::pan(float dx, float dy) {
glm::mat3 invView = glm::inverse(viewMatrix);
glm::vec3 Dx = invView * glm::vec3(1.0f, 0.0f, 0.0f);
glm::vec3 Dy = invView * glm::vec3(0.0f, 1.0f, 0.0f);
center += (Dy * dy - Dx * dx);
}
void TrackballCamera::zoom(float dRadius) {
radius -= dRadius;
if(radius <= 0.1) radius = 0.1;
}
================================================
FILE: src/engine/renderer/TrackballCamera.h
================================================
#pragma once
#include "Camera.h"
class TrackballCamera : public Camera {
GENERATE_PTR(TrackballCamera)
private:
float theta, phi;
float radius;
private:
glm::vec4 toCartesianCoords();
glm::vec3 getCameraPosition();
public:
TrackballCamera(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix);
TrackballCamera() = default;
~TrackballCamera() = default;
static TrackballCamera::Ptr orthoCamera(float left, float right, float bottom, float top, float zNear, float zFar);
static TrackballCamera::Ptr perspectiveCamera(float fovy, float aspect, float zNear, float zFar);
virtual glm::mat4& getViewMatrix() override;
void rotate(float dTheta, float dPhi);
void pan(float dx, float dy);
void zoom(float dRadius);
inline void setTheta(float theta) { this->theta = theta; }
inline void setPhi(float phi) { this->phi = phi; }
inline void setRadius(float radius) { this->radius = radius; }
inline float getTheta() const { return theta; }
inline float getPhi() const { return phi; }
inline float getRadius() const { return radius; };
};
================================================
FILE: src/engine/shapes/Cube.cpp
================================================
#include "Cube.h"
#include <iostream>
#include <vector>
#include "engine/Vec3.h"
std::vector<Vec3f> vertices =
{
Vec3f(-0.5f, -0.5f, -0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f),
Vec3f( 0.5f, 0.5f, -0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, -1.0f, 1.0f, 1.0f),
Vec3f( 0.5f, -0.5f, -0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f),
Vec3f( 0.5f, 0.5f, -0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, -1.0f, 1.0f, 1.0f),
Vec3f(-0.5f, -0.5f, -0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f),
Vec3f(-0.5f, 0.5f, -0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f),
Vec3f(-0.5f, -0.5f, 0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f),
Vec3f( 0.5f, -0.5f, 0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f),
Vec3f( 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f),
Vec3f( 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f),
Vec3f(-0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f),
Vec3f(-0.5f, -0.5f, 0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f),
Vec3f(-0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f),
Vec3f(-0.5f, 0.5f, -0.5f, 1.0f, 1.0f, 1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f),
Vec3f(-0.5f, -0.5f, -0.5f, 1.0f, 1.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f),
Vec3f(-0.5f, -0.5f, -0.5f, 1.0f, 1.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f),
Vec3f(-0.5f, -0.5f, 0.5f, 1.0f, 1.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f),
Vec3f(-0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f),
Vec3f( 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f),
Vec3f( 0.5f, -0.5f, -0.5f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f),
Vec3f( 0.5f, 0.5f, -0.5f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f),
Vec3f( 0.5f, -0.5f, -0.5f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f),
Vec3f( 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f),
Vec3f( 0.5f, -0.5f, 0.5f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f),
Vec3f(-0.5f, -0.5f, -0.5f, 1.0f, 1.0f, 1.0f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f),
Vec3f( 0.5f, -0.5f, -0.5f, 1.0f, 1.0f, 1.0f, 0.0f, -1.0f, 0.0f, 1.0f, 1.0f),
Vec3f( 0.5f, -0.5f, 0.5f, 1.0f, 1.0f, 1.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f),
Vec3f( 0.5f, -0.5f, 0.5f, 1.0f, 1.0f, 1.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f),
Vec3f(-0.5f, -0.5f, 0.5f, 1.0f, 1.0f, 1.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f),
Vec3f(-0.5f, -0.5f, -0.5f, 1.0f, 1.0f, 1.0f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f),
Vec3f(-0.5f, 0.5f, -0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f),
Vec3f( 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f),
Vec3f( 0.5f, 0.5f, -0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f),
Vec3f( 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f),
Vec3f(-0.5f, 0.5f, -0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f),
Vec3f(-0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f)
};
Cube::Cube()
: Shape(vertices) {
}
================================================
FILE: src/engine/shapes/Cube.h
================================================
#pragma once
#include "Shape.h"
class Cube : public Shape {
GENERATE_PTR(Cube)
public:
Cube();
virtual ~Cube() = default;
};
================================================
FILE: src/engine/shapes/Shape.cpp
================================================
#include "Shape.h"
Shape::Shape(size_t length)
: Polytope(length) {
}
Shape::Shape(Polytope::Ptr polytope)
: Polytope(*polytope) {
}
Shape::Shape(std::vector<Vec3f>& vertices, bool tangentAndBitangents)
: Polytope(vertices, tangentAndBitangents) {
}
Shape::Shape(std::vector<Vec3f>& vertices, std::vector<unsigned int>& indices, bool tangentAndBitangents)
: Polytope(vertices, indices, tangentAndBitangents) {
}
================================================
FILE: src/engine/shapes/Shape.h
================================================
#pragma once
#include "engine/group/Polytope.h"
class Shape : public Polytope {
GENERATE_PTR(Shape)
public:
Shape() = default;
Shape(size_t length);
Shape(Polytope::Ptr polytope);
Shape(std::vector<Vec3f>& vertices, bool tangentAndBitangents = true);
Shape(std::vector<Vec3f>& vertices, std::vector<unsigned int>& indices, bool tangentAndBitangents = true);
virtual ~Shape() = default;
};
================================================
FILE: src/engine/shapes/Sphere.cpp
================================================
#include "Sphere.h"
#define DEFAULT_RADIUS 1
#define DEFAULT_LATITUDES 64
#define DEFAULT_LONGITUDES 64
Sphere::Sphere()
: Sphere(DEFAULT_RADIUS, DEFAULT_LATITUDES, DEFAULT_LONGITUDES) {
}
Sphere::Sphere(float radius, int latitudes, int longitudes)
: Shape(createSphere(radius, latitudes, longitudes)) {
}
Polytope::Ptr Sphere::createSphere(float radius, int latitudes, int longitudes) {
Polytope::Ptr polytope = nullptr;
std::vector<unsigned int> sphereIndices;
if(longitudes < 3) longitudes = 3;
if(latitudes < 2) latitudes = 2;
std::vector<glm::vec3> vertices;
std::vector<glm::vec3> normals;
std::vector<glm::vec2> uv;
std::vector<unsigned int> indices;
std::vector<Vec3f> vert;
float nx, ny, nz, lengthInv = 1.0f / radius;
struct Vertex {
float x, y, z, s, t;
};
float deltaLatitude = M_PI / latitudes;
float deltaLongitude = 2 * M_PI / longitudes;
float latitudeAngle;
float longitudeAngle;
for (int i = 0; i <= latitudes; ++i) {
latitudeAngle = M_PI / 2 - i * deltaLatitude;
float xy = radius * cosf(latitudeAngle);
float z = radius * sinf(latitudeAngle);
for (int j = 0; j <= longitudes; ++j) {
longitudeAngle = j * deltaLongitude;
Vertex vertex;
vertex.x = xy * cosf(longitudeAngle);
vertex.y = xy * sinf(longitudeAngle);
vertex.z = z;
vertex.s = (float) j / longitudes;
vertex.t = (float) i / latitudes;
vertices.push_back(glm::vec3(vertex.x, vertex.y, vertex.z));
uv.push_back(glm::vec2(vertex.s, vertex.t));
nx = vertex.x * lengthInv;
ny = vertex.y * lengthInv;
nz = vertex.z * lengthInv;
normals.push_back(glm::vec3(nx, ny, nz));
Vec3f v(vertex.x, vertex.y, vertex.z, 1.0f, 1.0f, 1.0f, nx, ny, nz, vertex.s, vertex.t);
vert.push_back(v);
}
}
unsigned int k1, k2;
for(int i = 0; i < latitudes; ++i) {
k1 = i * (longitudes + 1);
k2 = k1 + longitudes + 1;
for(int j = 0; j < longitudes; ++j, ++k1, ++k2) {
if (i != 0) {
indices.push_back(k1 + 1);
indices.push_back(k2);
indices.push_back(k1);
}
if (i != (latitudes - 1)) {
indices.push_back(k2 + 1);
indices.push_back(k2);
indices.push_back(k1 + 1);
}
}
}
polytope = Polytope::New(vert, indices);
return polytope;
}
================================================
FILE: src/engine/shapes/Sphere.h
================================================
#pragma once
#include "Shape.h"
class Sphere : public Shape {
GENERATE_PTR(Sphere)
public:
Sphere();
Sphere(float radius, int latitudes, int longitudes);
virtual ~Sphere() = default;
private:
Polytope::Ptr createSphere(float radius, int latitudes, int longitudes);
};
================================================
FILE: src/engine/texture/ColorBufferTexture.cpp
================================================
#include "ColorBufferTexture.h"
ColorBufferTexture::ColorBufferTexture(int _width, int _height)
: Texture() {
width = _width;
height = _height;
bpp = 3;
type = Type::TextureColorBuffer;
generateTexture();
}
void ColorBufferTexture::generateTexture() {
glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_2D, id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, width, height, 0, GL_RGBA, GL_FLOAT, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
slot = 0x84C0 + count;
count ++;
}
================================================
FILE: src/engine/texture/ColorBufferTexture.h
================================================
#pragma once
#include "Texture.h"
class ColorBufferTexture : public Texture {
GENERATE_PTR(ColorBufferTexture)
public:
ColorBufferTexture(int _width, int _height);
ColorBufferTexture() = default;
~ColorBufferTexture() = default;
private:
void generateTexture() override;
};
================================================
FILE: src/engine/texture/CubeMapTexture.cpp
================================================
#include "CubeMapTexture.h"
CubeMapTexture::CubeMapTexture(const std::vector<std::string>& _faces)
: Texture(), faces(_faces) {
type = Type::TextureCubeMap;
generateTexture();
}
void CubeMapTexture::generateTexture() {
glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_CUBE_MAP, id);
for (unsigned int i = 0; i < faces.size(); i++) {
Image image = readImage(faces[i]);
if (image.data)
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_RGB, image.width, image.height, 0, GL_RGB, GL_UNSIGNED_BYTE, image.data);
else {
std::cout << "Cubemap texture failed to load at path: " << faces[i] << std::endl;
return;
}
}
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
slot = 0x84C0 + count;
count ++;
}
void CubeMapTexture::bind() {
glActiveTexture(slot);
glBindTexture(GL_TEXTURE_CUBE_MAP, id);
}
void CubeMapTexture::unbind() {
glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
}
================================================
FILE: src/engine/texture/CubeMapTexture.h
================================================
#pragma once
#include <iostream>
#include <vector>
#include "Texture.h"
class CubeMapTexture : public Texture {
GENERATE_PTR(CubeMapTexture)
private:
std::vector<std::string> faces;
public:
CubeMapTexture(const std::vector<std::string>& _faces);
CubeMapTexture() = default;
~CubeMapTexture() = default;
private:
void generateTexture() override;
public:
void bind() override;
void unbind() override;
public:
inline std::vector<std::string>& getFaces() { return faces; }
};
================================================
FILE: src/engine/texture/DepthTexture.cpp
================================================
#include "DepthTexture.h"
DepthTexture::DepthTexture(int _width, int _height)
: Texture() {
width = _width;
height = _height;
bpp = 1;
type = Type::TextureDepth;
generateTexture();
}
void DepthTexture::generateTexture() {
glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_2D, id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, width, height, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
float borderColor[] = { 1.0f, 1.0f, 1.0f, 1.0f };
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor);
slot = 0x84C0 + count;
count ++;
}
================================================
FILE: src/engine/texture/DepthTexture.h
================================================
#pragma once
#include "Texture.h"
class DepthTexture : public Texture {
GENERATE_PTR(DepthTexture)
public:
DepthTexture(int _width, int _height);
DepthTexture() = default;
~DepthTexture() = default;
private:
void generateTexture() override;
};
================================================
FILE: src/engine/texture/MultiSampleTexture.cpp
================================================
#include "MultiSampleTexture.h"
MultiSampleTexture::MultiSampleTexture(unsigned int width, unsigned int height, unsigned int _samples)
: Texture(), samples(_samples) {
this->width = width;
this->height = height;
generateTexture();
}
void MultiSampleTexture::generateTexture() {
glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, id);
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, samples, GL_RGBA, width, height, GL_TRUE);
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, 0);
slot = 0x84C0 + count;
count ++;
}
void MultiSampleTexture::bind() {
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, id);
}
void MultiSampleTexture::unbind() {
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, 0);
}
================================================
FILE: src/engine/texture/MultiSampleTexture.h
================================================
#pragma once
#include "Texture.h"
class MultiSampleTexture : public Texture {
GENERATE_PTR(MultiSampleTexture)
protected:
unsigned int samples;
public:
MultiSampleTexture(unsigned int width, unsigned int height, unsigned int _samples = 4);
MultiSampleTexture() = default;
~MultiSampleTexture() = default;
protected:
void generateTexture() override;
public:
void bind() override;
void unbind() override;
public:
inline unsigned int getSamples() const { return samples; }
};
================================================
FILE: src/engine/texture/Texture.cpp
================================================
#include "Texture.h"
#define STB_IMAGE_IMPLEMENTATION
#include "vendor/stb_image.h"
unsigned int Texture::count = 0;
int Texture::textureUnits = 0;
Image readImage(const std::string& path) {
Image image;
image.data = stbi_load(path.c_str(), &image.width, &image.height, &image.bpp, STBI_rgb);
return image;
}
Texture::Texture(const std::string& _path, const Type& _type, bool _flip)
: path(_path), id(0), width(0), height(0), bpp(0), slot(0), type(_type),
flip(_flip), freeGPU(true) {
initTextureUnits();
//if(count < textureUnits) generateTexture();
generateTextureFromFile(path);
}
Texture::Texture(unsigned char *buffer, const Type &_type)
: path(""), id(0), width(0), height(0), bpp(0), slot(0), type(_type),
flip(false), freeGPU(true) {
initTextureUnits();
generateTextureFromBuffer(buffer);
}
Texture::Texture(unsigned int _width, unsigned int _height, const Type& _type)
: path(""), id(0), width(_width), height(_height), bpp(0), slot(0), type(_type),
flip(false), freeGPU(true) {
initTextureUnits();
generateTexture();
}
Texture::Texture()
: id(0), width(0), height(0), bpp(0), path(""), slot(0), type(Type::None),
flip(false), freeGPU(true) {
initTextureUnits();
}
Texture::Texture(const Texture& texture)
: path(texture.path), id(texture.id), width(texture.width),
height(texture.height), bpp(texture.bpp), slot(texture.slot), type(texture.type),
freeGPU(false) {
}
Texture::Texture(Texture&& texture) noexcept
: path(std::move(texture.path)), id(texture.id), width(texture.width),
height(texture.height), bpp(texture.bpp), slot(texture.slot), type(texture.type),
freeGPU(true) {
}
Texture::~Texture() {
unbind();
glActiveTexture(0);
if(freeGPU) glDeleteTextures(1, &id);
}
Texture& Texture::operator=(const Texture& texture) {
id = texture.id;
width = texture.width;
height = texture.height;
bpp = texture.bpp;
slot = texture.slot;
path = texture.path;
type = texture.type;
freeGPU = false;
return *this;
}
void Texture::generateTexture() {
glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_2D, id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
slot = 0x84C0 + count;
count++;
}
void Texture::loadTexture(unsigned char* buffer) {
glBindTexture(GL_TEXTURE_2D, id);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
glGenerateMipmap(GL_TEXTURE_2D);
}
void Texture::generateTextureFromBuffer(unsigned char* buffer) {
glGenTextures(1, &id);
loadTexture(buffer);
slot = 0x84C0 + count;
count++;
}
void Texture::generateTextureFromFile(const std::string& path) {
stbi_set_flip_vertically_on_load(flip);
unsigned char* data = stbi_load(path.c_str(), &width, &height, &bpp, STBI_rgb_alpha);
generateTextureFromBuffer(data);
if (data) stbi_image_free(data);
}
void Texture::bind() {
glActiveTexture(slot);
glBindTexture(GL_TEXTURE_2D, id);
}
void Texture::unbind() {
glBindTexture(GL_TEXTURE_2D, 0);
}
void Texture::changeTexture(const std::string& path) {
stbi_set_flip_vertically_on_load(flip);
unsigned char* data = stbi_load(path.c_str(), &width, &height, &bpp, STBI_rgb_alpha);
loadTexture(data);
if (data) stbi_image_free(data);
}
================================================
FILE: src/engine/texture/Texture.h
================================================
#pragma once
#include <iostream>
#include <memory>
#include <GL/glew.h>
#include "engine/ptr.h"
struct Image {
unsigned char* data;
int width, height, bpp;
~Image() {
if(data != nullptr) free(data);
}
};
Image readImage(const std::string& path);
class Texture {
GENERATE_PTR(Texture)
public:
enum class Type : int {
None = -1,
TextureAmbient = 0,
TextureDiffuse = 1,
TextureSpecular = 2,
TextureNormal = 3,
TextureHeight = 4,
TextureEmission = 5,
TextureDepth = 6,
TextureColorBuffer = 7,
TextureCubeMap = 8,
TextureAlbedo = 9,
TextureMetallic = 10,
TextureRoughness = 11,
TextureAmbientOcclusion = 12
};
static int textureUnits;
static unsigned int count;
protected:
int slot;
unsigned int id;
int width, height, bpp;
bool flip;
std::string path;
Type type;
bool freeGPU;
public:
Texture(const std::string& _path, const Type& _type = Type::TextureDiffuse, bool _flip = true);
Texture(unsigned char* buffer, const Type& _type = Type::TextureDiffuse);
Texture(unsigned int _width, unsigned int _height, const Type& _type = Type::TextureDiffuse);
Texture(const Texture& texture);
Texture(Texture&& texture) noexcept;
Texture();
virtual ~Texture();
Texture& operator=(const Texture& texture);
protected:
inline void initTextureUnits() { glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &Texture::textureUnits); }
void loadTexture(unsigned char* buffer);
void generateTextureFromBuffer(unsigned char* buffer);
void generateTextureFromFile(const std::string& path);
virtual void generateTexture();
public:
virtual void bind();
virtual void unbind();
void changeTexture(const std::string& path);
public:
inline void changeTexture(unsigned char* buffer) { loadTexture(buffer); }
inline void setID(unsigned int id) { this->id = id; }
inline unsigned int getID() const { return id; }
inline void setPath(const std::string& path) { this->path = path; }
inline const std::string& getPath() { return path; }
inline void setSlot(int slot) { this->slot = slot; }
inline int getSlot() const { return slot; }
inline void setType(const Type& type) { this->type = type; }
inline Type& getType() { return type; }
inline void setFreeGPU(bool freeGPU) { this-> freeGPU; }
inline bool isFreeGPU() const { return freeGPU; }
static unsigned int getCount() { return count; }
};
================================================
FILE: src/engine/texture/vendor/stb_image.h
================================================
/* stb_image - v2.26 - public domain image loader - http://nothings.org/stb
no warranty implied; use at your own risk
Do this:
#define STB_IMAGE_IMPLEMENTATION
before you include this file in *one* C or C++ file to create the implementation.
// i.e. it should look like this:
#include ...
#include ...
#include ...
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
You can #define STBI_ASSERT(x) before the #include to avoid using assert.h.
And #define STBI_MALLOC, STBI_REALLOC, and STBI_FREE to avoid using malloc,realloc,free
QUICK NOTES:
Primarily of interest to game developers and other people who can
avoid problematic images and only need the trivial interface
JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib)
PNG 1/2/4/8/16-bit-per-channel
TGA (not sure what subset, if a subset)
BMP non-1bpp, non-RLE
PSD (composited view only, no extra channels, 8/16 bit-per-channel)
GIF (*comp always reports as 4-channel)
HDR (radiance rgbE format)
PIC (Softimage PIC)
PNM (PPM and PGM binary only)
Animated GIF still needs a proper API, but here's one way to do it:
http://gist.github.com/urraka/685d9a6340b26b830d49
- decode from memory or through FILE (define STBI_NO_STDIO to remove code)
- decode from arbitrary I/O callbacks
- SIMD acceleration on x86/x64 (SSE2) and ARM (NEON)
Full documentation under "DOCUMENTATION" below.
LICENSE
See end of file for license information.
RECENT REVISION HISTORY:
2.26 (2020-07-13) many minor fixes
2.25 (2020-02-02) fix warnings
2.24 (2020-02-02) fix warnings; thread-local failure_reason and flip_vertically
2.23 (2019-08-11) fix clang static analysis warning
2.22 (2019-03-04) gif fixes, fix warnings
2.21 (2019-02-25) fix typo in comment
2.20 (2019-02-07) support utf8 filenames in Windows; fix warnings and platform ifdefs
2.19 (2018-02-11) fix warning
2.18 (2018-01-30) fix warnings
2.17 (2018-01-29) bugfix, 1-bit BMP, 16-bitness query, fix warnings
2.16 (2017-07-23) all functions have 16-bit variants; optimizations; bugfixes
2.15 (2017-03-18) fix png-1,2,4; all Imagenet JPGs; no runtime SSE detection on GCC
2.14 (2017-03-03) remove deprecated STBI_JPEG_OLD; fixes for Imagenet JPGs
2.13 (2016-12-04) experimental 16-bit API, only for PNG so far; fixes
2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes
2.11 (2016-04-02) 16-bit PNGS; enable SSE2 in non-gcc x64
RGB-format JPEG; remove white matting in PSD;
allocate large structures on the stack;
correct channel count for PNG & BMP
2.10 (2016-01-22) avoid warning introduced in 2.09
2.09 (2016-01-16) 16-bit TGA; comments in PNM files; STBI_REALLOC_SIZED
See end of file for full revision history.
============================ Contributors =========================
Image formats Extensions, features
Sean Barrett (jpeg, png, bmp) Jetro Lauha (stbi_info)
Nicolas Schulz (hdr, psd) Martin "SpartanJ" Golini (stbi_info)
Jonathan Dummer (tga) James "moose2000" Brown (iPhone PNG)
Jean-Marc Lienher (gif) Ben "Disch" Wenger (io callbacks)
Tom Seddon (pic) Omar Cornut (1/2/4-bit PNG)
Thatcher Ulrich (psd) Nicolas Guillemot (vertical flip)
Ken Miller (pgm, ppm) Richard Mitton (16-bit PSD)
github:urraka (animated gif) Junggon Kim (PNM comments)
Christopher Forseth (animated gif) Daniel Gibson (16-bit TGA)
socks-the-fox (16-bit PNG)
Jeremy Sawicki (handle all ImageNet JPGs)
Optimizations & bugfixes Mikhail Morozov (1-bit BMP)
Fabian "ryg" Giesen Anael Seghezzi (is-16-bit query)
Arseny Kapoulkine
John-Mark Allen
Carmelo J Fdez-Aguera
Bug & warning fixes
Marc LeBlanc David Woo Guillaume George Martins Mozeiko
Christpher Lloyd Jerry Jansson Joseph Thomson Blazej Dariusz Roszkowski
Phil Jordan Dave Moore Roy Eltham
Hayaki Saito Nathan Reed Won Chun
Luke Graham Johan Duparc Nick Verigakis the Horde3D community
Thomas Ruf Ronny Chevalier github:rlyeh
Janez Zemva John Bartholomew Michal Cichon github:romigrou
Jonathan Blow Ken Hamada Tero Hanninen github:svdijk
Laurent Gomila Cort Stratton github:snagar
Aruelien Pocheville Sergio Gonzalez Thibault Reuille github:Zelex
Cass Everitt Ryamond Barbiero github:grim210
Paul Du Bois Engin Manap Aldo Culquicondor github:sammyhw
Philipp Wiesemann Dale Weiler Oriol Ferrer Mesia github:phprus
Josh Tobin Matthew Gregan github:poppolopoppo
Julian Raschke Gregory Mullen Christian Floisand github:darealshinji
Baldur Karlsson Kevin Schmidt JR Smith github:Michaelangel007
Brad Weinberger Matvey Cherevko [reserved]
Luca Sas Alexander Veselov Zack Middleton [reserved]
Ryan C. Gordon [reserved] [reserved]
DO NOT ADD YOUR NAME HERE
To add your name to the credits, pick a random blank space in the middle and fill it.
80% of merge conflicts on stb PRs are due to people adding their name at the end
of the credits.
*/
#ifndef STBI_INCLUDE_STB_IMAGE_H
#define STBI_INCLUDE_STB_IMAGE_H
// DOCUMENTATION
//
// Limitations:
// - no 12-bit-per-channel JPEG
// - no JPEGs with arithmetic coding
// - GIF always returns *comp=4
//
// Basic usage (see HDR discussion below for HDR usage):
// int x,y,n;
// unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
// // ... process data if not NULL ...
// // ... x = width, y = height, n = # 8-bit components per pixel ...
// // ... replace '0' with '1'..'4' to force that many components per pixel
// // ... but 'n' will always be the number that it would have been if you said 0
// stbi_image_free(data)
//
// Standard parameters:
// int *x -- outputs image width in pixels
// int *y -- outputs image height in pixels
// int *channels_in_file -- outputs # of image components in image file
// int desired_channels -- if non-zero, # of image components requested in result
//
// The return value from an image loader is an 'unsigned char *' which points
// to the pixel data, or NULL on an allocation failure or if the image is
// corrupt or invalid. The pixel data consists of *y scanlines of *x pixels,
// with each pixel consisting of N interleaved 8-bit components; the first
// pixel pointed to is top-left-most in the image. There is no padding between
// image scanlines or between pixels, regardless of format. The number of
// components N is 'desired_channels' if desired_channels is non-zero, or
// *channels_in_file otherwise. If desired_channels is non-zero,
// *channels_in_file has the number of components that _would_ have been
// output otherwise. E.g. if you set desired_channels to 4, you will always
// get RGBA output, but you can check *channels_in_file to see if it's trivially
// opaque because e.g. there were only 3 channels in the source image.
//
// An output image with N components has the following components interleaved
// in this order in each pixel:
//
// N=#comp components
// 1 grey
// 2 grey, alpha
// 3 red, green, blue
// 4 red, green, blue, alpha
//
// If image loading fails for any reason, the return value will be NULL,
// and *x, *y, *channels_in_file will be unchanged. The function
// stbi_failure_reason() can be queried for an extremely brief, end-user
// unfriendly explanation of why the load failed. Define STBI_NO_FAILURE_STRINGS
// to avoid compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly
// more user-friendly ones.
//
// Paletted PNG, BMP, GIF, and PIC images are automatically depalettized.
//
// ===========================================================================
//
// UNICODE:
//
// If compiling for Windows and you wish to use Unicode filenames, compile
// with
// #define STBI_WINDOWS_UTF8
// and pass utf8-encoded filenames. Call stbi_convert_wchar_to_utf8 to convert
// Windows wchar_t filenames to utf8.
//
// ===========================================================================
//
// Philosophy
//
// stb libraries are designed with the following priorities:
//
// 1. easy to use
// 2. easy to maintain
// 3. good performance
//
// Sometimes I let "good performance" creep up in priority over "easy to maintain",
// and for best performance I may provide less-easy-to-use APIs that give higher
// performance, in addition to the easy-to-use ones. Nevertheless, it's important
// to keep in mind that from the standpoint of you, a client of this library,
// all you care about is #1 and #3, and stb libraries DO NOT emphasize #3 above all.
//
// Some secondary priorities arise directly from the first two, some of which
// provide more explicit reasons why performance can't be emphasized.
//
// - Portable ("ease of use")
// - Small source code footprint ("easy to maintain")
// - No dependencies ("ease of use")
//
// ===========================================================================
//
// I/O callbacks
//
// I/O callbacks allow you to read from arbitrary sources, like packaged
// files or some other source. Data read from callbacks are processed
// through a small internal buffer (currently 128 bytes) to try to reduce
// overhead.
//
// The three functions you must define are "read" (reads some bytes of data),
// "skip" (skips some bytes of data), "eof" (reports if the stream is at the end).
//
// ===========================================================================
//
// SIMD support
//
// The JPEG decoder will try to automatically use SIMD kernels on x86 when
// supported by the compiler. For ARM Neon support, you must explicitly
// request it.
//
// (The old do-it-yourself SIMD API is no longer supported in the current
// code.)
//
// On x86, SSE2 will automatically be used when available based on a run-time
// test; if not, the generic C versions are used as a fall-back. On ARM targets,
// the typical path is to have separate builds for NEON and non-NEON devices
// (at least this is true for iOS and Android). Therefore, the NEON support is
// toggled by a build flag: define STBI_NEON to get NEON loops.
//
// If for some reason you do not want to use any of SIMD code, or if
// you have issues compiling it, you can disable it entirely by
// defining STBI_NO_SIMD.
//
// ===========================================================================
//
// HDR image support (disable by defining STBI_NO_HDR)
//
// stb_image supports loading HDR images in general, and currently the Radiance
// .HDR file format specifically. You can still load any file through the existing
// interface; if you attempt to load an HDR file, it will be automatically remapped
// to LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1;
// both of these constants can be reconfigured through this interface:
//
// stbi_hdr_to_ldr_gamma(2.2f);
// stbi_hdr_to_ldr_scale(1.0f);
//
// (note, do not use _inverse_ constants; stbi_image will invert them
// appropriately).
//
// Additionally, there is a new, parallel interface for loading files as
// (linear) floats to preserve the full dynamic range:
//
// float *data = stbi_loadf(filename, &x, &y, &n, 0);
//
// If you load LDR images through this interface, those images will
// be promoted to floating point values, run through the inverse of
// constants corresponding to the above:
//
// stbi_ldr_to_hdr_scale(1.0f);
// stbi_ldr_to_hdr_gamma(2.2f);
//
// Finally, given a filename (or an open file or memory block--see header
// file for details) containing image data, you can query for the "most
// appropriate" interface to use (that is, whether the image is HDR or
// not), using:
//
// stbi_is_hdr(char *filename);
//
// ===========================================================================
//
// iPhone PNG support:
//
// By default we convert iphone-formatted PNGs back to RGB, even though
// they are internally encoded differently. You can disable this conversion
// by calling stbi_convert_iphone_png_to_rgb(0), in which case
// you will always just get the native iphone "format" through (which
// is BGR stored in RGB).
//
// Call stbi_set_unpremultiply_on_load(1) as well to force a divide per
// pixel to remove any premultiplied alpha *only* if the image file explicitly
// says there's premultiplied data (currently only happens in iPhone images,
// and only if iPhone convert-to-rgb processing is on).
//
// ===========================================================================
//
// ADDITIONAL CONFIGURATION
//
// - You can suppress implementation of any of the decoders to reduce
// your code footprint by #defining one or more of the following
// symbols before creating the implementation.
//
// STBI_NO_JPEG
// STBI_NO_PNG
// STBI_NO_BMP
// STBI_NO_PSD
// STBI_NO_TGA
// STBI_NO_GIF
// STBI_NO_HDR
// STBI_NO_PIC
// STBI_NO_PNM (.ppm and .pgm)
//
// - You can request *only* certain decoders and suppress all other ones
// (this will be more forward-compatible, as addition of new decoders
// doesn't require you to disable them explicitly):
//
// STBI_ONLY_JPEG
// STBI_ONLY_PNG
// STBI_ONLY_BMP
// STBI_ONLY_PSD
// STBI_ONLY_TGA
// STBI_ONLY_GIF
// STBI_ONLY_HDR
// STBI_ONLY_PIC
// STBI_ONLY_PNM (.ppm and .pgm)
//
// - If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still
// want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB
//
// - If you define STBI_MAX_DIMENSIONS, stb_image will reject images greater
// than that size (in either width or height) without further processing.
// This is to let programs in the wild set an upper bound to prevent
// denial-of-service attacks on untrusted data, as one could generate a
// valid image of gigantic dimensions and force stb_image to allocate a
// huge block of memory and spend disproportionate time decoding it. By
// default this is set to (1 << 24), which is 16777216, but that's still
// very big.
#ifndef STBI_NO_STDIO
#include <stdio.h>
#endif // STBI_NO_STDIO
#define STBI_VERSION 1
enum
{
STBI_default = 0, // only used for desired_channels
STBI_grey = 1,
STBI_grey_alpha = 2,
STBI_rgb = 3,
STBI_rgb_alpha = 4
};
#include <stdlib.h>
typedef unsigned char stbi_uc;
typedef unsigned short stbi_us;
#ifdef __cplusplus
extern "C" {
#endif
#ifndef STBIDEF
#ifdef STB_IMAGE_STATIC
#define STBIDEF static
#else
#define STBIDEF extern
#endif
#endif
//////////////////////////////////////////////////////////////////////////////
//
// PRIMARY API - works on images of any type
//
//
// load image by filename, open file, or memory buffer
//
typedef struct
{
int (*read) (void* user, char* data, int size); // fill 'data' with 'size' bytes. return number of bytes actually read
void (*skip) (void* user, int n); // skip the next 'n' bytes, or 'unget' the last -n bytes if negative
int (*eof) (void* user); // returns nonzero if we are at end of file/data
} stbi_io_callbacks;
////////////////////////////////////
//
// 8-bits-per-channel interface
//
STBIDEF stbi_uc* stbi_load_from_memory(stbi_uc const* buffer, int len, int* x, int* y, int* channels_in_file, int desired_channels);
STBIDEF stbi_uc* stbi_load_from_callbacks(stbi_io_callbacks const* clbk, void* user, int* x, int* y, int* channels_in_file, int desired_channels);
#ifndef STBI_NO_STDIO
STBIDEF stbi_uc* stbi_load(char const* filename, int* x, int* y, int* channels_in_file, int desired_channels);
STBIDEF stbi_uc* stbi_load_from_file(FILE* f, int* x, int* y, int* channels_in_file, int desired_channels);
// for stbi_load_from_file, file pointer is left pointing immediately after image
#endif
#ifndef STBI_NO_GIF
STBIDEF stbi_uc* stbi_load_gif_from_memory(stbi_uc const* buffer, int len, int** delays, int* x, int* y, int* z, int* comp, int req_comp);
#endif
#ifdef STBI_WINDOWS_UTF8
STBIDEF int stbi_convert_wchar_to_utf8(char* buffer, size_t bufferlen, const wchar_t* input);
#endif
////////////////////////////////////
//
// 16-bits-per-channel interface
//
STBIDEF stbi_us* stbi_load_16_from_memory(stbi_uc const* buffer, int len, int* x, int* y, int* channels_in_file, int desired_channels);
STBIDEF stbi_us* stbi_load_16_from_callbacks(stbi_io_callbacks const* clbk, void* user, int* x, int* y, int* channels_in_file, int desired_channels);
#ifndef STBI_NO_STDIO
STBIDEF stbi_us* stbi_load_16(char const* filename, int* x, int* y, int* channels_in_file, int desired_channels);
STBIDEF stbi_us* stbi_load_from_file_16(FILE* f, int* x, int* y, int* channels_in_file, int desired_channels);
#endif
////////////////////////////////////
//
// float-per-channel interface
//
#ifndef STBI_NO_LINEAR
STBIDEF float* stbi_loadf_from_memory(stbi_uc const* buffer, int len, int* x, int* y, int* channels_in_file, int desired_channels);
STBIDEF float* stbi_loadf_from_callbacks(stbi_io_callbacks const* clbk, void* user, int* x, int* y, int* channels_in_file, int desired_channels);
#ifndef STBI_NO_STDIO
STBIDEF float* stbi_loadf(char const* filename, int* x, int* y, int* channels_in_file, int desired_channels);
STBIDEF float* stbi_loadf_from_file(FILE* f, int* x, int* y, int* channels_in_file, int desired_channels);
#endif
#endif
#ifndef STBI_NO_HDR
STBIDEF void stbi_hdr_to_ldr_gamma(float gamma);
STBIDEF void stbi_hdr_to_ldr_scale(float scale);
#endif // STBI_NO_HDR
#ifndef STBI_NO_LINEAR
STBIDEF void stbi_ldr_to_hdr_gamma(float gamma);
STBIDEF void stbi_ldr_to_hdr_scale(float scale);
#endif // STBI_NO_LINEAR
// stbi_is_hdr is always defined, but always returns false if STBI_NO_HDR
STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const* clbk, void* user);
STBIDEF int stbi_is_hdr_from_memory(stbi_uc const* buffer, int len);
#ifndef STBI_NO_STDIO
STBIDEF int stbi_is_hdr(char const* filename);
STBIDEF int stbi_is_hdr_from_file(FILE* f);
#endif // STBI_NO_STDIO
// get a VERY brief reason for failure
// on most compilers (and ALL modern mainstream compilers) this is threadsafe
STBIDEF const char* stbi_failure_reason(void);
// free the loaded image -- this is just free()
STBIDEF void stbi_image_free(void* retval_from_stbi_load);
// get image dimensions & components without fully decoding
STBIDEF int stbi_info_from_memory(stbi_uc const* buffer, int len, int* x, int* y, int* comp);
STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const* clbk, void* user, int* x, int* y, int* comp);
STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const* buffer, int len);
STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const* clbk, void* user);
#ifndef STBI_NO_STDIO
STBIDEF int stbi_info(char const* filename, int* x, int* y, int* comp);
STBIDEF int stbi_info_from_file(FILE* f, int* x, int* y, int* comp);
STBIDEF int stbi_is_16_bit(char const* filename);
STBIDEF int stbi_is_16_bit_from_file(FILE* f);
#endif
// for image formats that explicitly notate that they have premultiplied alpha,
// we just return the colors as stored in the file. set this flag to force
// unpremultiplication. results are undefined if the unpremultiply overflow.
STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply);
// indicate whether we should process iphone images back to canonical format,
// or just pass them through "as-is"
STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert);
// flip the image vertically, so the first pixel in the output array is the bottom left
STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip);
// as above, but only applies to images loaded on the thread that calls the function
// this function is only available if your compiler supports thread-local variables;
// calling it will fail to link if your compiler doesn't
STBIDEF void stbi_set_flip_vertically_on_load_thread(int flag_true_if_should_flip);
// ZLIB client - used by PNG, available for other purposes
STBIDEF char* stbi_zlib_decode_malloc_guesssize(const char* buffer, int len, int initial_size, int* outlen);
STBIDEF char* stbi_zlib_decode_malloc_guesssize_headerflag(const char* buffer, int len, int initial_size, int* outlen, int parse_header);
STBIDEF char* stbi_zlib_decode_malloc(const char* buffer, int len, int* outlen);
STBIDEF int stbi_zlib_decode_buffer(char* obuffer, int olen, const char* ibuffer, int ilen);
STBIDEF char* stbi_zlib_decode_noheader_malloc(const char* buffer, int len, int* outlen);
STBIDEF int stbi_zlib_decode_noheader_buffer(char* obuffer, int olen, const char* ibuffer, int ilen);
#ifdef __cplusplus
}
#endif
//
//
//// end header file /////////////////////////////////////////////////////
#endif // STBI_INCLUDE_STB_IMAGE_H
#ifdef STB_IMAGE_IMPLEMENTATION
#if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) \
|| defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || defined(STBI_ONLY_PSD) \
|| defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) \
|| defined(STBI_ONLY_ZLIB)
#ifndef STBI_ONLY_JPEG
#define STBI_NO_JPEG
#endif
#ifndef STBI_ONLY_PNG
#define STBI_NO_PNG
#endif
#ifndef STBI_ONLY_BMP
#define STBI_NO_BMP
#endif
#ifndef STBI_ONLY_PSD
#define STBI_NO_PSD
#endif
#ifndef STBI_ONLY_TGA
#define STBI_NO_TGA
#endif
#ifndef STBI_ONLY_GIF
#define STBI_NO_GIF
#endif
#ifndef STBI_ONLY_HDR
#define STBI_NO_HDR
#endif
#ifndef STBI_ONLY_PIC
#define STBI_NO_PIC
#endif
#ifndef STBI_ONLY_PNM
#define STBI_NO_PNM
#endif
#endif
#if defined(STBI_NO_PNG) && !defined(STBI_SUPPORT_ZLIB) && !defined(STBI_NO_ZLIB)
#define STBI_NO_ZLIB
#endif
#include <stdarg.h>
#include <stddef.h> // ptrdiff_t on osx
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR)
#include <math.h> // ldexp, pow
#endif
#ifndef STBI_NO_STDIO
#include <stdio.h>
#endif
#ifndef STBI_ASSERT
#include <assert.h>
#define STBI_ASSERT(x) assert(x)
#endif
#ifdef __cplusplus
#define STBI_EXTERN extern "C"
#else
#define STBI_EXTERN extern
#endif
#ifndef _MSC_VER
#ifdef __cplusplus
#define stbi_inline inline
#else
#define stbi_inline
#endif
#else
#de
gitextract_oar47vq7/
├── .gitignore
├── CMakeLists.txt
├── LICENSE
├── README.md
├── compile.md
├── src/
│ ├── CMakeLists.txt
│ └── engine/
│ ├── CMakeLists.txt
│ ├── Vec3.h
│ ├── group/
│ │ ├── DynamicPolytope.cpp
│ │ ├── DynamicPolytope.h
│ │ ├── Group.cpp
│ │ ├── Group.h
│ │ ├── Polytope.cpp
│ │ ├── Polytope.h
│ │ ├── Scene.cpp
│ │ └── Scene.h
│ ├── lighting/
│ │ ├── DirectionalLight.cpp
│ │ ├── DirectionalLight.h
│ │ ├── Light.cpp
│ │ ├── Light.h
│ │ ├── Material.h
│ │ ├── PBRMaterial.h
│ │ ├── PhongMaterial.h
│ │ ├── PointLight.cpp
│ │ └── PointLight.h
│ ├── model/
│ │ ├── Model.cpp
│ │ └── Model.h
│ ├── opengl/
│ │ ├── buffer/
│ │ │ ├── Buffer.h
│ │ │ ├── FrameBuffer.cpp
│ │ │ ├── FrameBuffer.h
│ │ │ ├── IndexBuffer.cpp
│ │ │ ├── IndexBuffer.h
│ │ │ ├── MultiSampleRenderBuffer.cpp
│ │ │ ├── MultiSampleRenderBuffer.h
│ │ │ ├── RenderBuffer.cpp
│ │ │ ├── RenderBuffer.h
│ │ │ ├── VertexArray.cpp
│ │ │ ├── VertexArray.h
│ │ │ ├── VertexBuffer.cpp
│ │ │ └── VertexBuffer.h
│ │ ├── glsl/
│ │ │ ├── BlinnPhong.frag
│ │ │ ├── BlinnPhong.vert
│ │ │ ├── Default.frag
│ │ │ ├── Default.vert
│ │ │ ├── HDR.frag
│ │ │ ├── HDR.vert
│ │ │ ├── PBR.frag
│ │ │ ├── PBR.vert
│ │ │ ├── Selection.frag
│ │ │ ├── Selection.vert
│ │ │ ├── SimpleDepth.frag
│ │ │ ├── SimpleDepth.vert
│ │ │ ├── SkyBox.frag
│ │ │ ├── SkyBox.vert
│ │ │ ├── TexturedQuad.frag
│ │ │ └── TexturedQuad.vert
│ │ └── shader/
│ │ ├── Shader.cpp
│ │ └── Shader.h
│ ├── ptr.h
│ ├── renderer/
│ │ ├── Camera.cpp
│ │ ├── Camera.h
│ │ ├── FPSCamera.cpp
│ │ ├── FPSCamera.h
│ │ ├── FrameCapturer.h
│ │ ├── MouseRayCasting.cpp
│ │ ├── MouseRayCasting.h
│ │ ├── Renderer.cpp
│ │ ├── Renderer.h
│ │ ├── SkyBox.cpp
│ │ ├── SkyBox.h
│ │ ├── TrackballCamera.cpp
│ │ └── TrackballCamera.h
│ ├── shapes/
│ │ ├── Cube.cpp
│ │ ├── Cube.h
│ │ ├── Shape.cpp
│ │ ├── Shape.h
│ │ ├── Sphere.cpp
│ │ └── Sphere.h
│ └── texture/
│ ├── ColorBufferTexture.cpp
│ ├── ColorBufferTexture.h
│ ├── CubeMapTexture.cpp
│ ├── CubeMapTexture.h
│ ├── DepthTexture.cpp
│ ├── DepthTexture.h
│ ├── MultiSampleTexture.cpp
│ ├── MultiSampleTexture.h
│ ├── Texture.cpp
│ ├── Texture.h
│ └── vendor/
│ └── stb_image.h
├── test/
│ ├── CMakeLists.txt
│ ├── testCube/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── src/
│ │ └── main.cpp
│ ├── testHDRI/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── src/
│ │ ├── ImguiStyles.h
│ │ └── main.cpp
│ ├── testImGuiGLFW/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ ├── imgui.ini
│ │ └── src/
│ │ ├── ImguiStyles.h
│ │ └── main.cpp
│ ├── testLighting/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── src/
│ │ └── main.cpp
│ ├── testModelPBR/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── src/
│ │ ├── ImguiStyles.h
│ │ └── main.cpp
│ ├── testPBR/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── src/
│ │ └── main.cpp
│ ├── testPointCloud/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── src/
│ │ ├── ImguiStyles.h
│ │ └── main.cpp
│ └── third_party/
│ └── imgui/
│ ├── .editorconfig
│ ├── .gitattributes
│ ├── .gitignore
│ ├── LICENSE.txt
│ ├── backends/
│ │ ├── imgui_impl_glfw.cpp
│ │ ├── imgui_impl_glfw.h
│ │ ├── imgui_impl_opengl3.cpp
│ │ ├── imgui_impl_opengl3.h
│ │ ├── imgui_impl_opengl3_loader.h
│ │ ├── imgui_impl_vulkan.cpp
│ │ ├── imgui_impl_vulkan.h
│ │ └── vulkan/
│ │ ├── generate_spv.sh
│ │ ├── glsl_shader.frag
│ │ └── glsl_shader.vert
│ ├── imconfig.h
│ ├── imgui.cpp
│ ├── imgui.h
│ ├── imgui_demo.cpp
│ ├── imgui_draw.cpp
│ ├── imgui_internal.h
│ ├── imgui_tables.cpp
│ ├── imgui_widgets.cpp
│ ├── imstb_rectpack.h
│ ├── imstb_textedit.h
│ ├── imstb_truetype.h
│ └── misc/
│ ├── README.txt
│ ├── cpp/
│ │ ├── README.txt
│ │ ├── imgui_stdlib.cpp
│ │ └── imgui_stdlib.h
│ ├── debuggers/
│ │ ├── README.txt
│ │ ├── imgui.gdb
│ │ ├── imgui.natstepfilter
│ │ └── imgui.natvis
│ ├── fonts/
│ │ └── binary_to_compressed_c.cpp
│ ├── freetype/
│ │ ├── README.md
│ │ ├── imgui_freetype.cpp
│ │ └── imgui_freetype.h
│ └── single_file/
│ └── imgui_single_file.h
└── third_party/
├── CMakeLists.txt
└── glm/
├── CMakeLists.txt
├── common.hpp
├── detail/
│ ├── _features.hpp
│ ├── _fixes.hpp
│ ├── _noise.hpp
│ ├── _swizzle.hpp
│ ├── _swizzle_func.hpp
│ ├── _vectorize.hpp
│ ├── compute_common.hpp
│ ├── compute_vector_relational.hpp
│ ├── func_common.inl
│ ├── func_common_simd.inl
│ ├── func_exponential.inl
│ ├── func_exponential_simd.inl
│ ├── func_geometric.inl
│ ├── func_geometric_simd.inl
│ ├── func_integer.inl
│ ├── func_integer_simd.inl
│ ├── func_matrix.inl
│ ├── func_matrix_simd.inl
│ ├── func_packing.inl
│ ├── func_packing_simd.inl
│ ├── func_trigonometric.inl
│ ├── func_trigonometric_simd.inl
│ ├── func_vector_relational.inl
│ ├── func_vector_relational_simd.inl
│ ├── glm.cpp
│ ├── qualifier.hpp
│ ├── setup.hpp
│ ├── type_float.hpp
│ ├── type_half.hpp
│ ├── type_half.inl
│ ├── type_mat2x2.hpp
│ ├── type_mat2x2.inl
│ ├── type_mat2x3.hpp
│ ├── type_mat2x3.inl
│ ├── type_mat2x4.hpp
│ ├── type_mat2x4.inl
│ ├── type_mat3x2.hpp
│ ├── type_mat3x2.inl
│ ├── type_mat3x3.hpp
│ ├── type_mat3x3.inl
│ ├── type_mat3x4.hpp
│ ├── type_mat3x4.inl
│ ├── type_mat4x2.hpp
│ ├── type_mat4x2.inl
│ ├── type_mat4x3.hpp
│ ├── type_mat4x3.inl
│ ├── type_mat4x4.hpp
│ ├── type_mat4x4.inl
│ ├── type_mat4x4_simd.inl
│ ├── type_quat.hpp
│ ├── type_quat.inl
│ ├── type_quat_simd.inl
│ ├── type_vec1.hpp
│ ├── type_vec1.inl
│ ├── type_vec2.hpp
│ ├── type_vec2.inl
│ ├── type_vec3.hpp
│ ├── type_vec3.inl
│ ├── type_vec4.hpp
│ ├── type_vec4.inl
│ └── type_vec4_simd.inl
├── exponential.hpp
├── ext/
│ ├── matrix_clip_space.hpp
│ ├── matrix_clip_space.inl
│ ├── matrix_common.hpp
│ ├── matrix_common.inl
│ ├── matrix_double2x2.hpp
│ ├── matrix_double2x2_precision.hpp
│ ├── matrix_double2x3.hpp
│ ├── matrix_double2x3_precision.hpp
│ ├── matrix_double2x4.hpp
│ ├── matrix_double2x4_precision.hpp
│ ├── matrix_double3x2.hpp
│ ├── matrix_double3x2_precision.hpp
│ ├── matrix_double3x3.hpp
│ ├── matrix_double3x3_precision.hpp
│ ├── matrix_double3x4.hpp
│ ├── matrix_double3x4_precision.hpp
│ ├── matrix_double4x2.hpp
│ ├── matrix_double4x2_precision.hpp
│ ├── matrix_double4x3.hpp
│ ├── matrix_double4x3_precision.hpp
│ ├── matrix_double4x4.hpp
│ ├── matrix_double4x4_precision.hpp
│ ├── matrix_float2x2.hpp
│ ├── matrix_float2x2_precision.hpp
│ ├── matrix_float2x3.hpp
│ ├── matrix_float2x3_precision.hpp
│ ├── matrix_float2x4.hpp
│ ├── matrix_float2x4_precision.hpp
│ ├── matrix_float3x2.hpp
│ ├── matrix_float3x2_precision.hpp
│ ├── matrix_float3x3.hpp
│ ├── matrix_float3x3_precision.hpp
│ ├── matrix_float3x4.hpp
│ ├── matrix_float3x4_precision.hpp
│ ├── matrix_float4x2.hpp
│ ├── matrix_float4x2_precision.hpp
│ ├── matrix_float4x3.hpp
│ ├── matrix_float4x3_precision.hpp
│ ├── matrix_float4x4.hpp
│ ├── matrix_float4x4_precision.hpp
│ ├── matrix_int2x2.hpp
│ ├── matrix_int2x2_sized.hpp
│ ├── matrix_int2x3.hpp
│ ├── matrix_int2x3_sized.hpp
│ ├── matrix_int2x4.hpp
│ ├── matrix_int2x4_sized.hpp
│ ├── matrix_int3x2.hpp
│ ├── matrix_int3x2_sized.hpp
│ ├── matrix_int3x3.hpp
│ ├── matrix_int3x3_sized.hpp
│ ├── matrix_int3x4.hpp
│ ├── matrix_int3x4_sized.hpp
│ ├── matrix_int4x2.hpp
│ ├── matrix_int4x2_sized.hpp
│ ├── matrix_int4x3.hpp
│ ├── matrix_int4x3_sized.hpp
│ ├── matrix_int4x4.hpp
│ ├── matrix_int4x4_sized.hpp
│ ├── matrix_projection.hpp
│ ├── matrix_projection.inl
│ ├── matrix_relational.hpp
│ ├── matrix_relational.inl
│ ├── matrix_transform.hpp
│ ├── matrix_transform.inl
│ ├── matrix_uint2x2.hpp
│ ├── matrix_uint2x2_sized.hpp
│ ├── matrix_uint2x3.hpp
│ ├── matrix_uint2x3_sized.hpp
│ ├── matrix_uint2x4.hpp
│ ├── matrix_uint2x4_sized.hpp
│ ├── matrix_uint3x2.hpp
│ ├── matrix_uint3x2_sized.hpp
│ ├── matrix_uint3x3.hpp
│ ├── matrix_uint3x3_sized.hpp
│ ├── matrix_uint3x4.hpp
│ ├── matrix_uint3x4_sized.hpp
│ ├── matrix_uint4x2.hpp
│ ├── matrix_uint4x2_sized.hpp
│ ├── matrix_uint4x3.hpp
│ ├── matrix_uint4x3_sized.hpp
│ ├── matrix_uint4x4.hpp
│ ├── matrix_uint4x4_sized.hpp
│ ├── quaternion_common.hpp
│ ├── quaternion_common.inl
│ ├── quaternion_common_simd.inl
│ ├── quaternion_double.hpp
│ ├── quaternion_double_precision.hpp
│ ├── quaternion_exponential.hpp
│ ├── quaternion_exponential.inl
│ ├── quaternion_float.hpp
│ ├── quaternion_float_precision.hpp
│ ├── quaternion_geometric.hpp
│ ├── quaternion_geometric.inl
│ ├── quaternion_relational.hpp
│ ├── quaternion_relational.inl
│ ├── quaternion_transform.hpp
│ ├── quaternion_transform.inl
│ ├── quaternion_trigonometric.hpp
│ ├── quaternion_trigonometric.inl
│ ├── scalar_common.hpp
│ ├── scalar_common.inl
│ ├── scalar_constants.hpp
│ ├── scalar_constants.inl
│ ├── scalar_int_sized.hpp
│ ├── scalar_integer.hpp
│ ├── scalar_integer.inl
│ ├── scalar_packing.hpp
│ ├── scalar_packing.inl
│ ├── scalar_relational.hpp
│ ├── scalar_relational.inl
│ ├── scalar_uint_sized.hpp
│ ├── scalar_ulp.hpp
│ ├── scalar_ulp.inl
│ ├── vector_bool1.hpp
│ ├── vector_bool1_precision.hpp
│ ├── vector_bool2.hpp
│ ├── vector_bool2_precision.hpp
│ ├── vector_bool3.hpp
│ ├── vector_bool3_precision.hpp
│ ├── vector_bool4.hpp
│ ├── vector_bool4_precision.hpp
│ ├── vector_common.hpp
│ ├── vector_common.inl
│ ├── vector_double1.hpp
│ ├── vector_double1_precision.hpp
│ ├── vector_double2.hpp
│ ├── vector_double2_precision.hpp
│ ├── vector_double3.hpp
│ ├── vector_double3_precision.hpp
│ ├── vector_double4.hpp
│ ├── vector_double4_precision.hpp
│ ├── vector_float1.hpp
│ ├── vector_float1_precision.hpp
│ ├── vector_float2.hpp
│ ├── vector_float2_precision.hpp
│ ├── vector_float3.hpp
│ ├── vector_float3_precision.hpp
│ ├── vector_float4.hpp
│ ├── vector_float4_precision.hpp
│ ├── vector_int1.hpp
│ ├── vector_int1_sized.hpp
│ ├── vector_int2.hpp
│ ├── vector_int2_sized.hpp
│ ├── vector_int3.hpp
│ ├── vector_int3_sized.hpp
│ ├── vector_int4.hpp
│ ├── vector_int4_sized.hpp
│ ├── vector_integer.hpp
│ ├── vector_integer.inl
│ ├── vector_packing.hpp
│ ├── vector_packing.inl
│ ├── vector_relational.hpp
│ ├── vector_relational.inl
│ ├── vector_uint1.hpp
│ ├── vector_uint1_sized.hpp
│ ├── vector_uint2.hpp
│ ├── vector_uint2_sized.hpp
│ ├── vector_uint3.hpp
│ ├── vector_uint3_sized.hpp
│ ├── vector_uint4.hpp
│ ├── vector_uint4_sized.hpp
│ ├── vector_ulp.hpp
│ └── vector_ulp.inl
├── ext.hpp
├── fwd.hpp
├── geometric.hpp
├── glm.hpp
├── gtc/
│ ├── bitfield.hpp
│ ├── bitfield.inl
│ ├── color_space.hpp
│ ├── color_space.inl
│ ├── constants.hpp
│ ├── constants.inl
│ ├── epsilon.hpp
│ ├── epsilon.inl
│ ├── integer.hpp
│ ├── integer.inl
│ ├── matrix_access.hpp
│ ├── matrix_access.inl
│ ├── matrix_integer.hpp
│ ├── matrix_inverse.hpp
│ ├── matrix_inverse.inl
│ ├── matrix_transform.hpp
│ ├── matrix_transform.inl
│ ├── noise.hpp
│ ├── noise.inl
│ ├── packing.hpp
│ ├── packing.inl
│ ├── quaternion.hpp
│ ├── quaternion.inl
│ ├── quaternion_simd.inl
│ ├── random.hpp
│ ├── random.inl
│ ├── reciprocal.hpp
│ ├── reciprocal.inl
│ ├── round.hpp
│ ├── round.inl
│ ├── type_aligned.hpp
│ ├── type_precision.hpp
│ ├── type_precision.inl
│ ├── type_ptr.hpp
│ ├── type_ptr.inl
│ ├── ulp.hpp
│ ├── ulp.inl
│ └── vec1.hpp
├── gtx/
│ ├── associated_min_max.hpp
│ ├── associated_min_max.inl
│ ├── bit.hpp
│ ├── bit.inl
│ ├── closest_point.hpp
│ ├── closest_point.inl
│ ├── color_encoding.hpp
│ ├── color_encoding.inl
│ ├── color_space.hpp
│ ├── color_space.inl
│ ├── color_space_YCoCg.hpp
│ ├── color_space_YCoCg.inl
│ ├── common.hpp
│ ├── common.inl
│ ├── compatibility.hpp
│ ├── compatibility.inl
│ ├── component_wise.hpp
│ ├── component_wise.inl
│ ├── dual_quaternion.hpp
│ ├── dual_quaternion.inl
│ ├── easing.hpp
│ ├── easing.inl
│ ├── euler_angles.hpp
│ ├── euler_angles.inl
│ ├── extend.hpp
│ ├── extend.inl
│ ├── extended_min_max.hpp
│ ├── extended_min_max.inl
│ ├── exterior_product.hpp
│ ├── exterior_product.inl
│ ├── fast_exponential.hpp
│ ├── fast_exponential.inl
│ ├── fast_square_root.hpp
│ ├── fast_square_root.inl
│ ├── fast_trigonometry.hpp
│ ├── fast_trigonometry.inl
│ ├── float_notmalize.inl
│ ├── functions.hpp
│ ├── functions.inl
│ ├── gradient_paint.hpp
│ ├── gradient_paint.inl
│ ├── handed_coordinate_space.hpp
│ ├── handed_coordinate_space.inl
│ ├── hash.hpp
│ ├── hash.inl
│ ├── integer.hpp
│ ├── integer.inl
│ ├── intersect.hpp
│ ├── intersect.inl
│ ├── io.hpp
│ ├── io.inl
│ ├── log_base.hpp
│ ├── log_base.inl
│ ├── matrix_cross_product.hpp
│ ├── matrix_cross_product.inl
│ ├── matrix_decompose.hpp
│ ├── matrix_decompose.inl
│ ├── matrix_factorisation.hpp
│ ├── matrix_factorisation.inl
│ ├── matrix_interpolation.hpp
│ ├── matrix_interpolation.inl
│ ├── matrix_major_storage.hpp
│ ├── matrix_major_storage.inl
│ ├── matrix_operation.hpp
│ ├── matrix_operation.inl
│ ├── matrix_query.hpp
│ ├── matrix_query.inl
│ ├── matrix_transform_2d.hpp
│ ├── matrix_transform_2d.inl
│ ├── mixed_product.hpp
│ ├── mixed_product.inl
│ ├── norm.hpp
│ ├── norm.inl
│ ├── normal.hpp
│ ├── normal.inl
│ ├── normalize_dot.hpp
│ ├── normalize_dot.inl
│ ├── number_precision.hpp
│ ├── number_precision.inl
│ ├── optimum_pow.hpp
│ ├── optimum_pow.inl
│ ├── orthonormalize.hpp
│ ├── orthonormalize.inl
│ ├── perpendicular.hpp
│ ├── perpendicular.inl
│ ├── polar_coordinates.hpp
│ ├── polar_coordinates.inl
│ ├── projection.hpp
│ ├── projection.inl
│ ├── quaternion.hpp
│ ├── quaternion.inl
│ ├── range.hpp
│ ├── raw_data.hpp
│ ├── raw_data.inl
│ ├── rotate_normalized_axis.hpp
│ ├── rotate_normalized_axis.inl
│ ├── rotate_vector.hpp
│ ├── rotate_vector.inl
│ ├── scalar_multiplication.hpp
│ ├── scalar_relational.hpp
│ ├── scalar_relational.inl
│ ├── spline.hpp
│ ├── spline.inl
│ ├── std_based_type.hpp
│ ├── std_based_type.inl
│ ├── string_cast.hpp
│ ├── string_cast.inl
│ ├── texture.hpp
│ ├── texture.inl
│ ├── transform.hpp
│ ├── transform.inl
│ ├── transform2.hpp
│ ├── transform2.inl
│ ├── type_aligned.hpp
│ ├── type_aligned.inl
│ ├── type_trait.hpp
│ ├── type_trait.inl
│ ├── vec_swizzle.hpp
│ ├── vector_angle.hpp
│ ├── vector_angle.inl
│ ├── vector_query.hpp
│ ├── vector_query.inl
│ ├── wrap.hpp
│ └── wrap.inl
├── integer.hpp
├── mat2x2.hpp
├── mat2x3.hpp
├── mat2x4.hpp
├── mat3x2.hpp
├── mat3x3.hpp
├── mat3x4.hpp
├── mat4x2.hpp
├── mat4x3.hpp
├── mat4x4.hpp
├── matrix.hpp
├── packing.hpp
├── simd/
│ ├── common.h
│ ├── exponential.h
│ ├── geometric.h
│ ├── integer.h
│ ├── matrix.h
│ ├── neon.h
│ ├── packing.h
│ ├── platform.h
│ ├── trigonometric.h
│ └── vector_relational.h
├── trigonometric.hpp
├── vec2.hpp
├── vec3.hpp
├── vec4.hpp
└── vector_relational.hpp
Showing preview only (304K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2869 symbols across 334 files)
FILE: src/engine/Vec3.h
function getModule (line 38) | inline double getModule() { return sqrt(x * x + y * y + z * z); }
function operator (line 40) | inline double operator * (const Vec3& vec) { return vec.x * x + vec.y * ...
function Vec3 (line 41) | inline Vec3 operator ^ (const Vec3& vec) { return Vec3(y * vec.z - z * v...
function Vec3 (line 42) | inline Vec3 operator + (const Vec3& vec) { return Vec3(vec.x + x, vec.y ...
function Vec3 (line 43) | inline Vec3 operator - (const Vec3& vec) { return Vec3(vec.x - x, vec.y ...
function Vec3 (line 52) | Vec3 getUnit() {
type Vec3 (line 57) | typedef Vec3<float> Vec3f;
type Vec3 (line 58) | typedef Vec3<int> Vec3i;
FILE: src/engine/group/DynamicPolytope.h
function class (line 8) | class DynamicPolytope : public Polytope {
FILE: src/engine/group/Group.h
function class (line 16) | class Group {
function rotate (line 37) | inline void rotate(float degrees, const glm::vec3& axis) { modelMatrix =...
function scale (line 38) | inline void scale(const glm::vec3& s) { modelMatrix = glm::scale(modelMa...
function add (line 40) | inline void add(const Polytope::Ptr& polytope) { polytopes.push_back(pol...
function std (line 41) | inline std::vector<Polytope::Ptr>& getPolytopes() { return polytopes; }
function removePolytope (line 43) | inline void removePolytope(int index) { polytopes.erase(polytopes.begin(...
function setVisible (line 45) | inline void setVisible(bool visible) { this->visible = visible; }
function setShowWire (line 48) | inline void setShowWire(bool showWire) { this->showWire = showWire; }
function setPrimitive (line 51) | inline void setPrimitive(unsigned int primitive) { this->primitive = pri...
function setModelMatrix (line 54) | inline void setModelMatrix(const glm::mat4& modelMatrix) { this->modelMa...
function glm (line 55) | inline glm::mat4& getModelMatrix() { return modelMatrix; }
function setPointSize (line 61) | inline void setPointSize(float pointSize) { this->pointSize = pointSize; }
function setLineWidth (line 62) | inline void setLineWidth(float lineWidth) { this->lineWidth = lineWidth; }
function setOutliningWidth (line 63) | inline void setOutliningWidth(float outliningWidth) { this->outliningWid...
FILE: src/engine/group/Polytope.h
function class (line 26) | class Polytope {
FILE: src/engine/group/Scene.h
function class (line 8) | class Scene {
FILE: src/engine/lighting/DirectionalLight.h
function class (line 6) | class DirectionalLight : public Light {
FILE: src/engine/lighting/Light.h
function class (line 19) | class Light {
FILE: src/engine/lighting/Material.h
function class (line 10) | class Material {
FILE: src/engine/lighting/PBRMaterial.h
function class (line 5) | class PBRMaterial : public Material {
FILE: src/engine/lighting/PhongMaterial.h
function class (line 5) | class PhongMaterial : public Material {
FILE: src/engine/lighting/PointLight.h
function class (line 9) | class PointLight : public Light {
FILE: src/engine/model/Model.h
function class (line 17) | class Model : public Group {
FILE: src/engine/opengl/buffer/Buffer.h
function class (line 7) | class Buffer {
FILE: src/engine/opengl/buffer/FrameBuffer.h
function class (line 5) | class FrameBuffer : public Buffer {
FILE: src/engine/opengl/buffer/IndexBuffer.cpp
function IndexBuffer (line 22) | IndexBuffer& IndexBuffer::operator=(const IndexBuffer& indexBuffer) {
FILE: src/engine/opengl/buffer/IndexBuffer.h
function class (line 6) | class IndexBuffer : public Buffer {
FILE: src/engine/opengl/buffer/MultiSampleRenderBuffer.h
function class (line 5) | class MultiSampleRenderBuffer : public RenderBuffer {
FILE: src/engine/opengl/buffer/RenderBuffer.h
function class (line 5) | class RenderBuffer : public Buffer {
FILE: src/engine/opengl/buffer/VertexArray.cpp
function VertexArray (line 16) | VertexArray& VertexArray::operator=(const VertexArray& vertexArray) {
FILE: src/engine/opengl/buffer/VertexArray.h
function class (line 5) | class VertexArray : public Buffer {
FILE: src/engine/opengl/buffer/VertexBuffer.cpp
function VertexBuffer (line 34) | VertexBuffer& VertexBuffer::operator=(const VertexBuffer& vertexBuffer) {
FILE: src/engine/opengl/buffer/VertexBuffer.h
function class (line 12) | class VertexBuffer : public Buffer {
FILE: src/engine/opengl/shader/Shader.cpp
function Shader (line 22) | Shader& Shader::operator=(const Shader& shader) {
function ShaderProgram (line 90) | ShaderProgram& ShaderProgram::operator=(const ShaderProgram& shaderProgr...
FILE: src/engine/opengl/shader/Shader.h
function class (line 16) | class Shader {
function Shader (line 40) | inline static Shader fromCode(const std::string& code, const ShaderType&...
function deleteShader (line 44) | inline void deleteShader() { glDeleteShader(shaderID); }
function ShaderType (line 48) | inline ShaderType& getShaderType() { return shaderType; }
function class (line 51) | class ShaderProgram {
function Shader (line 75) | inline Shader& getVertexShader() { return vertexShader; }
function Shader (line 76) | inline Shader& getFragmentShader() { return fragmentShader; }
FILE: src/engine/renderer/Camera.h
function class (line 10) | class Camera {
FILE: src/engine/renderer/FPSCamera.h
function class (line 5) | class FPSCamera : public Camera {
FILE: src/engine/renderer/FrameCapturer.h
function class (line 13) | class FrameCapturer {
function startCapturing (line 74) | void startCapturing() {
function finishCapturing (line 87) | void finishCapturing() {
function setBackgroundColor (line 97) | void setBackgroundColor(float r, float g, float b) {
function Texture (line 103) | inline Texture::Ptr& getTexture() { return screenTexture; }
function glm (line 105) | inline glm::vec3& getBackgroundColor() { return backgroundColor; }
FILE: src/engine/renderer/MouseRayCasting.h
function class (line 6) | class MouseRayCasting {
FILE: src/engine/renderer/Renderer.h
function class (line 30) | class Renderer {
FILE: src/engine/renderer/SkyBox.h
function class (line 12) | class SkyBox : public Buffer {
FILE: src/engine/renderer/TrackballCamera.h
function class (line 5) | class TrackballCamera : public Camera {
FILE: src/engine/shapes/Cube.h
function class (line 5) | class Cube : public Shape {
FILE: src/engine/shapes/Shape.h
function class (line 5) | class Shape : public Polytope {
FILE: src/engine/shapes/Sphere.cpp
type Vertex (line 32) | struct Vertex {
FILE: src/engine/shapes/Sphere.h
function class (line 5) | class Sphere : public Shape {
FILE: src/engine/texture/ColorBufferTexture.h
function class (line 5) | class ColorBufferTexture : public Texture {
FILE: src/engine/texture/CubeMapTexture.h
function class (line 8) | class CubeMapTexture : public Texture {
FILE: src/engine/texture/DepthTexture.h
function class (line 5) | class DepthTexture : public Texture {
FILE: src/engine/texture/MultiSampleTexture.h
function class (line 5) | class MultiSampleTexture : public Texture {
FILE: src/engine/texture/Texture.cpp
function Image (line 9) | Image readImage(const std::string& path) {
function Texture (line 61) | Texture& Texture::operator=(const Texture& texture) {
FILE: src/engine/texture/Texture.h
type Image (line 10) | struct Image {
function class (line 21) | class Texture {
FILE: src/engine/texture/vendor/stb_image.h
type stbi_uc (line 356) | typedef unsigned char stbi_uc;
type stbi_us (line 357) | typedef unsigned short stbi_us;
type stbi_io_callbacks (line 380) | typedef struct
type stbi__uint16 (line 609) | typedef unsigned short stbi__uint16;
type stbi__int16 (line 610) | typedef signed short stbi__int16;
type stbi__uint32 (line 611) | typedef unsigned int stbi__uint32;
type stbi__int32 (line 612) | typedef signed int stbi__int32;
type stbi__uint16 (line 615) | typedef uint16_t stbi__uint16;
type stbi__int16 (line 616) | typedef int16_t stbi__int16;
type stbi__uint32 (line 617) | typedef uint32_t stbi__uint32;
type stbi__int32 (line 618) | typedef int32_t stbi__int32;
function stbi__cpuid3 (line 699) | static int stbi__cpuid3(void)
function stbi__sse2_available (line 721) | static int stbi__sse2_available(void)
function stbi__sse2_available (line 732) | static int stbi__sse2_available(void)
type stbi__context (line 769) | typedef struct
function stbi__start_mem (line 790) | static void stbi__start_mem(stbi__context* s, stbi_uc const* buffer, int...
function stbi__start_callbacks (line 800) | static void stbi__start_callbacks(stbi__context* s, stbi_io_callbacks* c...
function stbi__stdio_read (line 814) | static int stbi__stdio_read(void* user, char* data, int size)
function stbi__stdio_skip (line 819) | static void stbi__stdio_skip(void* user, int n)
function stbi__stdio_eof (line 829) | static int stbi__stdio_eof(void* user)
function stbi__start_file (line 841) | static void stbi__start_file(stbi__context* s, FILE* f)
function stbi__rewind (line 850) | static void stbi__rewind(stbi__context* s)
type stbi__result_info (line 865) | typedef struct
function STBIDEF (line 935) | STBIDEF const char* stbi_failure_reason(void)
function stbi__err (line 941) | static int stbi__err(const char* str)
function stbi__addsizes_valid (line 965) | static int stbi__addsizes_valid(int a, int b)
function stbi__mul2sizes_valid (line 977) | static int stbi__mul2sizes_valid(int a, int b)
function stbi__mad2sizes_valid (line 987) | static int stbi__mad2sizes_valid(int a, int b, int add)
function stbi__mad3sizes_valid (line 994) | static int stbi__mad3sizes_valid(int a, int b, int c, int add)
function stbi__mad4sizes_valid (line 1002) | static int stbi__mad4sizes_valid(int a, int b, int c, int d, int add)
function STBIDEF (line 1047) | STBIDEF void stbi_image_free(void* retval_from_stbi_load)
function STBIDEF (line 1062) | STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip)
function STBIDEF (line 1072) | STBIDEF void stbi_set_flip_vertically_on_load_thread(int flag_true_if_sh...
function stbi_uc (line 1130) | static stbi_uc* stbi__convert_16_to_8(stbi__uint16* orig, int w, int h, ...
function stbi__uint16 (line 1146) | static stbi__uint16* stbi__convert_8_to_16(stbi_uc* orig, int w, int h, ...
function stbi__vertical_flip (line 1162) | static void stbi__vertical_flip(void* image, int w, int h, int bytes_per...
function stbi__vertical_flip_slices (line 1187) | static void stbi__vertical_flip_slices(void* image, int w, int h, int z,...
function stbi__uint16 (line 1226) | static stbi__uint16* stbi__load_and_postprocess_16bit(stbi__context* s, ...
function stbi__float_postprocess (line 1254) | static void stbi__float_postprocess(float* result, int* x, int* y, int* ...
function STBIDEF (line 1271) | STBIDEF int stbi_convert_wchar_to_utf8(char* buffer, size_t bufferlen, c...
function FILE (line 1277) | static FILE* stbi__fopen(char const* filename, char const* mode)
function STBIDEF (line 1306) | STBIDEF stbi_uc* stbi_load(char const* filename, int* x, int* y, int* co...
function STBIDEF (line 1316) | STBIDEF stbi_uc* stbi_load_from_file(FILE* f, int* x, int* y, int* comp,...
function STBIDEF (line 1329) | STBIDEF stbi__uint16* stbi_load_from_file_16(FILE* f, int* x, int* y, in...
function STBIDEF (line 1342) | STBIDEF stbi_us* stbi_load_16(char const* filename, int* x, int* y, int*...
function STBIDEF (line 1355) | STBIDEF stbi_us* stbi_load_16_from_memory(stbi_uc const* buffer, int len...
function STBIDEF (line 1362) | STBIDEF stbi_us* stbi_load_16_from_callbacks(stbi_io_callbacks const* cl...
function STBIDEF (line 1369) | STBIDEF stbi_uc* stbi_load_from_memory(stbi_uc const* buffer, int len, i...
function STBIDEF (line 1376) | STBIDEF stbi_uc* stbi_load_from_callbacks(stbi_io_callbacks const* clbk,...
function STBIDEF (line 1384) | STBIDEF stbi_uc* stbi_load_gif_from_memory(stbi_uc const* buffer, int le...
function STBIDEF (line 1418) | STBIDEF float* stbi_loadf_from_memory(stbi_uc const* buffer, int len, in...
function STBIDEF (line 1425) | STBIDEF float* stbi_loadf_from_callbacks(stbi_io_callbacks const* clbk, ...
function STBIDEF (line 1433) | STBIDEF float* stbi_loadf(char const* filename, int* x, int* y, int* com...
function STBIDEF (line 1443) | STBIDEF float* stbi_loadf_from_file(FILE* f, int* x, int* y, int* comp, ...
function STBIDEF (line 1457) | STBIDEF int stbi_is_hdr_from_memory(stbi_uc const* buffer, int len)
function STBIDEF (line 1471) | STBIDEF int stbi_is_hdr(char const* filename)
function STBIDEF (line 1482) | STBIDEF int stbi_is_hdr_from_file(FILE* f)
function STBIDEF (line 1499) | STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const* clb...
function STBIDEF (line 1515) | STBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = ga...
function STBIDEF (line 1516) | STBIDEF void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = sc...
function STBIDEF (line 1521) | STBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = ...
function STBIDEF (line 1522) | STBIDEF void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = ...
function stbi__refill_buffer (line 1537) | static void stbi__refill_buffer(stbi__context* s)
function stbi_inline (line 1555) | stbi_inline static stbi_uc stbi__get8(stbi__context* s)
function stbi_inline (line 1569) | stbi_inline static int stbi__at_eof(stbi__context* s)
function stbi__skip (line 1585) | static void stbi__skip(stbi__context* s, int n)
function stbi__getn (line 1607) | static int stbi__getn(stbi__context* s, stbi_uc* buffer, int n)
function stbi__get16be (line 1636) | static int stbi__get16be(stbi__context* s)
function stbi__uint32 (line 1646) | static stbi__uint32 stbi__get32be(stbi__context* s)
function stbi__get16le (line 1656) | static int stbi__get16le(stbi__context* s)
function stbi__uint32 (line 1664) | static stbi__uint32 stbi__get32le(stbi__context* s)
function stbi_uc (line 1687) | static stbi_uc stbi__compute_y(int r, int g, int b)
function stbi__uint16 (line 1744) | static stbi__uint16 stbi__compute_y_16(int r, int g, int b)
function stbi__uint16 (line 1753) | static stbi__uint16* stbi__convert_format16(stbi__uint16* data, int img_...
function stbi_uc (line 1825) | static stbi_uc* stbi__hdr_to_ldr(float* data, int x, int y, int comp)
type stbi__huffman (line 1879) | typedef struct
type stbi__jpeg (line 1890) | typedef struct
function stbi__build_huffman (line 1944) | static int stbi__build_huffman(stbi__huffman* h, int* count)
function stbi__build_fast_ac (line 1988) | static void stbi__build_fast_ac(stbi__int16* fast_ac, stbi__huffman* h)
function stbi__grow_buffer_unsafe (line 2013) | static void stbi__grow_buffer_unsafe(stbi__jpeg* j)
function stbi_inline (line 2035) | stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg* j, stbi__huffm...
function stbi_inline (line 2089) | stbi_inline static int stbi__extend_receive(stbi__jpeg* j, int n)
function stbi_inline (line 2105) | stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg* j, int n)
function stbi_inline (line 2116) | stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg* j)
function stbi__jpeg_decode_block (line 2144) | static int stbi__jpeg_decode_block(stbi__jpeg* j, short data[64], stbi__...
function stbi__jpeg_decode_block_prog_dc (line 2198) | static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg* j, short data[64]...
function stbi__jpeg_decode_block_prog_ac (line 2227) | static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg* j, short data[64]...
function stbi_inline (line 2354) | stbi_inline static stbi_uc stbi__clamp(int x)
function stbi__idct_block (line 2405) | static void stbi__idct_block(stbi_uc* out, int out_stride, short data[64])
function stbi__idct_simd (line 2469) | static void stbi__idct_simd(stbi_uc* out, int out_stride, short data[64])
function stbi__idct_simd (line 2650) | static void stbi__idct_simd(stbi_uc* out, int out_stride, short data[64])
function stbi_uc (line 2858) | static stbi_uc stbi__get_marker(stbi__jpeg* j)
function stbi__jpeg_reset (line 2875) | static void stbi__jpeg_reset(stbi__jpeg* j)
function stbi__parse_entropy_coded_data (line 2888) | static int stbi__parse_entropy_coded_data(stbi__jpeg* z)
function stbi__jpeg_dequantize (line 3016) | static void stbi__jpeg_dequantize(short* data, stbi__uint16* dequant)
function stbi__jpeg_finish (line 3023) | static void stbi__jpeg_finish(stbi__jpeg* z)
function stbi__process_marker (line 3042) | static int stbi__process_marker(stbi__jpeg* z, int m)
function stbi__process_scan_header (line 3147) | static int stbi__process_scan_header(stbi__jpeg* z)
function stbi__free_jpeg_components (line 3187) | static int stbi__free_jpeg_components(stbi__jpeg* z, int ncomp, int why)
function stbi__process_frame_header (line 3209) | static int stbi__process_frame_header(stbi__jpeg* z, int scan)
function stbi__decode_jpeg_header (line 3303) | static int stbi__decode_jpeg_header(stbi__jpeg* z, int scan)
function stbi__decode_jpeg_image (line 3328) | static int stbi__decode_jpeg_image(stbi__jpeg* j)
type stbi_uc (line 3372) | typedef stbi_uc* (*resample_row_func)(stbi_uc* out, stbi_uc* in0, stbi_u...
function stbi_uc (line 3377) | static stbi_uc* resample_row_1(stbi_uc* out, stbi_uc* in_near, stbi_uc* ...
function stbi_uc (line 3386) | static stbi_uc* stbi__resample_row_v_2(stbi_uc* out, stbi_uc* in_near, s...
function stbi_uc (line 3396) | static stbi_uc* stbi__resample_row_h_2(stbi_uc* out, stbi_uc* in_near, s...
function stbi_uc (line 3426) | static stbi_uc* stbi__resample_row_hv_2(stbi_uc* out, stbi_uc* in_near, ...
function stbi_uc (line 3451) | static stbi_uc* stbi__resample_row_hv_2_simd(stbi_uc* out, stbi_uc* in_n...
function stbi_uc (line 3567) | static stbi_uc* stbi__resample_row_generic(stbi_uc* out, stbi_uc* in_nea...
function stbi__YCbCr_to_RGB_row (line 3581) | static void stbi__YCbCr_to_RGB_row(stbi_uc* out, const stbi_uc* y, const...
function stbi__YCbCr_to_RGB_simd (line 3607) | static void stbi__YCbCr_to_RGB_simd(stbi_uc* out, stbi_uc const* y, stbi...
function stbi__setup_jpeg (line 3742) | static void stbi__setup_jpeg(stbi__jpeg* j)
function stbi__cleanup_jpeg (line 3764) | static void stbi__cleanup_jpeg(stbi__jpeg* j)
type stbi__resample (line 3769) | typedef struct
function stbi_uc (line 3780) | static stbi_uc stbi__blinn_8x8(stbi_uc x, stbi_uc y)
function stbi_uc (line 3786) | static stbi_uc* load_jpeg_image(stbi__jpeg* z, int* out_x, int* out_y, i...
function stbi__jpeg_test (line 3966) | static int stbi__jpeg_test(stbi__context* s)
function stbi__jpeg_info_raw (line 3978) | static int stbi__jpeg_info_raw(stbi__jpeg* j, int* x, int* y, int* comp)
function stbi__jpeg_info (line 3990) | static int stbi__jpeg_info(stbi__context* s, int* x, int* y, int* comp)
type stbi__zhuffman (line 4016) | typedef struct
function stbi_inline (line 4026) | stbi_inline static int stbi__bitreverse16(int n)
function stbi_inline (line 4035) | stbi_inline static int stbi__bit_reverse(int v, int bits)
function stbi__zbuild_huffman (line 4043) | static int stbi__zbuild_huffman(stbi__zhuffman* z, const stbi_uc* sizeli...
type stbi__zbuf (line 4096) | typedef struct
function stbi_inline (line 4110) | stbi_inline static int stbi__zeof(stbi__zbuf* z)
function stbi_inline (line 4115) | stbi_inline static stbi_uc stbi__zget8(stbi__zbuf* z)
function stbi__fill_bits (line 4120) | static void stbi__fill_bits(stbi__zbuf* z)
function stbi__zreceive (line 4132) | int stbi__zreceive(stbi__zbuf* z, int n)
function stbi__zhuffman_decode_slowpath (line 4142) | static int stbi__zhuffman_decode_slowpath(stbi__zbuf* a, stbi__zhuffman* z)
function stbi_inline (line 4161) | stbi_inline static int stbi__zhuffman_decode(stbi__zbuf* a, stbi__zhuffm...
function stbi__zexpand (line 4180) | static int stbi__zexpand(stbi__zbuf* z, char* zout, int n) // need to m...
function stbi__parse_huffman_block (line 4216) | static int stbi__parse_huffman_block(stbi__zbuf* a)
function stbi__compute_huffman_codes (line 4260) | static int stbi__compute_huffman_codes(stbi__zbuf* a)
function stbi__parse_uncompressed_block (line 4313) | static int stbi__parse_uncompressed_block(stbi__zbuf* a)
function stbi__parse_zlib_header (line 4342) | static int stbi__parse_zlib_header(stbi__zbuf* a)
function stbi__parse_zlib (line 4385) | static int stbi__parse_zlib(stbi__zbuf* a, int parse_header)
function stbi__do_zlib (line 4416) | static int stbi__do_zlib(stbi__zbuf* a, char* obuf, int olen, int exp, i...
function STBIDEF (line 4426) | STBIDEF char* stbi_zlib_decode_malloc_guesssize(const char* buffer, int ...
function STBIDEF (line 4443) | STBIDEF char* stbi_zlib_decode_malloc(char const* buffer, int len, int* ...
function STBIDEF (line 4448) | STBIDEF char* stbi_zlib_decode_malloc_guesssize_headerflag(const char* b...
function STBIDEF (line 4465) | STBIDEF int stbi_zlib_decode_buffer(char* obuffer, int olen, char const*...
function STBIDEF (line 4476) | STBIDEF char* stbi_zlib_decode_noheader_malloc(char const* buffer, int l...
function STBIDEF (line 4493) | STBIDEF int stbi_zlib_decode_noheader_buffer(char* obuffer, int olen, co...
type stbi__pngchunk (line 4516) | typedef struct
function stbi__pngchunk (line 4522) | static stbi__pngchunk stbi__get_chunk_header(stbi__context* s)
function stbi__check_png_header (line 4530) | static int stbi__check_png_header(stbi__context* s)
type stbi__png (line 4539) | typedef struct
function stbi__paeth (line 4567) | static int stbi__paeth(int a, int b, int c)
function stbi__create_png_image_raw (line 4581) | static int stbi__create_png_image_raw(stbi__png* a, stbi_uc* raw, stbi__...
function stbi__create_png_image (line 4800) | static int stbi__create_png_image(stbi__png* a, stbi_uc* image_data, stb...
function stbi__compute_transparency (line 4844) | static int stbi__compute_transparency(stbi__png* z, stbi_uc tc[3], int o...
function stbi__compute_transparency16 (line 4870) | static int stbi__compute_transparency16(stbi__png* z, stbi__uint16 tc[3]...
function stbi__expand_png_palette (line 4896) | static int stbi__expand_png_palette(stbi__png* a, stbi_uc* palette, int ...
function STBIDEF (line 4937) | STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpr...
function STBIDEF (line 4942) | STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_conv...
function stbi__de_iphone (line 4947) | static void stbi__de_iphone(stbi__png* z)
function stbi__parse_png_file (line 4995) | static int stbi__parse_png_file(stbi__png* z, int scan, int req_comp)
function stbi__png_test (line 5215) | static int stbi__png_test(stbi__context* s)
function stbi__png_info_raw (line 5223) | static int stbi__png_info_raw(stbi__png* p, int* x, int* y, int* comp)
function stbi__png_info (line 5235) | static int stbi__png_info(stbi__context* s, int* x, int* y, int* comp)
function stbi__png_is16 (line 5242) | static int stbi__png_is16(stbi__context* s)
function stbi__bmp_test_raw (line 5259) | static int stbi__bmp_test_raw(stbi__context* s)
function stbi__bmp_test (line 5274) | static int stbi__bmp_test(stbi__context* s)
function stbi__high_bit (line 5283) | static int stbi__high_bit(unsigned int z)
function stbi__bitcount (line 5295) | static int stbi__bitcount(unsigned int a)
function stbi__shiftsigned (line 5308) | static int stbi__shiftsigned(unsigned int v, int shift, int bits)
type stbi__bmp_data (line 5328) | typedef struct
function stbi__tga_get_comp (line 5628) | static int stbi__tga_get_comp(int bits_per_pixel, int is_grey, int* is_r...
function stbi__tga_info (line 5644) | static int stbi__tga_info(stbi__context* s, int* x, int* y, int* comp)
function stbi__tga_test (line 5711) | static int stbi__tga_test(stbi__context* s)
function stbi__tga_read_rgb16 (line 5744) | static void stbi__tga_read_rgb16(stbi__context* s, stbi_uc* out)
function stbi__psd_test (line 5979) | static int stbi__psd_test(stbi__context* s)
function stbi__psd_decode_rle (line 5986) | static int stbi__psd_decode_rle(stbi__context* s, stbi_uc* p, int pixelC...
function stbi__pic_is4 (line 6244) | static int stbi__pic_is4(stbi__context* s, const char* str)
function stbi__pic_test_core (line 6254) | static int stbi__pic_test_core(stbi__context* s)
type stbi__pic_packet (line 6270) | typedef struct
function stbi_uc (line 6275) | static stbi_uc* stbi__readval(stbi__context* s, int channel, stbi_uc* dest)
function stbi__copyval (line 6289) | static void stbi__copyval(int channel, stbi_uc* dest, const stbi_uc* src)
function stbi_uc (line 6298) | static stbi_uc* stbi__pic_load_core(stbi__context* s, int width, int hei...
function stbi__pic_test (line 6449) | static int stbi__pic_test(stbi__context* s)
type stbi__gif_lzw (line 6461) | typedef struct
type stbi__gif (line 6468) | typedef struct
function stbi__gif_test_raw (line 6488) | static int stbi__gif_test_raw(stbi__context* s)
function stbi__gif_test (line 6498) | static int stbi__gif_test(stbi__context* s)
function stbi__gif_parse_colortable (line 6505) | static void stbi__gif_parse_colortable(stbi__context* s, stbi_uc pal[256...
function stbi__gif_header (line 6516) | static int stbi__gif_header(stbi__context* s, stbi__gif* g, int* comp, i...
function stbi__gif_info_raw (line 6547) | static int stbi__gif_info_raw(stbi__context* s, int* x, int* y, int* comp)
function stbi__out_gif_code (line 6561) | static void stbi__out_gif_code(stbi__gif* g, stbi__uint16 code)
function stbi_uc (line 6598) | static stbi_uc* stbi__process_gif_raster(stbi__context* s, stbi__gif* g)
function stbi_uc (line 6690) | static stbi_uc* stbi__gif_load_next(stbi__context* s, stbi__gif* g, int*...
function stbi__gif_info (line 6982) | static int stbi__gif_info(stbi__context* s, int* x, int* y, int* comp)
function stbi__hdr_test_core (line 6992) | static int stbi__hdr_test_core(stbi__context* s, const char* signature)
function stbi__hdr_test (line 7002) | static int stbi__hdr_test(stbi__context* s)
function stbi__hdr_convert (line 7036) | static void stbi__hdr_convert(float* output, stbi_uc* input, int req_comp)
function stbi__hdr_info (line 7197) | static int stbi__hdr_info(stbi__context* s, int* x, int* y, int* comp)
function stbi__bmp_info (line 7243) | static int stbi__bmp_info(stbi__context* s, int* x, int* y, int* comp)
function stbi__psd_info (line 7266) | static int stbi__psd_info(stbi__context* s, int* x, int* y, int* comp)
function stbi__psd_is16 (line 7301) | static int stbi__psd_is16(stbi__context* s)
function stbi__pic_info (line 7330) | static int stbi__pic_info(stbi__context* s, int* x, int* y, int* comp)
function stbi__pnm_test (line 7402) | static int stbi__pnm_test(stbi__context* s)
function stbi__pnm_isspace (line 7443) | static int stbi__pnm_isspace(char c)
function stbi__pnm_skip_whitespace (line 7448) | static void stbi__pnm_skip_whitespace(stbi__context* s, char* c)
function stbi__pnm_isdigit (line 7462) | static int stbi__pnm_isdigit(char c)
function stbi__pnm_getinteger (line 7467) | static int stbi__pnm_getinteger(stbi__context* s, char* c)
function stbi__pnm_info (line 7479) | static int stbi__pnm_info(stbi__context* s, int* x, int* y, int* comp)
function stbi__info_main (line 7518) | static int stbi__info_main(stbi__context* s, int* x, int* y, int* comp)
function stbi__is_16_main (line 7560) | static int stbi__is_16_main(stbi__context* s)
function STBIDEF (line 7574) | STBIDEF int stbi_info(char const* filename, int* x, int* y, int* comp)
function STBIDEF (line 7584) | STBIDEF int stbi_info_from_file(FILE* f, int* x, int* y, int* comp)
function STBIDEF (line 7595) | STBIDEF int stbi_is_16_bit(char const* filename)
function STBIDEF (line 7605) | STBIDEF int stbi_is_16_bit_from_file(FILE* f)
function STBIDEF (line 7617) | STBIDEF int stbi_info_from_memory(stbi_uc const* buffer, int len, int* x...
function STBIDEF (line 7624) | STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const* c, void* u...
function STBIDEF (line 7631) | STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const* buffer, int len)
function STBIDEF (line 7638) | STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const* c, vo...
FILE: test/testCube/src/main.cpp
function main (line 34) | int main() {
FILE: test/testHDRI/src/ImguiStyles.h
type ImVec3 (line 10) | struct ImVec3 { float x, y, z; ImVec3(float _x = 0.0f, float _y = 0.0f, ...
function Style (line 12) | void Style() {
FILE: test/testHDRI/src/main.cpp
function main (line 24) | int main() {
function initImGui (line 160) | void initImGui(ImGuiIO& io) {
function dockSpace (line 179) | void dockSpace(bool* p_open) {
function renderImGui (line 236) | void renderImGui(ImGuiIO& io) {
FILE: test/testImGuiGLFW/src/ImguiStyles.h
type ImVec3 (line 10) | struct ImVec3 { float x, y, z; ImVec3(float _x = 0.0f, float _y = 0.0f, ...
function Style (line 12) | void Style() {
FILE: test/testImGuiGLFW/src/main.cpp
function main (line 56) | int main(void) {
function initImGui (line 945) | void initImGui(ImGuiIO& io) {
function dockSpace (line 964) | void dockSpace(bool* p_open) {
function renderImGui (line 1021) | void renderImGui(ImGuiIO& io) {
function resizeCallback (line 1037) | void resizeCallback(GLFWwindow* w, int width, int height) {
function keyCallback (line 1041) | void keyCallback(GLFWwindow* window, int key, int scancode, int action, ...
function updateFPSCamera (line 1053) | void updateFPSCamera(double xpos, double ypos) {
FILE: test/testLighting/src/main.cpp
function main (line 16) | int main() {
FILE: test/testModelPBR/src/ImguiStyles.h
type ImVec3 (line 10) | struct ImVec3 { float x, y, z; ImVec3(float _x = 0.0f, float _y = 0.0f, ...
function Style (line 12) | void Style() {
FILE: test/testModelPBR/src/main.cpp
function main (line 23) | int main() {
function initImGui (line 213) | void initImGui(ImGuiIO& io) {
function dockSpace (line 232) | void dockSpace(bool* p_open) {
function renderImGui (line 289) | void renderImGui(ImGuiIO& io) {
FILE: test/testPBR/src/main.cpp
function main (line 18) | int main() {
FILE: test/testPointCloud/src/ImguiStyles.h
type ImVec3 (line 10) | struct ImVec3 { float x, y, z; ImVec3(float _x = 0.0f, float _y = 0.0f, ...
function Style (line 12) | void Style() {
FILE: test/testPointCloud/src/main.cpp
function split (line 24) | std::vector<std::string> split(const std::string& str, const std::string...
function pointCloudPolytope (line 52) | Polytope::Ptr pointCloudPolytope(const std::string& path) {
function main (line 88) | int main() {
function initImGui (line 261) | void initImGui(ImGuiIO& io) {
function dockSpace (line 280) | void dockSpace(bool* p_open) {
function renderImGui (line 337) | void renderImGui(ImGuiIO& io) {
FILE: test/third_party/imgui/backends/imgui_impl_glfw.cpp
type GlfwClientApi (line 102) | enum GlfwClientApi
type ImGui_ImplGlfw_Data (line 109) | struct ImGui_ImplGlfw_Data
method ImGui_ImplGlfw_Data (line 131) | ImGui_ImplGlfw_Data() { memset((void*)this, 0, sizeof(*this)); }
function ImGui_ImplGlfw_Data (line 141) | static ImGui_ImplGlfw_Data* ImGui_ImplGlfw_GetBackendData()
method ImGui_ImplGlfw_Data (line 131) | ImGui_ImplGlfw_Data() { memset((void*)this, 0, sizeof(*this)); }
function ImGui_ImplGlfw_SetClipboardText (line 157) | static void ImGui_ImplGlfw_SetClipboardText(void* user_data, const char*...
function ImGuiKey (line 162) | static ImGuiKey ImGui_ImplGlfw_KeyToImGuiKey(int key)
function ImGui_ImplGlfw_KeyToModifier (line 275) | static int ImGui_ImplGlfw_KeyToModifier(int key)
function ImGui_ImplGlfw_UpdateKeyModifiers (line 288) | static void ImGui_ImplGlfw_UpdateKeyModifiers(int mods)
function ImGui_ImplGlfw_MouseButtonCallback (line 297) | void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, ...
function ImGui_ImplGlfw_ScrollCallback (line 310) | void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, d...
function ImGui_ImplGlfw_TranslateUntranslatedKey (line 320) | static int ImGui_ImplGlfw_TranslateUntranslatedKey(int key, int scancode)
function ImGui_ImplGlfw_KeyCallback (line 348) | void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int keycode, int sca...
function ImGui_ImplGlfw_WindowFocusCallback (line 373) | void ImGui_ImplGlfw_WindowFocusCallback(GLFWwindow* window, int focused)
function ImGui_ImplGlfw_CursorPosCallback (line 383) | void ImGui_ImplGlfw_CursorPosCallback(GLFWwindow* window, double x, doub...
function ImGui_ImplGlfw_CursorEnterCallback (line 403) | void ImGui_ImplGlfw_CursorEnterCallback(GLFWwindow* window, int entered)
function ImGui_ImplGlfw_CharCallback (line 423) | void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c)
function ImGui_ImplGlfw_MonitorCallback (line 433) | void ImGui_ImplGlfw_MonitorCallback(GLFWmonitor*, int)
function ImGui_ImplGlfw_InstallCallbacks (line 439) | void ImGui_ImplGlfw_InstallCallbacks(GLFWwindow* window)
function ImGui_ImplGlfw_RestoreCallbacks (line 456) | void ImGui_ImplGlfw_RestoreCallbacks(GLFWwindow* window)
function ImGui_ImplGlfw_Init (line 481) | static bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbac...
function ImGui_ImplGlfw_InitForOpenGL (line 549) | bool ImGui_ImplGlfw_InitForOpenGL(GLFWwindow* window, bool install_callb...
function ImGui_ImplGlfw_InitForVulkan (line 554) | bool ImGui_ImplGlfw_InitForVulkan(GLFWwindow* window, bool install_callb...
function ImGui_ImplGlfw_InitForOther (line 559) | bool ImGui_ImplGlfw_InitForOther(GLFWwindow* window, bool install_callba...
function ImGui_ImplGlfw_Shutdown (line 564) | void ImGui_ImplGlfw_Shutdown()
function ImGui_ImplGlfw_UpdateMouseData (line 583) | static void ImGui_ImplGlfw_UpdateMouseData()
function ImGui_ImplGlfw_UpdateMouseCursor (line 653) | static void ImGui_ImplGlfw_UpdateMouseCursor()
function Saturate (line 681) | static inline float Saturate(float v) { return v < 0.0f ? 0.0f : v > 1....
function ImGui_ImplGlfw_UpdateGamepads (line 682) | static void ImGui_ImplGlfw_UpdateGamepads()
function ImGui_ImplGlfw_UpdateMonitors (line 733) | static void ImGui_ImplGlfw_UpdateMonitors()
function ImGui_ImplGlfw_NewFrame (line 768) | void ImGui_ImplGlfw_NewFrame()
type ImGui_ImplGlfw_ViewportData (line 804) | struct ImGui_ImplGlfw_ViewportData
method ImGui_ImplGlfw_ViewportData (line 811) | ImGui_ImplGlfw_ViewportData() { Window = NULL; WindowOwned = false; I...
function ImGui_ImplGlfw_WindowCloseCallback (line 815) | static void ImGui_ImplGlfw_WindowCloseCallback(GLFWwindow* window)
function ImGui_ImplGlfw_WindowPosCallback (line 827) | static void ImGui_ImplGlfw_WindowPosCallback(GLFWwindow* window, int, int)
function ImGui_ImplGlfw_WindowSizeCallback (line 842) | static void ImGui_ImplGlfw_WindowSizeCallback(GLFWwindow* window, int, int)
function ImGui_ImplGlfw_CreateWindow (line 857) | static void ImGui_ImplGlfw_CreateWindow(ImGuiViewport* viewport)
function ImGui_ImplGlfw_DestroyWindow (line 901) | static void ImGui_ImplGlfw_DestroyWindow(ImGuiViewport* viewport)
function LRESULT (line 931) | static LRESULT CALLBACK WndProcNoInputs(HWND hWnd, UINT msg, WPARAM wPar...
function ImGui_ImplGlfw_ShowWindow (line 947) | static void ImGui_ImplGlfw_ShowWindow(ImGuiViewport* viewport)
function ImVec2 (line 986) | static ImVec2 ImGui_ImplGlfw_GetWindowPos(ImGuiViewport* viewport)
function ImGui_ImplGlfw_SetWindowPos (line 994) | static void ImGui_ImplGlfw_SetWindowPos(ImGuiViewport* viewport, ImVec2 ...
function ImVec2 (line 1001) | static ImVec2 ImGui_ImplGlfw_GetWindowSize(ImGuiViewport* viewport)
function ImGui_ImplGlfw_SetWindowSize (line 1009) | static void ImGui_ImplGlfw_SetWindowSize(ImGuiViewport* viewport, ImVec2...
function ImGui_ImplGlfw_SetWindowTitle (line 1026) | static void ImGui_ImplGlfw_SetWindowTitle(ImGuiViewport* viewport, const...
function ImGui_ImplGlfw_SetWindowFocus (line 1032) | static void ImGui_ImplGlfw_SetWindowFocus(ImGuiViewport* viewport)
function ImGui_ImplGlfw_GetWindowFocus (line 1043) | static bool ImGui_ImplGlfw_GetWindowFocus(ImGuiViewport* viewport)
function ImGui_ImplGlfw_GetWindowMinimized (line 1049) | static bool ImGui_ImplGlfw_GetWindowMinimized(ImGuiViewport* viewport)
function ImGui_ImplGlfw_SetWindowAlpha (line 1056) | static void ImGui_ImplGlfw_SetWindowAlpha(ImGuiViewport* viewport, float...
function ImGui_ImplGlfw_RenderWindow (line 1063) | static void ImGui_ImplGlfw_RenderWindow(ImGuiViewport* viewport, void*)
function ImGui_ImplGlfw_SwapBuffers (line 1071) | static void ImGui_ImplGlfw_SwapBuffers(ImGuiViewport* viewport, void*)
type VkAllocationCallbacks (line 1097) | struct VkAllocationCallbacks
type VkResult (line 1098) | enum VkResult { VK_RESULT_MAX_ENUM = 0x7FFFFFFF }
function ImGui_ImplGlfw_CreateVkSurface (line 1101) | static int ImGui_ImplGlfw_CreateVkSurface(ImGuiViewport* viewport, ImU64...
function ImGui_ImplGlfw_InitPlatformInterface (line 1112) | static void ImGui_ImplGlfw_InitPlatformInterface()
function ImGui_ImplGlfw_ShutdownPlatformInterface (line 1147) | static void ImGui_ImplGlfw_ShutdownPlatformInterface()
FILE: test/third_party/imgui/backends/imgui_impl_glfw.h
type GLFWwindow (line 28) | struct GLFWwindow
type GLFWmonitor (line 29) | struct GLFWmonitor
FILE: test/third_party/imgui/backends/imgui_impl_opengl3.cpp
type ImGui_ImplOpenGL3_Data (line 182) | struct ImGui_ImplOpenGL3_Data
method ImGui_ImplOpenGL3_Data (line 198) | ImGui_ImplOpenGL3_Data() { memset((void*)this, 0, sizeof(*this)); }
function ImGui_ImplOpenGL3_Data (line 203) | static ImGui_ImplOpenGL3_Data* ImGui_ImplOpenGL3_GetBackendData()
method ImGui_ImplOpenGL3_Data (line 198) | ImGui_ImplOpenGL3_Data() { memset((void*)this, 0, sizeof(*this)); }
function ImGui_ImplOpenGL3_Init (line 213) | bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
function ImGui_ImplOpenGL3_Shutdown (line 297) | void ImGui_ImplOpenGL3_Shutdown()
function ImGui_ImplOpenGL3_NewFrame (line 310) | void ImGui_ImplOpenGL3_NewFrame()
function ImGui_ImplOpenGL3_SetupRenderState (line 319) | static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, in...
function ImGui_ImplOpenGL3_RenderDrawData (line 395) | void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
function ImGui_ImplOpenGL3_CreateFontsTexture (line 542) | bool ImGui_ImplOpenGL3_CreateFontsTexture()
function ImGui_ImplOpenGL3_DestroyFontsTexture (line 574) | void ImGui_ImplOpenGL3_DestroyFontsTexture()
function CheckShader (line 587) | static bool CheckShader(GLuint handle, const char* desc)
function CheckProgram (line 606) | static bool CheckProgram(GLuint handle, const char* desc)
function ImGui_ImplOpenGL3_CreateDeviceObjects (line 624) | bool ImGui_ImplOpenGL3_CreateDeviceObjects()
function ImGui_ImplOpenGL3_DestroyDeviceObjects (line 812) | void ImGui_ImplOpenGL3_DestroyDeviceObjects()
function ImGui_ImplOpenGL3_RenderWindow (line 827) | static void ImGui_ImplOpenGL3_RenderWindow(ImGuiViewport* viewport, void*)
function ImGui_ImplOpenGL3_InitPlatformInterface (line 838) | static void ImGui_ImplOpenGL3_InitPlatformInterface()
function ImGui_ImplOpenGL3_ShutdownPlatformInterface (line 844) | static void ImGui_ImplOpenGL3_ShutdownPlatformInterface()
FILE: test/third_party/imgui/backends/imgui_impl_opengl3_loader.h
type khronos_float_t (line 53) | typedef float khronos_float_t;
type khronos_int8_t (line 54) | typedef signed char khronos_int8_t;
type khronos_uint8_t (line 55) | typedef unsigned char khronos_uint8_t;
type khronos_int16_t (line 56) | typedef signed short int khronos_int16_t;
type khronos_uint16_t (line 57) | typedef unsigned short int khronos_uint16_t;
type khronos_intptr_t (line 59) | typedef signed long long int khronos_intptr_t;
type khronos_ssize_t (line 60) | typedef signed long long int khronos_ssize_t;
type khronos_intptr_t (line 62) | typedef signed long int khronos_intptr_t;
type khronos_ssize_t (line 63) | typedef signed long int khronos_ssize_t;
type khronos_int64_t (line 67) | typedef signed __int64 khronos_int64_t;
type khronos_uint64_t (line 68) | typedef unsigned __int64 khronos_uint64_t;
type khronos_int64_t (line 71) | typedef int64_t khronos_int64_t;
type khronos_uint64_t (line 72) | typedef uint64_t khronos_uint64_t;
type khronos_int64_t (line 74) | typedef signed long long khronos_int64_t;
type khronos_uint64_t (line 75) | typedef unsigned long long khronos_uint64_t;
type GLvoid (line 131) | typedef void GLvoid;
type GLenum (line 132) | typedef unsigned int GLenum;
type khronos_float_t (line 134) | typedef khronos_float_t GLfloat;
type GLint (line 135) | typedef int GLint;
type GLsizei (line 136) | typedef int GLsizei;
type GLbitfield (line 137) | typedef unsigned int GLbitfield;
type GLdouble (line 138) | typedef double GLdouble;
type GLuint (line 139) | typedef unsigned int GLuint;
type GLboolean (line 140) | typedef unsigned char GLboolean;
type khronos_uint8_t (line 141) | typedef khronos_uint8_t GLubyte;
type GLubyte (line 184) | typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
type khronos_float_t (line 206) | typedef khronos_float_t GLclampf;
type GLclampd (line 207) | typedef double GLclampd;
type khronos_ssize_t (line 242) | typedef khronos_ssize_t GLsizeiptr;
type khronos_intptr_t (line 243) | typedef khronos_intptr_t GLintptr;
type GLchar (line 262) | typedef char GLchar;
type khronos_int16_t (line 263) | typedef khronos_int16_t GLshort;
type khronos_int8_t (line 264) | typedef khronos_int8_t GLbyte;
type khronos_uint16_t (line 265) | typedef khronos_uint16_t GLushort;
type khronos_uint16_t (line 321) | typedef khronos_uint16_t GLhalf;
type GLubyte (line 329) | typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLu...
type __GLsync (line 346) | struct __GLsync
type khronos_uint64_t (line 347) | typedef khronos_uint64_t GLuint64;
type khronos_int64_t (line 348) | typedef khronos_int64_t GLint64;
type khronos_uint64_t (line 376) | typedef khronos_uint64_t GLuint64EXT;
type _cl_context (line 379) | struct _cl_context
type _cl_event (line 380) | struct _cl_event
type khronos_int64_t (line 402) | typedef khronos_int64_t GLint64EXT;
type GL3WglProc (line 430) | typedef GL3WglProc (*GL3WGetProcAddressProc)(const char *proc);
type PROC (line 579) | typedef PROC(__stdcall* GL3WglGetProcAddr)(LPCSTR);
function open_libgl (line 582) | static int open_libgl(void)
function close_libgl (line 591) | static void close_libgl(void) { FreeLibrary(libgl); }
function GL3WglProc (line 592) | static GL3WglProc get_proc(const char *proc)
function open_libgl (line 604) | static int open_libgl(void)
function close_libgl (line 612) | static void close_libgl(void) { dlclose(libgl); }
function GL3WglProc (line 614) | static GL3WglProc get_proc(const char *proc)
function open_libgl (line 626) | static int open_libgl(void)
function close_libgl (line 635) | static void close_libgl(void) { dlclose(libgl); }
function GL3WglProc (line 637) | static GL3WglProc get_proc(const char *proc)
function parse_version (line 649) | static int parse_version(void)
function imgl3wInit (line 662) | int imgl3wInit(void)
function imgl3wInit2 (line 671) | int imgl3wInit2(GL3WGetProcAddressProc proc)
function imgl3wIsSupported (line 677) | int imgl3wIsSupported(int major, int minor)
function GL3WglProc (line 686) | GL3WglProc imgl3wGetProcAddress(const char *proc) { return get_proc(proc...
function load_procs (line 747) | static void load_procs(GL3WGetProcAddressProc proc)
FILE: test/third_party/imgui/backends/imgui_impl_vulkan.cpp
type ImGui_ImplVulkanH_FrameRenderBuffers (line 76) | struct ImGui_ImplVulkanH_FrameRenderBuffers
type ImGui_ImplVulkanH_WindowRenderBuffers (line 88) | struct ImGui_ImplVulkanH_WindowRenderBuffers
type ImGui_ImplVulkan_ViewportData (line 97) | struct ImGui_ImplVulkan_ViewportData
method ImGui_ImplVulkan_ViewportData (line 103) | ImGui_ImplVulkan_ViewportData() { WindowOwned = false; memset(...
type ImGui_ImplVulkan_Data (line 108) | struct ImGui_ImplVulkan_Data
method ImGui_ImplVulkan_Data (line 133) | ImGui_ImplVulkan_Data()
function ImGui_ImplVulkan_Data (line 356) | static ImGui_ImplVulkan_Data* ImGui_ImplVulkan_GetBackendData()
method ImGui_ImplVulkan_Data (line 133) | ImGui_ImplVulkan_Data()
function ImGui_ImplVulkan_MemoryType (line 361) | static uint32_t ImGui_ImplVulkan_MemoryType(VkMemoryPropertyFlags proper...
function check_vk_result (line 373) | static void check_vk_result(VkResult err)
function CreateOrResizeBuffer (line 383) | static void CreateOrResizeBuffer(VkBuffer& buffer, VkDeviceMemory& buffe...
function ImGui_ImplVulkan_SetupRenderState (line 417) | static void ImGui_ImplVulkan_SetupRenderState(ImDrawData* draw_data, VkP...
function ImGui_ImplVulkan_RenderDrawData (line 462) | void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuf...
function ImGui_ImplVulkan_CreateFontsTexture (line 605) | bool ImGui_ImplVulkan_CreateFontsTexture(VkCommandBuffer command_buffer)
function ImGui_ImplVulkan_CreateShaderModules (line 746) | static void ImGui_ImplVulkan_CreateShaderModules(VkDevice device, const ...
function ImGui_ImplVulkan_CreateFontSampler (line 770) | static void ImGui_ImplVulkan_CreateFontSampler(VkDevice device, const Vk...
function ImGui_ImplVulkan_CreateDescriptorSetLayout (line 792) | static void ImGui_ImplVulkan_CreateDescriptorSetLayout(VkDevice device, ...
function ImGui_ImplVulkan_CreatePipelineLayout (line 813) | static void ImGui_ImplVulkan_CreatePipelineLayout(VkDevice device, const...
function ImGui_ImplVulkan_CreatePipeline (line 836) | static void ImGui_ImplVulkan_CreatePipeline(VkDevice device, const VkAll...
function ImGui_ImplVulkan_CreateDeviceObjects (line 942) | bool ImGui_ImplVulkan_CreateDeviceObjects()
function ImGui_ImplVulkan_DestroyFontUploadObjects (line 1004) | void ImGui_ImplVulkan_DestroyFontUploadObjects()
function ImGui_ImplVulkan_DestroyDeviceObjects (line 1020) | void ImGui_ImplVulkan_DestroyDeviceObjects()
function ImGui_ImplVulkan_LoadFunctions (line 1038) | bool ImGui_ImplVulkan_LoadFunctions(PFN_vkVoidFunction(*loader_func)(...
function ImGui_ImplVulkan_Init (line 1059) | bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info, VkRenderP...
function ImGui_ImplVulkan_Shutdown (line 1098) | void ImGui_ImplVulkan_Shutdown()
function ImGui_ImplVulkan_NewFrame (line 1121) | void ImGui_ImplVulkan_NewFrame()
function ImGui_ImplVulkan_SetMinImageCount (line 1128) | void ImGui_ImplVulkan_SetMinImageCount(uint32_t min_image_count)
function VkDescriptorSet (line 1146) | VkDescriptorSet ImGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageVi...
function VkSurfaceFormatKHR (line 1196) | VkSurfaceFormatKHR ImGui_ImplVulkanH_SelectSurfaceFormat(VkPhysicalDevic...
function VkPresentModeKHR (line 1241) | VkPresentModeKHR ImGui_ImplVulkanH_SelectPresentMode(VkPhysicalDevice ph...
function ImGui_ImplVulkanH_CreateWindowCommandBuffers (line 1264) | void ImGui_ImplVulkanH_CreateWindowCommandBuffers(VkPhysicalDevice physi...
function ImGui_ImplVulkanH_GetMinImageCountFromPresentMode (line 1311) | int ImGui_ImplVulkanH_GetMinImageCountFromPresentMode(VkPresentModeKHR p...
function ImGui_ImplVulkanH_CreateWindowSwapChain (line 1324) | void ImGui_ImplVulkanH_CreateWindowSwapChain(VkPhysicalDevice physical_d...
function ImGui_ImplVulkanH_CreateOrResizeWindow (line 1492) | void ImGui_ImplVulkanH_CreateOrResizeWindow(VkInstance instance, VkPhysi...
function ImGui_ImplVulkanH_DestroyWindow (line 1501) | void ImGui_ImplVulkanH_DestroyWindow(VkInstance instance, VkDevice devic...
function ImGui_ImplVulkanH_DestroyFrame (line 1523) | void ImGui_ImplVulkanH_DestroyFrame(VkDevice device, ImGui_ImplVulkanH_F...
function ImGui_ImplVulkanH_DestroyFrameSemaphores (line 1536) | void ImGui_ImplVulkanH_DestroyFrameSemaphores(VkDevice device, ImGui_Imp...
function ImGui_ImplVulkanH_DestroyFrameRenderBuffers (line 1543) | void ImGui_ImplVulkanH_DestroyFrameRenderBuffers(VkDevice device, ImGui_...
function ImGui_ImplVulkanH_DestroyWindowRenderBuffers (line 1553) | void ImGui_ImplVulkanH_DestroyWindowRenderBuffers(VkDevice device, ImGui...
function ImGui_ImplVulkanH_DestroyAllViewportsRenderBuffers (line 1563) | void ImGui_ImplVulkanH_DestroyAllViewportsRenderBuffers(VkDevice device,...
function ImGui_ImplVulkan_CreateWindow (line 1577) | static void ImGui_ImplVulkan_CreateWindow(ImGuiViewport* viewport)
function ImGui_ImplVulkan_DestroyWindow (line 1616) | static void ImGui_ImplVulkan_DestroyWindow(ImGuiViewport* viewport)
function ImGui_ImplVulkan_SetWindowSize (line 1631) | static void ImGui_ImplVulkan_SetWindowSize(ImGuiViewport* viewport, ImVe...
function ImGui_ImplVulkan_RenderWindow (line 1642) | static void ImGui_ImplVulkan_RenderWindow(ImGuiViewport* viewport, void*)
function ImGui_ImplVulkan_SwapBuffers (line 1716) | static void ImGui_ImplVulkan_SwapBuffers(ImGuiViewport* viewport, void*)
function ImGui_ImplVulkan_InitPlatformInterface (line 1744) | void ImGui_ImplVulkan_InitPlatformInterface()
function ImGui_ImplVulkan_ShutdownPlatformInterface (line 1756) | void ImGui_ImplVulkan_ShutdownPlatformInterface()
FILE: test/third_party/imgui/backends/imgui_impl_vulkan.h
type ImGui_ImplVulkan_InitInfo (line 50) | struct ImGui_ImplVulkan_InitInfo
type ImGui_ImplVulkanH_Frame (line 100) | struct ImGui_ImplVulkanH_Frame
type ImGui_ImplVulkanH_Window (line 101) | struct ImGui_ImplVulkanH_Window
type ImGui_ImplVulkanH_Frame (line 113) | struct ImGui_ImplVulkanH_Frame
type ImGui_ImplVulkanH_FrameSemaphores (line 123) | struct ImGui_ImplVulkanH_FrameSemaphores
type ImGui_ImplVulkanH_Window (line 131) | struct ImGui_ImplVulkanH_Window
FILE: test/third_party/imgui/imgui.cpp
type ImGui (line 956) | namespace ImGui
function FreeWrapper (line 1049) | static void FreeWrapper(void* ptr, void* user_data) { IM_UNUSE...
function FreeWrapper (line 1052) | static void FreeWrapper(void* ptr, void* user_data) { IM_UNUSE...
function ImVec2 (line 1447) | ImVec2 ImBezierCubicClosestPoint(const ImVec2& p1, const ImVec2& p2, con...
function ImBezierCubicClosestPointCasteljauStep (line 1470) | static void ImBezierCubicClosestPointCasteljauStep(const ImVec2& p, ImVe...
function ImVec2 (line 1505) | ImVec2 ImBezierCubicClosestPointCasteljau(const ImVec2& p1, const ImVec2...
function ImVec2 (line 1515) | ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2...
function ImTriangleContainsPoint (line 1528) | bool ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImV...
function ImTriangleBarycentricCoords (line 1536) | void ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const...
function ImVec2 (line 1547) | ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const Im...
function ImStricmp (line 1568) | int ImStricmp(const char* str1, const char* str2)
function ImStrnicmp (line 1575) | int ImStrnicmp(const char* str1, const char* str2, size_t count)
function ImStrncpy (line 1582) | void ImStrncpy(char* dst, const char* src, size_t count)
function ImStrlenW (line 1618) | int ImStrlenW(const ImWchar* str)
function ImWchar (line 1633) | const ImWchar* ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf...
function ImStrTrimBlanks (line 1663) | void ImStrTrimBlanks(char* buf)
function ImFormatString (line 1707) | int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...)
function ImFormatStringV (line 1725) | int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list...
function ImGuiID (line 1767) | ImGuiID ImHashData(const void* data_p, size_t data_size, ImU32 seed)
function ImGuiID (line 1783) | ImGuiID ImHashStr(const char* data_p, size_t data_size, ImU32 seed)
function ImFileHandle (line 1818) | ImFileHandle ImFileOpen(const char* filename, const char* mode)
function ImFileClose (line 1836) | bool ImFileClose(ImFileHandle f) { return fclose(f) == 0; }
function ImU64 (line 1837) | ImU64 ImFileGetSize(ImFileHandle f) { long off = 0, sz = 0; return (...
function ImU64 (line 1838) | ImU64 ImFileRead(void* data, ImU64 sz, ImU64 count, ImFileHandle f) ...
function ImU64 (line 1839) | ImU64 ImFileWrite(const void* data, ImU64 sz, ImU64 count, ImFileHandl...
function ImTextCharFromUtf8 (line 1891) | int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, cons...
function ImTextStrFromUtf8 (line 1943) | int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, c...
function ImTextCountCharsFromUtf8 (line 1961) | int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
function ImTextCharToUtf8_inline (line 1976) | static inline int ImTextCharToUtf8_inline(char* buf, int buf_size, unsig...
function ImTextCountUtf8BytesFromChar (line 2019) | int ImTextCountUtf8BytesFromChar(const char* in_text, const char* in_tex...
function ImTextCountUtf8BytesFromChar (line 2025) | static inline int ImTextCountUtf8BytesFromChar(unsigned int c)
function ImTextStrToUtf8 (line 2034) | int ImTextStrToUtf8(char* out_buf, int out_buf_size, const ImWchar* in_t...
function ImTextCountUtf8BytesFromStr (line 2050) | int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* i...
function IMGUI_API (line 2069) | IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b)
function ImVec4 (line 2078) | ImVec4 ImGui::ColorConvertU32ToFloat4(ImU32 in)
function ImU32 (line 2088) | ImU32 ImGui::ColorConvertFloat4ToU32(const ImVec4& in)
type StaticFunc (line 2180) | struct StaticFunc
method PairComparerByID (line 2182) | PairComparerByID(const void* lhs, const void* rhs)
function GetSkipItemForListClipping (line 2473) | static bool GetSkipItemForListClipping()
function ImGuiListClipper_SortAndFuseRanges (line 2527) | static void ImGuiListClipper_SortAndFuseRanges(ImVector<ImGuiListClipper...
function ImGuiListClipper_SeekCursorAndSetupPrevLine (line 2551) | static void ImGuiListClipper_SeekCursorAndSetupPrevLine(float pos_y, flo...
function ImGuiListClipper_SeekCursorForItem (line 2576) | static void ImGuiListClipper_SeekCursorForItem(ImGuiListClipper* clipper...
function ImGuiStyle (line 2785) | ImGuiStyle& ImGui::GetStyle()
function ImU32 (line 2791) | ImU32 ImGui::GetColorU32(ImGuiCol idx, float alpha_mul)
function ImU32 (line 2799) | ImU32 ImGui::GetColorU32(const ImVec4& col)
function ImVec4 (line 2807) | const ImVec4& ImGui::GetStyleColorVec4(ImGuiCol idx)
function ImU32 (line 2813) | ImU32 ImGui::GetColorU32(ImU32 col)
type ImGuiStyleVarInfo (line 2856) | struct ImGuiStyleVarInfo
function ImGuiStyleVarInfo (line 2898) | static const ImGuiStyleVarInfo* GetStyleVarInfo(ImGuiStyleVar idx)
function ImGuiID (line 3330) | ImGuiID ImGuiWindow::GetID(const char* str, const char* str_end)
function ImGuiID (line 3340) | ImGuiID ImGuiWindow::GetID(const void* ptr)
function ImGuiID (line 3350) | ImGuiID ImGuiWindow::GetID(int n)
function ImGuiID (line 3361) | ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs)
function SetCurrentWindow (line 3369) | static void SetCurrentWindow(ImGuiWindow* window)
function ImGuiID (line 3462) | ImGuiID ImGui::GetHoveredID()
function IsWindowContentHoverable (line 3492) | static inline bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHo...
function ImGuiContext (line 3711) | ImGuiContext* ImGui::GetCurrentContext()
function ImGuiContext (line 3740) | ImGuiContext* ImGui::CreateContext(ImFontAtlas* shared_font_atlas)
function ImGuiID (line 3763) | ImGuiID ImGui::AddContextHook(ImGuiContext* ctx, const ImGuiContextHook*...
function ImGuiIO (line 3792) | ImGuiIO& ImGui::GetIO()
function ImGuiPlatformIO (line 3798) | ImGuiPlatformIO& ImGui::GetPlatformIO()
function ImDrawData (line 3805) | ImDrawData* ImGui::GetDrawData()
function ImDrawList (line 3822) | static ImDrawList* GetViewportDrawList(ImGuiViewportP* viewport, size_t ...
function ImDrawList (line 3846) | ImDrawList* ImGui::GetBackgroundDrawList(ImGuiViewport* viewport)
function ImDrawList (line 3851) | ImDrawList* ImGui::GetBackgroundDrawList()
function ImDrawList (line 3857) | ImDrawList* ImGui::GetForegroundDrawList(ImGuiViewport* viewport)
function ImDrawList (line 3862) | ImDrawList* ImGui::GetForegroundDrawList()
function ImDrawListSharedData (line 3868) | ImDrawListSharedData* ImGui::GetDrawListSharedData()
function TranslateWindow (line 4045) | static void TranslateWindow(ImGuiWindow* window, const ImVec2& delta)
function ScaleWindow (line 4057) | static void ScaleWindow(ImGuiWindow* window, float scale)
function IsWindowActiveAndVisible (line 4066) | static bool IsWindowActiveAndVisible(ImGuiWindow* window)
function StartLockWheelingWindow (line 4203) | static void StartLockWheelingWindow(ImGuiWindow* window)
function ImGuiModFlags (line 4377) | ImGuiModFlags ImGui::GetMergedModFlags()
function AddWindowToSortBuffer (line 4738) | static void AddWindowToSortBuffer(ImVector<ImGuiWindow*>* out_sorted_win...
function AddDrawListToDrawData (line 4754) | static void AddDrawListToDrawData(ImVector<ImDrawList*>* out_list, ImDra...
function AddWindowToDrawData (line 4789) | static void AddWindowToDrawData(ImGuiWindow* window, int layer)
function GetWindowDisplayLayer (line 4805) | static inline int GetWindowDisplayLayer(ImGuiWindow* window)
function AddRootWindowToDrawData (line 4811) | static inline void AddRootWindowToDrawData(ImGuiWindow* window)
function SetupViewportDrawData (line 4834) | static void SetupViewportDrawData(ImGuiViewportP* viewport, ImVector<ImD...
function ImGuiWindow (line 4883) | static ImGuiWindow* FindFrontMostVisibleChildWindow(ImGuiWindow* window)
function ImGuiWindow (line 4929) | ImGuiWindow* ImGui::FindBottomMostVisibleWindowWithinBeginStack(ImGuiWin...
function ImVec2 (line 5164) | ImVec2 ImGui::CalcTextSize(const char* text, const char* text_end, bool ...
function FindHoveredWindow (line 5194) | static void FindHoveredWindow()
function ImVec2 (line 5385) | ImVec2 ImGui::GetItemRectMin()
function ImVec2 (line 5391) | ImVec2 ImGui::GetItemRectMax()
function ImVec2 (line 5397) | ImVec2 ImGui::GetItemRectSize()
function SetWindowConditionAllowFlags (line 5531) | static void SetWindowConditionAllowFlags(ImGuiWindow* window, ImGuiCond ...
function ImGuiWindow (line 5539) | ImGuiWindow* ImGui::FindWindowByID(ImGuiID id)
function ImGuiWindow (line 5545) | ImGuiWindow* ImGui::FindWindowByName(const char* name)
function ApplyWindowSettings (line 5551) | static void ApplyWindowSettings(ImGuiWindow* window, ImGuiWindowSettings...
function UpdateWindowInFocusOrderList (line 5568) | static void UpdateWindowInFocusOrderList(ImGuiWindow* window, bool just_...
function ImGuiWindow (line 5591) | static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags f...
function ImGuiWindow (line 5640) | static ImGuiWindow* GetWindowForTitleDisplay(ImGuiWindow* window)
function ImGuiWindow (line 5645) | static ImGuiWindow* GetWindowForTitleAndMenuHeight(ImGuiWindow* window)
function ImVec2 (line 5650) | static ImVec2 CalcWindowSizeAfterConstraint(ImGuiWindow* window, const I...
function CalcWindowContentSizes (line 5685) | static void CalcWindowContentSizes(ImGuiWindow* window, ImVec2* content_...
function ImVec2 (line 5705) | static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& s...
function ImVec2 (line 5748) | ImVec2 ImGui::CalcWindowNextAutoFitSize(ImGuiWindow* window)
function ImGuiCol (line 5758) | static ImGuiCol GetWindowBgColorIdx(ImGuiWindow* window)
function CalcResizePosSizeFromAnyCorner (line 5767) | static void CalcResizePosSizeFromAnyCorner(ImGuiWindow* window, const Im...
type ImGuiResizeGripDef (line 5782) | struct ImGuiResizeGripDef
type ImGuiResizeBorderDef (line 5797) | struct ImGuiResizeBorderDef
function ImRect (line 5811) | static ImRect GetResizeBorderRect(ImGuiWindow* window, int border_n, flo...
function ImGuiID (line 5825) | ImGuiID ImGui::GetWindowResizeCornerID(ImGuiWindow* window, int n)
function ImGuiID (line 5835) | ImGuiID ImGui::GetWindowResizeBorderID(ImGuiWindow* window, ImGuiDir dir)
function ClampWindowRect (line 5989) | static inline void ClampWindowRect(ImGuiWindow* window, const ImRect& vi...
function ImGuiWindow (line 6283) | static ImGuiWindow* ImGui::FindBlockingModal(ImGuiWindow* window)
function ImGuiWindow (line 7475) | static ImGuiWindow* GetCombinedRootWindow(ImGuiWindow* window, bool popu...
function ImGuiID (line 7596) | ImGuiID ImGui::GetWindowDockID()
function ImVec2 (line 7628) | ImVec2 ImGui::GetWindowPos()
function ImVec2 (line 7668) | ImVec2 ImGui::GetWindowSize()
function ImDrawList (line 7866) | ImDrawList* ImGui::GetWindowDrawList()
function ImGuiViewport (line 7878) | ImGuiViewport* ImGui::GetWindowViewport()
function ImFont (line 7885) | ImFont* ImGui::GetFont()
function ImVec2 (line 7895) | ImVec2 ImGui::GetFontTexUvWhitePixel()
function ImGuiStorage (line 7977) | ImGuiStorage* ImGui::GetStateStorage()
function ImGuiID (line 8028) | ImGuiID ImGui::GetIDWithSeed(const char* str, const char* str_end, ImGui...
function ImGuiID (line 8045) | ImGuiID ImGui::GetID(const char* str_id)
function ImGuiID (line 8051) | ImGuiID ImGui::GetID(const char* str_id_begin, const char* str_id_end)
function ImGuiID (line 8057) | ImGuiID ImGui::GetID(const void* ptr_id)
function ImGuiKeyData (line 8101) | ImGuiKeyData* ImGui::GetKeyData(ImGuiKey key)
function ImVec2 (line 8285) | ImVec2 ImGui::GetMousePos()
function ImVec2 (line 8292) | ImVec2 ImGui::GetMousePosOnOpeningCurrentPopup()
function ImVec2 (line 8324) | ImVec2 ImGui::GetMouseDragDelta(ImGuiMouseButton button, float lock_thre...
function ImGuiMouseCursor (line 8345) | ImGuiMouseCursor ImGui::GetMouseCursor()
function ImVec2 (line 8974) | ImVec2 ImGui::GetCursorScreenPos()
function ImVec2 (line 8989) | ImVec2 ImGui::GetCursorPos()
function ImVec2 (line 9028) | ImVec2 ImGui::GetCursorStartPos()
function ImVec2 (line 9114) | ImVec2 ImGui::CalcItemSize(ImVec2 size, float default_w, float default_h)
function ImVec2 (line 9163) | ImVec2 ImGui::GetContentRegionMax()
function ImVec2 (line 9174) | ImVec2 ImGui::GetContentRegionMaxAbs()
function ImVec2 (line 9184) | ImVec2 ImGui::GetContentRegionAvail()
function ImVec2 (line 9191) | ImVec2 ImGui::GetWindowContentRegionMin()
function ImVec2 (line 9197) | ImVec2 ImGui::GetWindowContentRegionMax()
function CalcScrollEdgeSnap (line 9302) | static float CalcScrollEdgeSnap(float target, float snap_min, float snap...
function ImVec2 (line 9311) | static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window)
function ImVec2 (line 9363) | ImVec2 ImGui::ScrollToRectEx(ImGuiWindow* window, const ImRect& item_rec...
function ImGuiWindow (line 9651) | ImGuiWindow* ImGui::GetTopMostPopupModal()
function ImGuiWindow (line 9661) | ImGuiWindow* ImGui::GetTopMostAndVisiblePopupModal()
function ImVec2 (line 10021) | ImVec2 ImGui::FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const I...
function ImRect (line 10096) | ImRect ImGui::GetPopupAllowedExtentRect(ImGuiWindow* window)
function ImVec2 (line 10117) | ImVec2 ImGui::FindBestWindowPosForPopup(ImGuiWindow* window)
function ImGuiDir (line 10197) | ImGuiDir ImGetDirQuadrantFromDelta(float dx, float dy)
function NavScoreItemDistInterval (line 10204) | static float inline NavScoreItemDistInterval(float a0, float a1, float b...
function NavClampRectToVisibleAreaForMoveDir (line 10213) | static void inline NavClampRectToVisibleAreaForMoveDir(ImGuiDir move_dir...
function ImGuiWindow (line 10568) | static ImGuiWindow* ImGui::NavRestoreLastChildNavWindow(ImGuiWindow* win...
function ImVec2 (line 10643) | static ImVec2 ImGui::NavCalcPreferredRefPos()
function ImVec2 (line 10705) | ImVec2 ImGui::GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, Im...
function ImGuiWindow (line 11363) | static ImGuiWindow* FindWindowNavFocusable(int i_start, int i_stop, int ...
function NavUpdateWindowingHighlightWindow (line 11372) | static void NavUpdateWindowingHighlightWindow(int focus_change_dir)
function ImGuiPayload (line 11873) | const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGui...
function ImGuiPayload (line 11910) | const ImGuiPayload* ImGui::GetDragDropPayload()
function LogTextV (line 11933) | static inline void LogTextV(ImGuiContext& g, const char* fmt, va_list args)
function ImGuiWindowSettings (line 12232) | ImGuiWindowSettings* ImGui::CreateNewWindowSettings(const char* name)
function ImGuiWindowSettings (line 12254) | ImGuiWindowSettings* ImGui::FindWindowSettings(ImGuiID id)
function ImGuiWindowSettings (line 12263) | ImGuiWindowSettings* ImGui::FindOrCreateWindowSettings(const char* name)
function ImGuiSettingsHandler (line 12284) | ImGuiSettingsHandler* ImGui::FindSettingsHandler(const char* type_name)
function WindowSettingsHandler_ClearAll (line 12417) | static void WindowSettingsHandler_ClearAll(ImGuiContext* ctx, ImGuiSetti...
function WindowSettingsHandler_ReadLine (line 12435) | static void WindowSettingsHandler_ReadLine(ImGuiContext*, ImGuiSettingsH...
function WindowSettingsHandler_ApplyAll (line 12452) | static void WindowSettingsHandler_ApplyAll(ImGuiContext* ctx, ImGuiSetti...
function WindowSettingsHandler_WriteAll (line 12464) | static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSetti...
function ImGuiViewport (line 12552) | ImGuiViewport* ImGui::GetMainViewport()
function ImGuiViewport (line 12559) | ImGuiViewport* ImGui::FindViewportByID(ImGuiID id)
function ImGuiViewport (line 12568) | ImGuiViewport* ImGui::FindViewportByPlatformHandle(void* platform_handle)
function ImGuiViewportP (line 12703) | ImGuiViewportP* ImGui::FindHoveredViewportFromPlatformWindowStack(const ...
function ImGuiViewportP (line 12915) | ImGuiViewportP* ImGui::AddUpdateViewport(ImGuiWindow* window, ImGuiID id...
function ImGuiPlatformMonitor (line 13437) | const ImGuiPlatformMonitor* ImGui::GetViewportPlatformMonitor(ImGuiViewp...
type ImGuiDockRequestType (line 13557) | enum ImGuiDockRequestType
type ImGuiDockRequest (line 13565) | struct ImGuiDockRequest
method ImGuiDockRequest (line 13577) | ImGuiDockRequest()
type ImGuiDockPreviewData (line 13588) | struct ImGuiDockPreviewData
method ImGuiDockPreviewData (line 13600) | ImGuiDockPreviewData() : FutureNode(0) { IsDropAllowed = IsCenterAvail...
type ImGuiDockNodeSettings (line 13604) | struct ImGuiDockNodeSettings
method ImGuiDockNodeSettings (line 13616) | ImGuiDockNodeSettings() { memset(this, 0, sizeof(*this)); SplitAxis = ...
type ImGui (line 13623) | namespace ImGui
function ImGuiDockNode (line 13852) | static ImGuiDockNode* ImGui::DockContextFindNodeByID(ImGuiContext* ctx, ...
function ImGuiID (line 13857) | ImGuiID ImGui::DockContextGenNodeID(ImGuiContext* ctx)
function ImGuiDockNode (line 13868) | static ImGuiDockNode* ImGui::DockContextAddNode(ImGuiContext* ctx, ImGui...
type ImGuiDockContextPruneNodeData (line 13922) | struct ImGuiDockContextPruneNodeData
method ImGuiDockContextPruneNodeData (line 13926) | ImGuiDockContextPruneNodeData() { CountWindows = CountChildWindows = C...
function ImVec2 (line 14240) | static ImVec2 FixLargeWindowsWhenUndocking(const ImVec2& size, ImGuiView...
function DockNodeHideWindowDuringHostWindowCreation (line 14401) | static void DockNodeHideWindowDuringHostWindowCreation(ImGuiWindow* window)
type ImGuiDockNodeTreeInfo (line 14611) | struct ImGuiDockNodeTreeInfo
method ImGuiDockNodeTreeInfo (line 14618) | ImGuiDockNodeTreeInfo() { memset(this, 0, sizeof(*this)); }
function DockNodeFindInfo (line 14621) | static void DockNodeFindInfo(ImGuiDockNode* node, ImGuiDockNodeTreeInfo*...
function ImGuiWindow (line 14643) | static ImGuiWindow* ImGui::DockNodeFindWindowByID(ImGuiDockNode* node, I...
function DockNodeSetupHostWindow (line 14804) | static void DockNodeSetupHostWindow(ImGuiDockNode* node, ImGuiWindow* ho...
function ImGuiID (line 15127) | static ImGuiID ImGui::DockNodeUpdateWindowMenu(ImGuiDockNode* node, ImGu...
function DockNodeIsDropAllowedOne (line 15470) | static bool DockNodeIsDropAllowedOne(ImGuiWindow* payload, ImGuiWindow* ...
function DockNodeTreeUpdateSplitterFindTouchingNode (line 16045) | static void DockNodeTreeUpdateSplitterFindTouchingNode(ImGuiDockNode* no...
function ImGuiDockNode (line 16178) | ImGuiDockNode* ImGui::DockNodeTreeFindFallbackLeafNode(ImGuiDockNode* node)
function ImGuiDockNode (line 16189) | ImGuiDockNode* ImGui::DockNodeTreeFindVisibleNodeByPos(ImGuiDockNode* no...
function ImGuiID (line 16259) | ImGuiID ImGui::DockSpace(ImGuiID id, const ImVec2& size_arg, ImGuiDockNo...
function ImGuiID (line 16360) | ImGuiID ImGui::DockSpaceOverViewport(const ImGuiViewport* viewport, ImGu...
function ImGuiDockNode (line 16435) | ImGuiDockNode* ImGui::DockBuilderGetNode(ImGuiID node_id)
function ImGuiID (line 16469) | ImGuiID ImGui::DockBuilderAddNode(ImGuiID id, ImGuiDockNodeFlags flags)
function ImGuiID (line 16617) | ImGuiID ImGui::DockBuilderSplitNode(ImGuiID id, ImGuiDir split_dir, floa...
function ImGuiDockNode (line 16651) | static ImGuiDockNode* DockBuilderCopyNodeRec(ImGuiDockNode* src_node, Im...
function ImGuiDockNode (line 16828) | static ImGuiDockNode* ImGui::DockContextBindNodeToWindow(ImGuiContext* c...
function ImGuiDockNodeSettings (line 17149) | static ImGuiDockNodeSettings* ImGui::DockSettingsFindNodeSettings(ImGuiC...
method ImGuiDockNodeSettings (line 13616) | ImGuiDockNodeSettings() { memset(this, 0, sizeof(*this)); SplitAxis = ...
function DockSettingsHandler_DockNodeToSettings (line 17226) | static void DockSettingsHandler_DockNodeToSettings(ImGuiDockContext* dc,...
function SetClipboardTextFn_DefaultImpl (line 17362) | static void SetClipboardTextFn_DefaultImpl(void*, const char* text)
function SetClipboardTextFn_DefaultImpl (line 17389) | static void SetClipboardTextFn_DefaultImpl(void*, const char* text)
function SetClipboardTextFn_DefaultImpl (line 17444) | static void SetClipboardTextFn_DefaultImpl(void*, const char* text)
function SetPlatformImeDataFn_DefaultImpl (line 17464) | static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport* viewport, Im...
function SetPlatformImeDataFn_DefaultImpl (line 17495) | static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport*, ImGuiPlatfo...
function RenderViewportsThumbnails (line 17553) | static void RenderViewportsThumbnails()
function MetricsHelpMarker (line 17582) | static void MetricsHelpMarker(const char* desc)
type ImGui (line 17596) | namespace ImGui { void ShowFontAtlas(ImFontAtlas* atlas); }
type Funcs (line 17632) | struct Funcs
method ImRect (line 17634) | static ImRect GetTableRect(ImGuiTable* table, int rect_type, int n)
method ImRect (line 17654) | static ImRect GetWindowRect(ImGuiWindow* window, int rect_type)
type Func (line 17762) | struct Func { static int IMGUI_CDECL WindowComparerByBeginOrder(const vo...
method WindowComparerByBeginOrder (line 17762) | WindowComparerByBeginOrder(const void* lhs, const void* rhs) { return ...
function DebugNodeDockNodeFlags (line 18116) | static void DebugNodeDockNodeFlags(ImGuiDockNodeFlags* p_flags, const ch...
function StackToolFormatLevelInfo (line 18729) | static int StackToolFormatLevelInfo(ImGuiStackTool* tool, int n, bool fo...
FILE: test/third_party/imgui/imgui.h
type ImDrawChannel (line 136) | struct ImDrawChannel
type ImDrawCmd (line 137) | struct ImDrawCmd
type ImDrawData (line 138) | struct ImDrawData
type ImDrawList (line 139) | struct ImDrawList
type ImDrawListSharedData (line 140) | struct ImDrawListSharedData
type ImDrawListSplitter (line 141) | struct ImDrawListSplitter
type ImDrawVert (line 142) | struct ImDrawVert
type ImFont (line 143) | struct ImFont
type ImFontAtlas (line 144) | struct ImFontAtlas
type ImFontBuilderIO (line 145) | struct ImFontBuilderIO
type ImFontConfig (line 146) | struct ImFontConfig
type ImFontGlyph (line 147) | struct ImFontGlyph
type ImFontGlyphRangesBuilder (line 148) | struct ImFontGlyphRangesBuilder
type ImColor (line 149) | struct ImColor
type ImGuiContext (line 150) | struct ImGuiContext
type ImGuiIO (line 151) | struct ImGuiIO
type ImGuiInputTextCallbackData (line 152) | struct ImGuiInputTextCallbackData
type ImGuiKeyData (line 153) | struct ImGuiKeyData
type ImGuiListClipper (line 154) | struct ImGuiListClipper
type ImGuiOnceUponAFrame (line 155) | struct ImGuiOnceUponAFrame
type ImGuiPayload (line 156) | struct ImGuiPayload
type ImGuiPlatformIO (line 157) | struct ImGuiPlatformIO
type ImGuiPlatformMonitor (line 158) | struct ImGuiPlatformMonitor
type ImGuiPlatformImeData (line 159) | struct ImGuiPlatformImeData
type ImGuiSizeCallbackData (line 160) | struct ImGuiSizeCallbackData
type ImGuiStorage (line 161) | struct ImGuiStorage
type ImGuiStyle (line 162) | struct ImGuiStyle
type ImGuiTableSortSpecs (line 163) | struct ImGuiTableSortSpecs
type ImGuiTableColumnSortSpecs (line 164) | struct ImGuiTableColumnSortSpecs
type ImGuiTextBuffer (line 165) | struct ImGuiTextBuffer
type ImGuiTextFilter (line 166) | struct ImGuiTextFilter
type ImGuiViewport (line 167) | struct ImGuiViewport
type ImGuiWindowClass (line 168) | struct ImGuiWindowClass
type ImGuiCol (line 174) | typedef int ImGuiCol;
type ImGuiCond (line 175) | typedef int ImGuiCond;
type ImGuiDataType (line 176) | typedef int ImGuiDataType;
type ImGuiDir (line 177) | typedef int ImGuiDir;
type ImGuiKey (line 178) | typedef int ImGuiKey;
type ImGuiNavInput (line 179) | typedef int ImGuiNavInput;
type ImGuiMouseButton (line 180) | typedef int ImGuiMouseButton;
type ImGuiMouseCursor (line 181) | typedef int ImGuiMouseCursor;
type ImGuiSortDirection (line 182) | typedef int ImGuiSortDirection;
type ImGuiStyleVar (line 183) | typedef int ImGuiStyleVar;
type ImGuiTableBgTarget (line 184) | typedef int ImGuiTableBgTarget;
type ImDrawFlags (line 185) | typedef int ImDrawFlags;
type ImDrawListFlags (line 186) | typedef int ImDrawListFlags;
type ImFontAtlasFlags (line 187) | typedef int ImFontAtlasFlags;
type ImGuiBackendFlags (line 188) | typedef int ImGuiBackendFlags;
type ImGuiButtonFlags (line 189) | typedef int ImGuiButtonFlags;
type ImGuiColorEditFlags (line 190) | typedef int ImGuiColorEditFlags;
type ImGuiConfigFlags (line 191) | typedef int ImGuiConfigFlags;
type ImGuiComboFlags (line 192) | typedef int ImGuiComboFlags;
type ImGuiDockNodeFlags (line 193) | typedef int ImGuiDockNodeFlags;
type ImGuiDragDropFlags (line 194) | typedef int ImGuiDragDropFlags;
type ImGuiFocusedFlags (line 195) | typedef int ImGuiFocusedFlags;
type ImGuiHoveredFlags (line 196) | typedef int ImGuiHoveredFlags;
type ImGuiInputTextFlags (line 197) | typedef int ImGuiInputTextFlags;
type ImGuiModFlags (line 198) | typedef int ImGuiModFlags;
type ImGuiPopupFlags (line 199) | typedef int ImGuiPopupFlags;
type ImGuiSelectableFlags (line 200) | typedef int ImGuiSelectableFlags;
type ImGuiSliderFlags (line 201) | typedef int ImGuiSliderFlags;
type ImGuiTabBarFlags (line 202) | typedef int ImGuiTabBarFlags;
type ImGuiTabItemFlags (line 203) | typedef int ImGuiTabItemFlags;
type ImGuiTableFlags (line 204) | typedef int ImGuiTableFlags;
type ImGuiTableColumnFlags (line 205) | typedef int ImGuiTableColumnFlags;
type ImGuiTableRowFlags (line 206) | typedef int ImGuiTableRowFlags;
type ImGuiTreeNodeFlags (line 207) | typedef int ImGuiTreeNodeFlags;
type ImGuiViewportFlags (line 208) | typedef int ImGuiViewportFlags;
type ImGuiWindowFlags (line 209) | typedef int ImGuiWindowFlags;
type ImDrawIdx (line 222) | typedef unsigned short ImDrawIdx;
type ImGuiID (line 226) | typedef unsigned int ImGuiID;
type ImS8 (line 227) | typedef signed char ImS8;
type ImU8 (line 228) | typedef unsigned char ImU8;
type ImS16 (line 229) | typedef signed short ImS16;
type ImU16 (line 230) | typedef unsigned short ImU16;
type ImS32 (line 231) | typedef signed int ImS32;
type ImU32 (line 232) | typedef unsigned int ImU32;
type ImS64 (line 233) | typedef signed long long ImS64;
type ImU64 (line 234) | typedef unsigned long long ImU64;
type ImWchar16 (line 238) | typedef unsigned short ImWchar16;
type ImWchar32 (line 239) | typedef unsigned int ImWchar32;
type ImWchar32 (line 241) | typedef ImWchar32 ImWchar;
type ImWchar16 (line 243) | typedef ImWchar16 ImWchar;
function IM_MSVC_RUNTIME_CHECKS_OFF (line 254) | IM_MSVC_RUNTIME_CHECKS_OFF
function clear (line 1860) | inline void clear() { if (Data) { Si...
function clear_delete (line 1861) | inline void clear_delete() { for (int n = 0...
function clear_destruct (line 1862) | inline void clear_destruct() { for (int n = 0...
function size_in_bytes (line 1866) | inline int size_in_bytes() const { return Size * ...
function T (line 1869) | inline T& operator[](int i) { IM_ASSERT(i >=...
function T (line 1870) | inline const T& operator[](int i) const { IM_ASSERT(i >=...
function T (line 1872) | inline T* begin() { return Data; }
function T (line 1873) | inline const T* begin() const { return Data; }
function T (line 1874) | inline T* end() { return Data + ...
function T (line 1875) | inline const T* end() const { return Data + ...
function T (line 1876) | inline T& front() { IM_ASSERT(Size...
function T (line 1877) | inline const T& front() const { IM_ASSERT(Size...
function T (line 1879) | inline const T& back() const { IM_ASSERT(Size...
function _grow_capacity (line 1882) | inline int _grow_capacity(int sz) const { int new_capaci...
function resize (line 1883) | inline void resize(int new_size) { if (new_size >...
function resize (line 1884) | inline void resize(int new_size, const T& v) { if (new_size >...
function shrink (line 1885) | inline void shrink(int new_size) { IM_ASSERT(new_...
function reserve (line 1886) | inline void reserve(int new_capacity) { if (new_capaci...
function push_back (line 1889) | inline void push_back(const T& v) { if (Size == Ca...
function pop_back (line 1890) | inline void pop_back() { IM_ASSERT(Size...
function push_front (line 1891) | inline void push_front(const T& v) { if (Size == 0)...
function T (line 1892) | inline T* erase(const T* it) { IM_ASSERT(it >...
function T (line 1893) | inline T* erase(const T* it, const T* it_last){ IM_ASSERT(it >...
function T (line 1894) | inline T* erase_unsorted(const T* it) { IM_ASSERT(it >...
function T (line 1895) | inline T* insert(const T* it, const T& v) { IM_ASSERT(it >...
function contains (line 1896) | inline bool contains(const T& v) const { const T* data ...
function T (line 1897) | inline T* find(const T& v) { T* data = Data...
function T (line 1898) | inline const T* find(const T& v) const { const T* data ...
function find_erase (line 1899) | inline bool find_erase(const T& v) { const T* it = ...
function find_erase_unsorted (line 1900) | inline bool find_erase_unsorted(const T& v) { const T* it = ...
function index_from_ptr (line 1901) | inline int index_from_ptr(const T* it) const { IM_ASSERT(it >...
function IM_MSVC_RUNTIME_CHECKS_RESTORE (line 1903) | IM_MSVC_RUNTIME_CHECKS_RESTORE
type ImGuiKeyData (line 1970) | struct ImGuiKeyData
type ImGuiIO (line 1978) | struct ImGuiIO
function ClearSelection (line 2162) | struct ImGuiInputTextCallbackData
type ImGuiSizeCallbackData (line 2193) | struct ImGuiSizeCallbackData
type ImGuiWindowClass (line 2208) | struct ImGuiWindowClass
function Clear (line 2223) | struct ImGuiPayload
function IsDataType (line 2239) | bool IsDataType(const char* type) const { return DataFrameCount != -1 &&...
type ImGuiTableColumnSortSpecs (line 2245) | struct ImGuiTableColumnSortSpecs
type ImGuiTableSortSpecs (line 2259) | struct ImGuiTableSortSpecs
type ImGuiOnceUponAFrame (line 2282) | struct ImGuiOnceUponAFrame
function IsActive (line 2290) | struct ImGuiTextFilter
type ImGuiTextBuffer (line 2317) | struct ImGuiTextBuffer
function clear (line 2328) | void clear() { Buf.clear(); }
function reserve (line 2329) | void reserve(int capacity) { Buf.reserve(capacity); }
function ImGuiStoragePair (line 2344) | struct ImGuiStorage
function Clear (line 2361) | void Clear() { Data.clear(); }
type ImGuiListClipper (line 2407) | struct ImGuiListClipper
function ImColor (line 2458) | struct ImColor
function GetTexID (line 2507) | struct ImDrawCmd
type ImDrawFlags_ (line 2574) | enum ImDrawFlags_
type ImDrawListFlags_ (line 2594) | enum ImDrawListFlags_
function ImDrawList (line 2612) | struct ImDrawList
function ImVec2 (line 2642) | inline ImVec2 GetClipRectMin() const { const ImVec4& cr = _ClipRectSta...
function PathClear (line 2681) | inline void PathClear() ...
function PathLineTo (line 2682) | inline void PathLineTo(const ImVec2& pos) ...
function PathLineToMergeDuplicate (line 2683) | inline void PathLineToMergeDuplicate(const ImVec2& pos) ...
function PathFillConvex (line 2684) | inline void PathFillConvex(ImU32 col) ...
function ChannelsSplit (line 2703) | inline void ChannelsSplit(int count) { _Splitter.Split(this, coun...
function ChannelsMerge (line 2704) | inline void ChannelsMerge() { _Splitter.Merge(this); }
function ChannelsSetCurrent (line 2705) | inline void ChannelsSetCurrent(int n) { _Splitter.SetCurrentChanne...
function PrimWriteVtx (line 2715) | inline void PrimWriteVtx(const ImVec2& pos, const ImVec2& uv, ImU32 ...
function PrimWriteIdx (line 2716) | inline void PrimWriteIdx(ImDrawIdx idx) ...
function PrimVtx (line 2717) | inline void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col) ...
function Clear (line 2740) | struct ImDrawData
type ImFontConfig (line 2763) | struct ImFontConfig
type ImFontGlyph (line 2792) | struct ImFontGlyph
function Clear (line 2804) | struct ImFontGlyphRangesBuilder
function GetBit (line 2810) | inline bool GetBit(size_t n) const { int off = (int)(n >> 5); ImU32...
function SetBit (line 2811) | inline void SetBit(size_t n) { int off = (int)(n >> 5); ImU32...
function AddChar (line 2812) | inline void AddChar(ImWchar c) { SetBit(c); }
type ImFontAtlasFlags_ (line 2832) | enum ImFontAtlasFlags_
function SetTexID (line 2857) | struct ImFontAtlas
function ImFontAtlasCustomRect (line 2912) | ImFontAtlasCustomRect* GetCustomRectByIndex(int index) { IM_ASSERT(...
type ImFont (line 2958) | struct ImFont
type ImGuiViewportFlags_ (line 3014) | enum ImGuiViewportFlags_
function ImGuiViewport (line 3039) | struct ImGuiViewport
type ImGuiPlatformIO (line 3122) | struct ImGuiPlatformIO
type ImGuiPlatformMonitor (line 3185) | struct ImGuiPlatformMonitor
type ImGuiPlatformImeData (line 3194) | struct ImGuiPlatformImeData
function namespace (line 3209) | namespace ImGui
function namespace (line 3219) | namespace ImGui
function ListBoxFooter (line 3228) | static inline void ListBoxFooter() { EndListBox(); }
function DragFloat (line 3236) | static inline bool DragFloat(const char* label, float* v, float v_speed...
function DragFloat2 (line 3237) | static inline bool DragFloat2(const char* label, float v[2], float v_sp...
function DragFloat3 (line 3238) | static inline bool DragFloat3(const char* label, float v[3], float v_sp...
function DragFloat4 (line 3239) | static inline bool DragFloat4(const char* label, float v[4], float v_sp...
function SliderFloat (line 3242) | static inline bool SliderFloat(const char* label, float* v, float v_min...
function SliderFloat2 (line 3243) | static inline bool SliderFloat2(const char* label, float v[2], float v_...
function SliderFloat3 (line 3244) | static inline bool SliderFloat3(const char* label, float v[3], float v_...
function SliderFloat4 (line 3245) | static inline bool SliderFloat4(const char* label, float v[4], float v_...
function BeginPopupContextWindow (line 3247) | static inline bool BeginPopupContextWindow(const char* str_id, ImGuiMou...
type ImDrawFlags (line 3266) | typedef ImDrawFlags ImDrawCornerFlags;
type ImDrawCornerFlags_ (line 3267) | enum ImDrawCornerFlags_
type ImGuiKeyModFlags (line 3282) | typedef int ImGuiKeyModFlags;
type ImGuiKeyModFlags_ (line 3283) | enum ImGuiKeyModFlags_ { ImGuiKeyModFlags_None = ImGuiModFlags_None, ImG...
FILE: test/third_party/imgui/imgui_demo.cpp
function HelpMarker (line 193) | static void HelpMarker(const char* desc)
function ShowDockingDisabledMessage (line 206) | static void ShowDockingDisabledMessage()
function ShowDemoWindowWidgets (line 615) | static void ShowDemoWindowWidgets()
function ShowDemoWindowLayout (line 2554) | static void ShowDemoWindowLayout()
function ShowDemoWindowPopups (line 3337) | static void ShowDemoWindowPopups()
type MyItemColumnID (line 3649) | enum MyItemColumnID
type MyItem (line 3658) | struct MyItem
method CompareWithSortSpecs (line 3674) | CompareWithSortSpecs(const void* lhs, const void* rhs)
function PushStyleCompact (line 3707) | static void PushStyleCompact()
function PopStyleCompact (line 3714) | static void PopStyleCompact()
function EditTableSizingFlags (line 3720) | static void EditTableSizingFlags(ImGuiTableFlags* p_flags)
function EditTableColumnsFlags (line 3762) | static void EditTableColumnsFlags(ImGuiTableColumnFlags* p_flags)
function ShowTableColumnsStatusFlags (line 3786) | static void ShowTableColumnsStatusFlags(ImGuiTableColumnFlags flags)
function ShowDemoWindowTables (line 3794) | static void ShowDemoWindowTables()
function ShowExampleAppConsole (line 6919) | static void ShowExampleAppConsole(bool* p_open)
function Draw (line 6933) | struct ExampleAppLog
function ShowExampleAppLog (line 7054) | static void ShowExampleAppLog(bool* p_open)
function ShowExampleAppLayout (line 7089) | static void ShowExampleAppLayout(bool* p_open)
function ShowPlaceholderObject (line 7155) | static void ShowPlaceholderObject(const char* prefix, int uid)
function ShowExampleAppPropertyEditor (line 7203) | static void ShowExampleAppPropertyEditor(bool* p_open)
function ShowExampleAppLongText (line 7239) | static void ShowExampleAppLongText(bool* p_open)
function ShowExampleAppAutoResize (line 7302) | static void ShowExampleAppAutoResize(bool* p_open)
function ShowExampleAppConstrainedResize (line 7327) | static void ShowExampleAppConstrainedResize(bool* p_open)
function ShowExampleAppSimpleOverlay (line 7384) | static void ShowExampleAppSimpleOverlay(bool* p_open)
function ShowExampleAppFullscreen (line 7433) | static void ShowExampleAppFullscreen(bool* p_open)
function ShowExampleAppWindowTitles (line 7471) | static void ShowExampleAppWindowTitles(bool*)
function ShowExampleAppCustomRendering (line 7505) | static void ShowExampleAppCustomRendering(bool* p_open)
function ShowExampleAppDockSpace (line 7761) | void ShowExampleAppDockSpace(bool* p_open)
type MyDocument (line 7872) | struct MyDocument
method MyDocument (line 7881) | MyDocument(const char* name, bool open = true, const ImVec4& color = I...
method DoOpen (line 7889) | void DoOpen() { Open = true; }
method DoQueueClose (line 7890) | void DoQueueClose() { WantClose = true; }
method DoForceClose (line 7891) | void DoForceClose() { Open = false; Dirty = false; }
method DoSave (line 7892) | void DoSave() { Dirty = false; }
method DisplayContents (line 7895) | static void DisplayContents(MyDocument* doc)
method DisplayContextMenu (line 7912) | static void DisplayContextMenu(MyDocument* doc)
type ExampleAppDocuments (line 7927) | struct ExampleAppDocuments
method ExampleAppDocuments (line 7931) | ExampleAppDocuments()
function NotifyOfDocumentsClosedElsewhere (line 7950) | static void NotifyOfDocumentsClosedElsewhere(ExampleAppDocuments& app)
function ShowExampleAppDocuments (line 7961) | void ShowExampleAppDocuments(bool* p_open)
FILE: test/third_party/imgui/imgui_draw.cpp
function ImDrawList (line 448) | ImDrawList* ImDrawList::CloneOutput() const
function ImVec2 (line 1238) | ImVec2 ImBezierCubicCalc(const ImVec2& p1, const ImVec2& p2, const ImVec...
function ImVec2 (line 1248) | ImVec2 ImBezierQuadraticCalc(const ImVec2& p1, const ImVec2& p2, const I...
function PathBezierCubicCurveToCasteljau (line 1258) | static void PathBezierCubicCurveToCasteljau(ImVector<ImVec2>* path, floa...
function PathBezierQuadraticCurveToCasteljau (line 1283) | static void PathBezierQuadraticCurveToCasteljau(ImVector<ImVec2>* path, ...
function ImDrawFlags (line 1332) | static inline ImDrawFlags FixRectCornerFlags(ImDrawFlags flags)
function ImFont (line 2083) | ImFont* ImFontAtlas::AddFont(const ImFontConfig* font_cfg)
function Decode85Byte (line 2119) | static unsigned int Decode85Byte(char c) ...
function Decode85 (line 2120) | static void Decode85(const unsigned char* src, unsigned char* dst)
function ImFont (line 2132) | ImFont* ImFontAtlas::AddFontDefault(const ImFontConfig* font_cfg_template)
function ImFont (line 2153) | ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size...
function ImFont (line 2175) | ImFont* ImFontAtlas::AddFontFromMemoryTTF(void* ttf_data, int ttf_size, ...
function ImFont (line 2188) | ImFont* ImFontAtlas::AddFontFromMemoryCompressedTTF(const void* compress...
function ImFont (line 2200) | ImFont* ImFontAtlas::AddFontFromMemoryCompressedBase85TTF(const char* co...
function ImFontAtlasBuildMultiplyCalcLookupTable (line 2298) | void ImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[...
function ImFontAtlasBuildMultiplyRectAlpha8 (line 2307) | void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256...
type ImFontBuildSrcData (line 2318) | struct ImFontBuildSrcData
type ImFontBuildDstData (line 2333) | struct ImFontBuildDstData
function UnpackBitVectorToFlatIndexList (line 2341) | static void UnpackBitVectorToFlatIndexList(const ImBitVector* in, ImVect...
function ImFontAtlasBuildWithStbTruetype (line 2353) | static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
function ImFontBuilderIO (line 2605) | const ImFontBuilderIO* ImFontAtlasGetBuilderForStbTruetype()
function ImFontAtlasBuildSetupFont (line 2614) | void ImFontAtlasBuildSetupFont(ImFontAtlas* atlas, ImFont* font, ImFontC...
function ImFontAtlasBuildPackCustomRects (line 2629) | void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_con...
function ImFontAtlasBuildRender8bppRectFromString (line 2656) | void ImFontAtlasBuildRender8bppRectFromString(ImFontAtlas* atlas, int x,...
function ImFontAtlasBuildRender32bppRectFromString (line 2666) | void ImFontAtlasBuildRender32bppRectFromString(ImFontAtlas* atlas, int x...
function ImFontAtlasBuildRenderDefaultTexData (line 2676) | static void ImFontAtlasBuildRenderDefaultTexData(ImFontAtlas* atlas)
function ImFontAtlasBuildRenderLinesTexData (line 2716) | static void ImFontAtlasBuildRenderLinesTexData(ImFontAtlas* atlas)
function ImFontAtlasBuildInit (line 2768) | void ImFontAtlasBuildInit(ImFontAtlas* atlas)
function ImFontAtlasBuildFinish (line 2789) | void ImFontAtlasBuildFinish(ImFontAtlas* atlas)
function ImWchar (line 2819) | const ImWchar* ImFontAtlas::GetGlyphRangesDefault()
function ImWchar (line 2829) | const ImWchar* ImFontAtlas::GetGlyphRangesKorean()
function ImWchar (line 2842) | const ImWchar* ImFontAtlas::GetGlyphRangesChineseFull()
function UnpackAccumulativeOffsetsIntoRanges (line 2858) | static void UnpackAccumulativeOffsetsIntoRanges(int base_codepoint, cons...
function ImWchar (line 2872) | const ImWchar* ImFontAtlas::GetGlyphRangesChineseSimplifiedCommon()
function ImWchar (line 2940) | const ImWchar* ImFontAtlas::GetGlyphRangesJapanese()
function ImWchar (line 3030) | const ImWchar* ImFontAtlas::GetGlyphRangesCyrillic()
function ImWchar (line 3043) | const ImWchar* ImFontAtlas::GetGlyphRangesThai()
function ImWchar (line 3055) | const ImWchar* ImFontAtlas::GetGlyphRangesVietnamese()
function ImWchar (line 3151) | static ImWchar FindFirstExistingGlyph(ImFont* font, const ImWchar* candi...
function ImFontGlyph (line 3321) | const ImFontGlyph* ImFont::FindGlyph(ImWchar c) const
function ImFontGlyph (line 3331) | const ImFontGlyph* ImFont::FindGlyphNoFallback(ImWchar c) const
function ImVec2 (line 3440) | ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_wid...
function ImAcos01 (line 3829) | static inline float ImAcos01(float x)
function ImDrawFlags (line 3914) | ImDrawFlags ImGui::CalcRoundingFlagsForRectInRect(const ImRect& r_in, co...
function stb_decompress_length (line 3975) | static unsigned int stb_decompress_length(const unsigned char *input)
function stb__match (line 3983) | static void stb__match(const unsigned char *data, unsigned int length)
function stb__lit (line 3992) | static void stb__lit(const unsigned char *data, unsigned int length)
function stb_adler32 (line 4022) | static unsigned int stb_adler32(unsigned int adler32, unsigned char *buf...
function stb_decompress (line 4053) | static unsigned int stb_decompress(unsigned char *output, const unsigned...
FILE: test/third_party/imgui/imgui_internal.h
type ImBitVector (line 113) | struct ImBitVector
type ImRect (line 114) | struct ImRect
type ImDrawDataBuilder (line 115) | struct ImDrawDataBuilder
type ImDrawListSharedData (line 116) | struct ImDrawListSharedData
type ImGuiColorMod (line 117) | struct ImGuiColorMod
type ImGuiContext (line 118) | struct ImGuiContext
type ImGuiContextHook (line 119) | struct ImGuiContextHook
type ImGuiDataTypeInfo (line 120) | struct ImGuiDataTypeInfo
type ImGuiDockContext (line 121) | struct ImGuiDockContext
type ImGuiDockRequest (line 122) | struct ImGuiDockRequest
type ImGuiDockNode (line 123) | struct ImGuiDockNode
type ImGuiDockNodeSettings (line 124) | struct ImGuiDockNodeSettings
type ImGuiGroupData (line 125) | struct ImGuiGroupData
type ImGuiInputTextState (line 126) | struct ImGuiInputTextState
type ImGuiLastItemData (line 127) | struct ImGuiLastItemData
type ImGuiMenuColumns (line 128) | struct ImGuiMenuColumns
type ImGuiNavItemData (line 129) | struct ImGuiNavItemData
type ImGuiMetricsConfig (line 130) | struct ImGuiMetricsConfig
type ImGuiNextWindowData (line 131) | struct ImGuiNextWindowData
type ImGuiNextItemData (line 132) | struct ImGuiNextItemData
type ImGuiOldColumnData (line 133) | struct ImGuiOldColumnData
type ImGuiOldColumns (line 134) | struct ImGuiOldColumns
type ImGuiPopupData (line 135) | struct ImGuiPopupData
type ImGuiSettingsHandler (line 136) | struct ImGuiSettingsHandler
type ImGuiStackSizes (line 137) | struct ImGuiStackSizes
type ImGuiStyleMod (line 138) | struct ImGuiStyleMod
type ImGuiTabBar (line 139) | struct ImGuiTabBar
type ImGuiTabItem (line 140) | struct ImGuiTabItem
type ImGuiTable (line 141) | struct ImGuiTable
type ImGuiTableColumn (line 142) | struct ImGuiTableColumn
type ImGuiTableInstanceData (line 143) | struct ImGuiTableInstanceData
type ImGuiTableTempData (line 144) | struct ImGuiTableTempData
type ImGuiTableSettings (line 145) | struct ImGuiTableSettings
type ImGuiTableColumnsSettings (line 146) | struct ImGuiTableColumnsSettings
type ImGuiWindow (line 147) | struct ImGuiWindow
type ImGuiWindowTempData (line 148) | struct ImGuiWindowTempData
type ImGuiWindowSettings (line 149) | struct ImGuiWindowSettings
type ImGuiDataAuthority (line 152) | typedef int ImGuiDataAuthority;
type ImGuiLayoutType (line 153) | typedef int ImGuiLayoutType;
type ImGuiActivateFlags (line 154) | typedef int ImGuiActivateFlags;
type ImGuiItemFlags (line 155) | typedef int ImGuiItemFlags;
type ImGuiItemStatusFlags (line 156) | typedef int ImGuiItemStatusFlags;
type ImGuiOldColumnFlags (line 157) | typedef int ImGuiOldColumnFlags;
type ImGuiNavHighlightFlags (line 158) | typedef int ImGuiNavHighlightFlags;
type ImGuiNavDirSourceFlags (line 159) | typedef int ImGuiNavDirSourceFlags;
type ImGuiNavMoveFlags (line 160) | typedef int ImGuiNavMoveFlags;
type ImGuiNextItemDataFlags (line 161) | typedef int ImGuiNextItemDataFlags;
type ImGuiNextWindowDataFlags (line 162) | typedef int ImGuiNextWindowDataFlags;
type ImGuiScrollFlags (line 163) | typedef int ImGuiScrollFlags;
type ImGuiSeparatorFlags (line 164) | typedef int ImGuiSeparatorFlags;
type ImGuiTextFlags (line 165) | typedef int ImGuiTextFlags;
type ImGuiTooltipFlags (line 166) | typedef int ImGuiTooltipFlags;
function namespace (line 183) | namespace ImStb
function ImQsort (line 316) | static inline void ImQsort(void* base, size_t count, size_t size_of...
function ImIsPowerOfTwo (line 323) | static inline bool ImIsPowerOfTwo(int v) { return v != 0 ...
function ImIsPowerOfTwo (line 324) | static inline bool ImIsPowerOfTwo(ImU64 v) { return v != 0 ...
function ImUpperPowerOfTwo (line 325) | static inline int ImUpperPowerOfTwo(int v) { v--; v |= v >>...
function ImCharIsBlankA (line 340) | static inline bool ImCharIsBlankA(char c) { return c == ' ...
function ImCharIsBlankW (line 341) | static inline bool ImCharIsBlankW(unsigned int c) { return c == ' ...
function ImFileHandle (line 389) | static inline ImFileHandle ImFileOpen(const char*, const char*) ...
function ImFileClose (line 390) | static inline bool ImFileClose(ImFileHandle) ...
function ImU64 (line 391) | static inline ImU64 ImFileGetSize(ImFileHandle) ...
function ImU64 (line 392) | static inline ImU64 ImFileRead(void*, ImU64, ImU64, ImFileHandle...
function ImU64 (line 393) | static inline ImU64 ImFileWrite(const void*, ImU64, ImU64, ImFil...
type FILE (line 396) | typedef FILE* ImFileHandle;
function ImPow (line 421) | static inline float ImPow(float x, float y) { return powf(x, y); }
function ImPow (line 422) | static inline double ImPow(double x, double y) { return pow(x, y); }
function ImLog (line 423) | static inline float ImLog(float x) { return logf(x); }
function ImLog (line 424) | static inline double ImLog(double x) { return log(x); }
function ImAbs (line 425) | static inline int ImAbs(int x) { return x < 0 ? -x : x; }
function ImAbs (line 426) | static inline float ImAbs(float x) { return fabsf(x); }
function ImAbs (line 427) | static inline double ImAbs(double x) { return fabs(x); }
function ImSign (line 428) | static inline float ImSign(float x) { return (x < 0.0f) ? -1...
function ImSign (line 429) | static inline double ImSign(double x) { return (x < 0.0) ? -1....
function ImRsqrt (line 431) | static inline float ImRsqrt(float x) { return _mm_cvtss_f32(_...
function ImRsqrt (line 433) | static inline float ImRsqrt(float x) { return 1.0f / sqrtf(x); }
function ImRsqrt (line 435) | static inline double ImRsqrt(double x) { return 1.0 / sqrt(x); }
function T (line 439) | inline T ImMin(T lhs, T rhs) { return lhs < rhs ?...
function T (line 440) | inline T ImMax(T lhs, T rhs) { return lhs >= rhs ...
function T (line 441) | inline T ImClamp(T v, T mn, T mx) { return (v < mn) ? ...
function T (line 442) | inline T ImLerp(T a, T b, float t) { return (T)(a + (b ...
function ImSwap (line 443) | inline void ImSwap(T& a, T& b) { T tmp = a; a = b; ...
function T (line 444) | inline T ImAddClampOverflow(T a, T b, T mn, T mx) { if (b < 0 && (a < ...
function T (line 445) | inline T ImSubClampOverflow(T a, T b, T mn, T mx) { if (b > 0 && (a < ...
function ImVec2 (line 447) | static inline ImVec2 ImMin(const ImVec2& lhs, const ImVec2& rhs) ...
function ImVec2 (line 448) | static inline ImVec2 ImMax(const ImVec2& lhs, const ImVec2& rhs) ...
function ImVec2 (line 449) | static inline ImVec2 ImClamp(const ImVec2& v, const ImVec2& mn, ImVec2 m...
function ImVec2 (line 450) | static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, float t) ...
function ImVec2 (line 451) | static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, const ImVe...
function ImVec4 (line 452) | static inline ImVec4 ImLerp(const ImVec4& a, const ImVec4& b, float t) ...
function ImSaturate (line 453) | static inline float ImSaturate(float f) ...
function ImLengthSqr (line 454) | static inline float ImLengthSqr(const ImVec2& lhs) ...
function ImLengthSqr (line 455) | static inline float ImLengthSqr(const ImVec4& lhs) ...
function ImInvLength (line 456) | static inline float ImInvLength(const ImVec2& lhs, float fail_value) ...
function ImFloor (line 457) | static inline float ImFloor(float f) ...
function ImFloorSigned (line 458) | static inline float ImFloorSigned(float f) ...
function ImVec2 (line 459) | static inline ImVec2 ImFloor(const ImVec2& v) ...
function ImVec2 (line 460) | static inline ImVec2 ImFloorSigned(const ImVec2& v) ...
function ImModPositive (line 461) | static inline int ImModPositive(int a, int b) ...
function ImDot (line 462) | static inline float ImDot(const ImVec2& a, const ImVec2& b) ...
function ImVec2 (line 463) | static inline ImVec2 ImRotate(const ImVec2& v, float cos_a, float sin_a)...
function ImLinearSweep (line 464) | static inline float ImLinearSweep(float current, float target, float sp...
function ImVec2 (line 465) | static inline ImVec2 ImMul(const ImVec2& lhs, const ImVec2& rhs) ...
function ImIsFloatAboveGuaranteedIntegerPrecision (line 466) | static inline bool ImIsFloatAboveGuaranteedIntegerPrecision(float f) ...
function ImTriangleArea (line 478) | inline float ImTriangleArea(const ImVec2& a, const ImVec2& b, co...
function IM_MSVC_RUNTIME_CHECKS_OFF (line 483) | IM_MSVC_RUNTIME_CHECKS_OFF
function Contains (line 521) | bool Contains(const ImVec2& p) const { return p.x >= Min....
function Contains (line 522) | bool Contains(const ImRect& r) const { return r.Min.x >= Min....
function Overlaps (line 523) | bool Overlaps(const ImRect& r) const { return r.Min.y < Max....
function Add (line 524) | void Add(const ImVec2& p) { if (Min.x > p.x) M...
function Add (line 525) | void Add(const ImRect& r) { if (Min.x > r.Min.x) M...
function Expand (line 526) | void Expand(const float amount) { Min.x -= amount; Min...
function Expand (line 527) | void Expand(const ImVec2& amount) { Min.x -= amount.x; Min...
function Translate (line 528) | void Translate(const ImVec2& d) { Min.x += d.x; Min.y +=...
function TranslateX (line 529) | void TranslateX(float dx) { Min.x += dx; Max.x += ...
function TranslateY (line 530) | void TranslateY(float dy) { Min.y += dy; Max.y += ...
function ClipWith (line 531) | void ClipWith(const ImRect& r) { Min = ImMax(Min, r.Min...
function ClipWithFull (line 532) | void ClipWithFull(const ImRect& r) { Min = ImClamp(Min, r.M...
function Floor (line 533) | void Floor() { Min.x = IM_FLOOR(Min.x...
function IM_MSVC_RUNTIME_CHECKS_RESTORE (line 537) | IM_MSVC_RUNTIME_CHECKS_RESTORE
function ImBitArrayClearBit (line 541) | inline void ImBitArrayClearBit(ImU32* arr, int n) { ImU32 ...
function ImBitArraySetBit (line 542) | inline void ImBitArraySetBit(ImU32* arr, int n) { ImU32 ...
function ImBitArraySetBitRange (line 543) | inline void ImBitArraySetBitRange(ImU32* arr, int n, int n2) // Work...
function ClearAllBits (line 563) | void ClearAllBits() { memset(Storage, 0, sizeof(...
function SetAllBits (line 564) | void SetAllBits() { memset(Storage, 255, sizeo...
function TestBit (line 565) | bool TestBit(int n) const { n += OFFSET; IM_ASSERT(n >...
function SetBit (line 566) | void SetBit(int n) { n += OFFSET; IM_ASSERT(n >...
function ClearBit (line 567) | void ClearBit(int n) { n += OFFSET; IM_ASSERT(n >...
function SetBitRange (line 568) | void SetBitRange(int n, int n2) { n += OFFSET; n2 += OFFSET;...
function const (line 569) | bool operator[](int n) const { n += OFFSET; IM_ASSERT(n >...
function ImBitVector (line 574) | struct IMGUI_API ImBitVector
function set (line 597) | inline void set(T* data, int size) { Data = data; DataEnd =...
function set (line 598) | inline void set(T* data, T* data_end) { Data = data; DataEnd =...
function T (line 601) | inline T& operator[](int i) { T* p = Data + i; IM_AS...
function T (line 602) | inline const T& operator[](int i) const { const T* p = Data + i;...
function T (line 604) | inline T* begin() { return Data; }
function T (line 605) | inline const T* begin() const { return Data; }
function T (line 606) | inline T* end() { return DataEnd; }
function T (line 607) | inline const T* end() const { return DataEnd; }
function index_from_ptr (line 610) | inline int index_from_ptr(const T* it) const { IM_ASSERT(it >= Data &...
function GetArenaSizeInBytes (line 627) | inline int GetArenaSizeInBytes() { return CurrOff; }
function SetArenaBasePtr (line 628) | inline void SetArenaBasePtr(void* base_ptr) { BasePtr = (char*)base_...
function GetSpan (line 632) | void GetSpan(int n, ImSpan<T>* span) { span->set((T*)GetSpanPtrBegin...
type ImPoolIdx (line 638) | typedef int ImPoolIdx;
function T (line 649) | T* GetByKey(ImGuiID key) { int idx = Map.GetInt(k...
function T (line 650) | T* GetByIndex(ImPoolIdx n) { return &Buf[n]; }
function ImPoolIdx (line 651) | ImPoolIdx GetIndex(const T* p) const { IM_ASSERT(p >= Buf.Dat...
function T (line 652) | T* GetOrAddByKey(ImGuiID key) { int* p_idx = Map.GetIn...
function Contains (line 653) | bool Contains(const T* p) const { return (p >= Buf.Data ...
function Clear (line 654) | void Clear() { for (int n = 0; n < Ma...
function T (line 655) | T* Add() { int idx = FreeIdx; if ...
function Remove (line 656) | void Remove(ImGuiID key, const T* p) { Remove(key, GetIndex(p...
function Remove (line 657) | void Remove(ImGuiID key, ImPoolIdx idx) { Buf[idx].~T(); *(int*)...
function Reserve (line 658) | void Reserve(int capacity) { Buf.reserve(capacity);...
function T (line 665) | T* TryGetMapData(ImPoolIdx n) { int idx = Map.Data[n]....
function GetSize (line 667) | int GetSize() { return GetMapSize(); }
function clear (line 681) | void clear() { Buf.clear(); }
function T (line 684) | T* alloc_chunk(size_t sz) { size_t HDR_SZ = 4; sz = IM_MEMALIG...
function T (line 685) | T* begin() { size_t HDR_SZ = 4; if (!Buf.Data) ...
function T (line 686) | T* next_chunk(T* p) { size_t HDR_SZ = 4; IM_ASSERT(p >= ...
function chunk_size (line 687) | int chunk_size(const T* p) { return ((const int*)p)[-1]; }
function T (line 688) | T* end() { return (T*)(void*)(Buf.Data + Buf....
function offset_from_ptr (line 689) | int offset_from_ptr(const T* p) { IM_ASSERT(p >= begin() && p < end(...
function T (line 690) | T* ptr_from_offset(int off) { IM_ASSERT(off >= 4 && off < Buf.Si...
function swap (line 691) | void swap(ImChunkStream<T>& rhs) { rhs.Buf.swap(Buf); }
function ImDrawListSharedData (line 727) | struct IMGUI_API ImDrawListSharedData
function ClearFreeMemory (line 747) | struct ImDrawDataBuilder
function GetDrawListCount (line 753) | int GetDrawListCount() const { int count = 0; for (int n = 0; n < IM_...
function ImGuiComboPreviewData (line 963) | struct IMGUI_API ImGuiComboPreviewData
function ImGuiGroupData (line 976) | struct IMGUI_API ImGuiGroupData
function ImGuiMenuColumns (line 992) | struct IMGUI_API ImGuiMenuColumns
function ImGuiInputTextState (line 1011) | struct IMGUI_API ImGuiInputTextState
type ImGuiPopupData (line 1047) | struct ImGuiPopupData
type ImGuiNextItemDataFlags_ (line 1104) | enum ImGuiNextItemDataFlags_
function ClearFlags (line 1111) | struct ImGuiNextItemData
type ImGuiLastItemData (line 1124) | struct ImGuiLastItemData
function ImGuiStackSizes (line 1136) | struct IMGUI_API ImGuiStackSizes
type ImGuiWindowStackData (line 1154) | struct ImGuiWindowStackData
type ImGuiShrinkWidthItem (line 1161) | struct ImGuiShrinkWidthItem
function ImGuiPtrOrIndex (line 1167) | struct ImGuiPtrOrIndex
type ImGuiKeyPrivate_ (line 1182) | enum ImGuiKeyPrivate_
type ImGuiInputEventType (line 1190) | enum ImGuiInputEventType
type ImGuiInputSource (line 1203) | enum ImGuiInputSource
type ImGuiInputEventMousePos (line 1216) | struct ImGuiInputEventMousePos { float PosX, PosY; }
type ImGuiInputEventMouseWheel (line 1217) | struct ImGuiInputEventMouseWheel { float WheelX, WheelY; }
type ImGuiInputEventMouseButton (line 1218) | struct ImGuiInputEventMouseButton { int Button; bool Down; }
type ImGuiInputEventMouseViewport (line 1219) | struct ImGuiInputEventMouseViewport { ImGuiID HoveredViewportID; }
type ImGuiInputEventKey (line 1220) | struct ImGuiInputEventKey { ImGuiKey Key; bool Down; float Ana...
type ImGuiInputEventText (line 1221) | struct ImGuiInputEventText { unsigned int Char; }
type ImGuiInputEventAppFocused (line 1222) | struct ImGuiInputEventAppFocused { bool Focused; }
type ImGuiInputEvent (line 1224) | struct ImGuiInputEvent
type ImGuiNavReadMode (line 1244) | enum ImGuiNavReadMode
function FromPositions (line 1258) | struct ImGuiListClipperRange
function Reset (line 1271) | struct ImGuiListClipperData
type ImGuiActivateFlags_ (line 1287) | enum ImGuiActivateFlags_
type ImGuiScrollFlags_ (line 1296) | enum ImGuiScrollFlags_
type ImGuiNavHighlightFlags_ (line 1310) | enum ImGuiNavHighlightFlags_
type ImGuiNavDirSourceFlags_ (line 1319) | enum ImGuiNavDirSourceFlags_
type ImGuiNavMoveFlags_ (line 1328) | enum ImGuiNavMoveFlags_
type ImGuiNavLayer (line 1346) | enum ImGuiNavLayer
function Clear (line 1353) | struct ImGuiNavItemData
type ImGuiOldColumnFlags_ (line 1373) | enum ImGuiOldColumnFlags_
type ImGuiOldColumnData (line 1393) | struct ImGuiOldColumnData
type ImGuiOldColumns (line 1403) | struct ImGuiOldColumns
type ImGuiDockNodeFlagsPrivate_ (line 1439) | enum ImGuiDockNodeFlagsPrivate_
type ImGuiDataAuthority_ (line 1464) | enum ImGuiDataAuthority_
type ImGuiDockNodeState (line 1471) | enum ImGuiDockNodeState
function ImGuiDockNode (line 1480) | struct IMGUI_API ImGuiDockNode
type ImGuiWindowDockStyleCol (line 1546) | enum ImGuiWindowDockStyleCol
type ImGuiWindowDockStyle (line 1557) | struct ImGuiWindowDockStyle
type ImGuiDockContext (line 1562) | struct ImGuiDockContext
function ImGuiViewport (line 1579) | struct ImGuiViewportP : public ImGuiViewport
type ImGuiWindowSettings (line 1625) | struct ImGuiWindowSettings
type ImGuiSettingsHandler (line 1642) | struct ImGuiSettingsHandler
type ImGuiStackLevelInfo (line 1687) | struct ImGuiStackLevelInfo
type ImGuiStackTool (line 1699) | struct ImGuiStackTool
type ImGuiContextHookType (line 1716) | enum ImGuiContextHookType { ImGuiContextHookType_NewFramePre, ImGuiConte...
type ImGuiContextHook (line 1718) | struct ImGuiContextHook
type ImGuiContext (line 1733) | struct ImGuiContext
function ImGuiWindowTempData (line 2172) | struct IMGUI_API ImGuiWindowTempData
function ImGuiWindow (line 2220) | struct IMGUI_API ImGuiWindow
type ImGuiTabBarFlagsPrivate_ (line 2362) | enum ImGuiTabBarFlagsPrivate_
type ImGuiTabItemFlagsPrivate_ (line 2370) | enum ImGuiTabItemFlagsPrivate_
type ImGuiTabItem (line 2380) | struct ImGuiTabItem
function ImGuiTabBar (line 2399) | struct IMGUI_API ImGuiTabBar
type ImS8 (line 2453) | typedef ImS8 ImGuiTableColumnIdx;
type ImU8 (line 2454) | typedef ImU8 ImGuiTableDrawChannelIdx;
type ImGuiTableCellData (line 2519) | struct ImGuiTableCellData
type ImGuiTableInstanceData (line 2526) | struct ImGuiTableInstanceData
function ImGuiTable (line 2535) | struct IMGUI_API ImGuiTable
function ImGuiTableTempData (line 2649) | struct IMGUI_API ImGuiTableTempData
type ImGuiTableSettings (line 2694) | struct ImGuiTableSettings
function namespace (line 2712) | namespace ImGui
function FocusableItemRegister (line 2844) | inline bool FocusableItemRegister(ImGuiWindow* window, ImGuiID id) { IM...
function FocusableItemUnregister (line 2845) | inline void FocusableItemUnregister(ImGuiWindow* window) { IM...
function ImGuiID (line 2901) | inline ImGuiID GetFocusedFocusScope() { ImGuiContext& ...
function ImGuiID (line 2902) | inline ImGuiID GetFocusScope() { ImGuiContext& ...
function IsNamedKey (line 2906) | inline bool IsNamedKey(ImGuiKey key) ...
function IsLegacyKey (line 2907) | inline bool IsLegacyKey(ImGuiKey key) ...
function IsGamepadKey (line 2908) | inline bool IsGamepadKey(ImGuiKey key) ...
function IsActiveIdUsingNavDir (line 2912) | inline bool IsActiveIdUsingNavDir(ImGuiDir dir) ...
function IsActiveIdUsingNavInput (line 2913) | inline bool IsActiveIdUsingNavInput(ImGuiNavInput input) ...
function IsActiveIdUsingKey (line 2914) | inline bool IsActiveIdUsingKey(ImGuiKey key) ...
function SetActiveIdUsingKey (line 2915) | inline void SetActiveIdUsingKey(ImGuiKey key) ...
function IsNavInputDown (line 2917) | inline bool IsNavInputDown(ImGuiNavInput n) ...
function IsNavInputTest (line 2918) | inline bool IsNavInputTest(ImGuiNavInput n, ImGuiNavReadMode...
function ImGuiDockNode (line 2940) | inline ImGuiDockNode* DockNodeGetRootNode(ImGuiDockNode* node) ...
function DockNodeIsInHierarchyOf (line 2941) | inline bool DockNodeIsInHierarchyOf(ImGuiDockNode* node, ImG...
function DockNodeGetDepth (line 2942) | inline int DockNodeGetDepth(const ImGuiDockNode* node) ...
function ImGuiID (line 2943) | inline ImGuiID DockNodeGetWindowMenuButtonId(const ImGuiDockNod...
function ImGuiDockNode (line 2944) | inline ImGuiDockNode* GetWindowDockNode() ...
function ImGuiDockNode (line 2962) | inline ImGuiDockNode* DockBuilderGetCentralNode(ImGuiID node_id) ...
function ImGuiTable (line 3002) | inline ImGuiTable* GetCurrentTable() { ImGuiContext& g = *GImGui; r...
function ImGuiTableInstanceData (line 3014) | inline ImGuiTableInstanceData* TableGetInstanceData(ImGuiTable* table,...
function TempInputIsActive (line 3132) | inline bool TempInputIsActive(ImGuiID id) { ImGuiConte...
function ImGuiInputTextState (line 3133) | inline ImGuiInputTextState* GetInputTextState(ImGuiID id) { ImGuiConte...
function DebugStartItemPicker (line 3156) | inline void DebugStartItemPicker() ...
type ImFontBuilderIO (line 3184) | struct ImFontBuilderIO
FILE: test/third_party/imgui/imgui_tables.cpp
function ImGuiTableFlags (line 264) | inline ImGuiTableFlags TableFixFlags(ImGuiTableFlags flags, ImGuiWindow*...
function ImGuiTable (line 297) | ImGuiTable* ImGui::TableFindByID(ImGuiID id)
function TableSetupColumnFlags (line 657) | static void TableSetupColumnFlags(ImGuiTable* table, ImGuiTableColumn* c...
function ImGuiTableColumnFlags (line 1569) | ImGuiTableColumnFlags ImGui::TableGetColumnFlags(int column_n)
function ImRect (line 1588) | ImRect ImGui::TableGetCellBgRect(const ImGuiTable* table, int column_n)
function ImGuiID (line 1603) | ImGuiID ImGui::TableGetColumnResizeID(const ImGuiTable* table, int colum...
type MergeGroup (line 2348) | struct MergeGroup
method MergeGroup (line 2354) | MergeGroup() { ChannelsCount = 0; }
function ImGuiTableSortSpecs (line 2617) | ImGuiTableSortSpecs* ImGui::TableGetSortSpecs()
function ImGuiSortDirection (line 2635) | static inline ImGuiSortDirection TableGetColumnAvailSortDirection(ImGuiT...
function ImGuiSortDirection (line 2654) | ImGuiSortDirection ImGui::TableGetColumnNextSortDirection(ImGuiTableColu...
function TableSettingsInit (line 3156) | static void TableSettingsInit(ImGuiTableSettings* settings, ImGuiID id, ...
function TableSettingsCalcChunkSize (line 3168) | static size_t TableSettingsCalcChunkSize(int columns_count)
function ImGuiTableSettings (line 3173) | ImGuiTableSettings* ImGui::TableSettingsCreate(ImGuiID id, int columns_c...
function ImGuiTableSettings (line 3182) | ImGuiTableSettings* ImGui::TableSettingsFindByID(ImGuiID id)
function ImGuiTableSettings (line 3193) | ImGuiTableSettings* ImGui::TableGetBoundSettings(ImGuiTable* table)
function TableSettingsHandler_ClearAll (line 3336) | static void TableSettingsHandler_ClearAll(ImGuiContext* ctx, ImGuiSettin...
function TableSettingsHandler_ApplyAll (line 3346) | static void TableSettingsHandler_ApplyAll(ImGuiContext* ctx, ImGuiSettin...
function TableSettingsHandler_ReadLine (line 3376) | static void TableSettingsHandler_ReadLine(ImGuiContext*, ImGuiSettingsHa...
function TableSettingsHandler_WriteAll (line 3402) | static void TableSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettin...
function GetDraggedColumnOffset (line 3685) | static float GetDraggedColumnOffset(ImGuiOldColumns* columns, int column...
function GetColumnWidthEx (line 3718) | static float GetColumnWidthEx(ImGuiOldColumns* columns, int column_index...
function ImGuiOldColumns (line 3814) | ImGuiOldColumns* ImGui::FindOrCreateColumns(ImGuiWindow* window, ImGuiID...
function ImGuiID (line 3827) | ImGuiID ImGui::GetColumnsID(const char* str_id, int columns_count)
FILE: test/third_party/imgui/imgui_widgets.cpp
function ImGuiID (line 864) | ImGuiID ImGui::GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis)
function ImRect (line 870) | ImRect ImGui::GetWindowScrollbarRect(ImGuiWindow* window, ImGuiAxis axis)
function CalcMaxPopupHeightFromItemCount (line 1576) | static float CalcMaxPopupHeightFromItemCount(int items_count)
function Items_ArrayGetter (line 1777) | static bool Items_ArrayGetter(void* data, int idx, const char** out_text)
function Items_SingleStringGetter (line 1786) | static bool Items_SingleStringGetter(void* data, int idx, const char** o...
function ImGuiDataTypeInfo (line 1929) | const ImGuiDataTypeInfo* ImGui::DataTypeGetInfo(ImGuiDataType data_type)
function DataTypeCompareT (line 2052) | static int DataTypeCompareT(const T* lhs, const T* rhs)
function DataTypeClampT (line 2080) | static bool DataTypeClampT(T* v, const T* v_min, const T* v_max)
function GetMinimumStepAtDecimalPrecision (line 2108) | static float GetMinimumStepAtDecimalPrecision(int decimal_precision)
function TYPE (line 2117) | TYPE ImGui::RoundScalarWithFormatT(const char* format, ImGuiDataType dat...
function TYPE (line 2653) | TYPE ImGui::ScaleValueFromRatioT(ImGuiDataType data_type, float t, TYPE ...
function ImParseFormatSanitizeForPrinting (line 3269) | void ImParseFormatSanitizeForPrinting(const char* fmt_in, char* fmt_out,...
function ImParseFormatPrecision (line 3319) | int ImParseFormatPrecision(const char* fmt, int default_precision)
function ImGuiInputTextFlags (line 3363) | static inline ImGuiInputTextFlags InputScalar_DefaultCharsFilter(ImGuiDa...
function InputTextCalcTextLenAndLineCount (line 3599) | static int InputTextCalcTextLenAndLineCount(const char* text_begin, cons...
function ImVec2 (line 3613) | static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const Im...
type ImStb (line 3659) | namespace ImStb
function STB_TEXTEDIT_STRINGLEN (line 3662) | static int STB_TEXTEDIT_STRINGLEN(const ImGuiInputTextState* obj) ...
function ImWchar (line 3663) | static ImWchar STB_TEXTEDIT_GETCHAR(const ImGuiInputTextState* obj, in...
function STB_TEXTEDIT_GETWIDTH (line 3664) | static float STB_TEXTEDIT_GETWIDTH(ImGuiInputTextState* obj, int lin...
function STB_TEXTEDIT_KEYTOTEXT (line 3665) | static int STB_TEXTEDIT_KEYTOTEXT(int key) ...
function STB_TEXTEDIT_LAYOUTROW (line 3667) | static void STB_TEXTEDIT_LAYOUTROW(StbTexteditRow* r, ImGuiInputTex...
function is_separator (line 3681) | static bool is_separator(unsigned int c) ...
function is_word_boundary_from_right (line 3682) | static int is_word_boundary_from_right(ImGuiInputTextState* obj, int ...
function is_word_boundary_from_left (line 3683) | static int is_word_boundary_from_left(ImGuiInputTextState* obj, int i...
function STB_TEXTEDIT_MOVEWORDLEFT_IMPL (line 3684) | static int STB_TEXTEDIT_MOVEWORDLEFT_IMPL(ImGuiInputTextState* obj, i...
function STB_TEXTEDIT_MOVEWORDRIGHT_MAC (line 3685) | static int STB_TEXTEDIT_MOVEWORDRIGHT_MAC(ImGuiInputTextState* obj, i...
function STB_TEXTEDIT_MOVEWORDRIGHT_WIN (line 3690) | static int STB_TEXTEDIT_MOVEWORDRIGHT_WIN(ImGuiInputTextState* obj, i...
function STB_TEXTEDIT_DELETECHARS (line 3694) | static void STB_TEXTEDIT_DELETECHARS(ImGuiInputTextState* obj, int pos...
function STB_TEXTEDIT_INSERTCHARS (line 3710) | static bool STB_TEXTEDIT_INSERTCHARS(ImGuiInputTextState* obj, int pos...
function stb_textedit_replace (line 3766) | static void stb_textedit_replace(ImGuiInputTextState* str, STB_Textedi...
function InputTextFilterCharacter (line 3849) | static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTex...
function ColorEditRestoreHS (line 4846) | static void ColorEditRestoreHS(const float* col, float* H, float* S, flo...
function RenderArrowsForVerticalBar (line 5114) | static void RenderArrowsForVerticalBar(ImDrawList* draw_list, ImVec2 pos...
type ImGuiPlotArrayGetterData (line 6589) | struct ImGuiPlotArrayGetterData
method ImGuiPlotArrayGetterData (line 6594) | ImGuiPlotArrayGetterData(const float* values, int stride) { Values = v...
function Plot_ArrayGetter (line 6597) | static float Plot_ArrayGetter(void* data, int idx)
function IsRootOfOpenMenuSet (line 6870) | static bool IsRootOfOpenMenuSet()
type ImGuiTabBarSection (line 7198) | struct ImGuiTabBarSection
method ImGuiTabBarSection (line 7204) | ImGuiTabBarSection() { memset(this, 0, sizeof(*this)); }
type ImGui (line 7207) | namespace ImGui
function TabItemGetSectionIdx (line 7225) | static inline int TabItemGetSectionIdx(const ImGuiTabItem* tab)
function ImGuiTabBar (line 7248) | static ImGuiTabBar* GetTabBarFromTabBarRef(const ImGuiPtrOrIndex& ref)
function ImGuiPtrOrIndex (line 7254) | static ImGuiPtrOrIndex GetTabBarRefFromTabBar(ImGuiTabBar* tab_bar)
function ImU32 (line 7617) | static ImU32 ImGui::TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* ...
function ImGuiTabItem (line 7640) | ImGuiTabItem* ImGui::TabBarFindTabByID(ImGuiTabBar* tab_bar, ImGuiID tab...
function ImGuiTabItem (line 7650) | ImGuiTabItem* ImGui::TabBarFindMostRecentlySelectedTabForActiveWindow(Im...
function ImGuiTabItem (line 7833) | static ImGuiTabItem* ImGui::TabBarScrollingButtons(ImGuiTabBar* tab_bar)
function ImGuiTabItem (line 7894) | static ImGuiTabItem* ImGui::TabBarTabListPopupButton(ImGuiTabBar* tab_bar)
function ImVec2 (line 8309) | ImVec2 ImGui::TabItemCalcSize(const char* label, bool has_close_button)
FILE: test/third_party/imgui/imstb_rectpack.h
type stbrp_context (line 85) | typedef struct stbrp_context stbrp_context;
type stbrp_node (line 86) | typedef struct stbrp_node stbrp_node;
type stbrp_rect (line 87) | typedef struct stbrp_rect stbrp_rect;
type stbrp_coord (line 89) | typedef int stbrp_coord;
type stbrp_rect (line 119) | struct stbrp_rect
type stbrp_node (line 179) | struct stbrp_node
type stbrp_context (line 185) | struct stbrp_context
function STBRP_DEF (line 233) | STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic)
function STBRP_DEF (line 245) | STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int ...
function STBRP_DEF (line 265) | STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int ...
function stbrp__skyline_find_min_y (line 291) | static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first...
type stbrp__findresult (line 341) | typedef struct
function stbrp__findresult (line 347) | static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, ...
function stbrp__findresult (line 449) | static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *co...
function rect_height_compare (line 528) | static int STBRP__CDECL rect_height_compare(const void *a, const void *b)
function rect_original_order (line 539) | static int STBRP__CDECL rect_original_order(const void *a, const void *b)
function STBRP_DEF (line 546) | STBRP_DEF int stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects...
FILE: test/third_party/imgui/imstb_textedit.h
type StbUndoRecord (line 301) | typedef struct
type StbUndoState (line 310) | typedef struct
type STB_TexteditState (line 319) | typedef struct
type StbTexteditRow (line 366) | typedef struct
function stb_text_locate_coord (line 400) | static int stb_text_locate_coord(STB_TEXTEDIT_STRING *str, float x, floa...
function stb_textedit_click (line 460) | static void stb_textedit_click(STB_TEXTEDIT_STRING *str, STB_TexteditSta...
function stb_textedit_drag (line 478) | static void stb_textedit_drag(STB_TEXTEDIT_STRING *str, STB_TexteditStat...
type StbFindState (line 510) | typedef struct
function stb_textedit_find_charpos (line 520) | static void stb_textedit_find_charpos(StbFindState *find, STB_TEXTEDIT_S...
function stb_textedit_clamp (line 579) | static void stb_textedit_clamp(STB_TEXTEDIT_STRING *str, STB_TexteditSta...
function stb_textedit_delete (line 593) | static void stb_textedit_delete(STB_TEXTEDIT_STRING *str, STB_TexteditSt...
function stb_textedit_delete_selection (line 601) | static void stb_textedit_delete_selection(STB_TEXTEDIT_STRING *str, STB_...
function stb_textedit_sortselection (line 617) | static void stb_textedit_sortselection(STB_TexteditState *state)
function stb_textedit_move_to_first (line 627) | static void stb_textedit_move_to_first(STB_TexteditState *state)
function stb_textedit_move_to_last (line 638) | static void stb_textedit_move_to_last(STB_TEXTEDIT_STRING *str, STB_Text...
function is_word_boundary (line 650) | static int is_word_boundary( STB_TEXTEDIT_STRING *str, int idx )
function stb_textedit_move_to_word_previous (line 656) | static int stb_textedit_move_to_word_previous( STB_TEXTEDIT_STRING *str,...
function stb_textedit_move_to_word_next (line 671) | static int stb_textedit_move_to_word_next( STB_TEXTEDIT_STRING *str, int...
function stb_textedit_prep_selection_at_cursor (line 689) | static void stb_textedit_prep_selection_at_cursor(STB_TexteditState *state)
function stb_textedit_cut (line 698) | static int stb_textedit_cut(STB_TEXTEDIT_STRING *str, STB_TexteditState ...
function stb_textedit_paste_internal (line 709) | static int stb_textedit_paste_internal(STB_TEXTEDIT_STRING *str, STB_Tex...
function stb_textedit_key (line 730) | static void stb_textedit_key(STB_TEXTEDIT_STRING *str, STB_TexteditState...
function stb_textedit_flush_redo (line 1120) | static void stb_textedit_flush_redo(StbUndoState *state)
function stb_textedit_discard_undo (line 1127) | static void stb_textedit_discard_undo(StbUndoState *state)
function stb_textedit_discard_redo (line 1149) | static void stb_textedit_discard_redo(StbUndoState *state)
function StbUndoRecord (line 1179) | static StbUndoRecord *stb_text_create_undo_record(StbUndoState *state, i...
function STB_TEXTEDIT_CHARTYPE (line 1203) | static STB_TEXTEDIT_CHARTYPE *stb_text_createundo(StbUndoState *state, i...
function stb_text_undo (line 1223) | static void stb_text_undo(STB_TEXTEDIT_STRING *str, STB_TexteditState *s...
function stb_text_redo (line 1291) | static void stb_text_redo(STB_TEXTEDIT_STRING *str, STB_TexteditState *s...
function stb_text_makeundo_insert (line 1342) | static void stb_text_makeundo_insert(STB_TexteditState *state, int where...
function stb_text_makeundo_delete (line 1347) | static void stb_text_makeundo_delete(STB_TEXTEDIT_STRING *str, STB_Texte...
function stb_text_makeundo_replace (line 1357) | static void stb_text_makeundo_replace(STB_TEXTEDIT_STRING *str, STB_Text...
function stb_textedit_clear_state (line 1368) | static void stb_textedit_clear_state(STB_TexteditState *state, int is_si...
function stb_textedit_initialize_state (line 1386) | static void stb_textedit_initialize_state(STB_TexteditState *state, int ...
function stb_textedit_paste (line 1396) | static int stb_textedit_paste(STB_TEXTEDIT_STRING *str, STB_TexteditStat...
FILE: test/third_party/imgui/imstb_truetype.h
function my_stbtt_initfont (line 292) | void my_stbtt_initfont(void)
function my_stbtt_print (line 304) | void my_stbtt_print(float x, float y, char *text)
function main (line 339) | int main(int argc, char **argv)
function main (line 380) | int main(int arg, char **argv)
type stbtt_uint8 (line 433) | typedef unsigned char stbtt_uint8;
type stbtt_int8 (line 434) | typedef signed char stbtt_int8;
type stbtt_uint16 (line 435) | typedef unsigned short stbtt_uint16;
type stbtt_int16 (line 436) | typedef signed short stbtt_int16;
type stbtt_uint32 (line 437) | typedef unsigned int stbtt_uint32;
type stbtt_int32 (line 438) | typedef signed int stbtt_int32;
type stbtt__buf (line 518) | typedef struct
type stbtt_bakedchar (line 532) | typedef struct
type stbtt_aligned_quad (line 548) | typedef struct
type stbtt_packedchar (line 580) | typedef struct
type stbtt_pack_context (line 587) | typedef struct stbtt_pack_context stbtt_pack_context;
type stbtt_fontinfo (line 588) | typedef struct stbtt_fontinfo stbtt_fontinfo;
type stbrp_rect (line 590) | typedef struct stbrp_rect stbrp_rect;
type stbtt_pack_range (line 624) | typedef struct
type stbtt_pack_context (line 683) | struct stbtt_pack_context {
type stbtt_fontinfo (line 718) | struct stbtt_fontinfo
type stbtt_kerningentry (line 809) | typedef struct stbtt_kerningentry
type stbtt_vertex (line 840) | typedef struct
type stbtt__bitmap (line 929) | typedef struct
function stbtt_uint8 (line 1138) | static stbtt_uint8 stbtt__buf_get8(stbtt__buf *b)
function stbtt_uint8 (line 1145) | static stbtt_uint8 stbtt__buf_peek8(stbtt__buf *b)
function stbtt__buf_seek (line 1152) | static void stbtt__buf_seek(stbtt__buf *b, int o)
function stbtt__buf_skip (line 1158) | static void stbtt__buf_skip(stbtt__buf *b, int o)
function stbtt_uint32 (line 1163) | static stbtt_uint32 stbtt__buf_get(stbtt__buf *b, int n)
function stbtt__buf (line 1173) | static stbtt__buf stbtt__new_buf(const void *p, size_t size)
function stbtt__buf (line 1186) | static stbtt__buf stbtt__buf_range(const stbtt__buf *b, int o, int s)
function stbtt__buf (line 1195) | static stbtt__buf stbtt__cff_get_index(stbtt__buf *b)
function stbtt_uint32 (line 1209) | static stbtt_uint32 stbtt__cff_int(stbtt__buf *b)
function stbtt__cff_skip_operand (line 1221) | static void stbtt__cff_skip_operand(stbtt__buf *b) {
function stbtt__buf (line 1236) | static stbtt__buf stbtt__dict_get(stbtt__buf *b, int key)
function stbtt__dict_get_ints (line 1251) | static void stbtt__dict_get_ints(stbtt__buf *b, int key, int outcount, s...
function stbtt__cff_index_count (line 1259) | static int stbtt__cff_index_count(stbtt__buf *b)
function stbtt__buf (line 1265) | static stbtt__buf stbtt__cff_index_get(stbtt__buf b, int i)
function stbtt_uint16 (line 1291) | static stbtt_uint16 ttUSHORT(stbtt_uint8 *p) { return p[0]*256 + p[1]; }
function stbtt_int16 (line 1292) | static stbtt_int16 ttSHORT(stbtt_uint8 *p) { return p[0]*256 + p[1]; }
function stbtt_uint32 (line 1293) | static stbtt_uint32 ttULONG(stbtt_uint8 *p) { return (p[0]<<24) + (p[1]...
function stbtt_int32 (line 1294) | static stbtt_int32 ttLONG(stbtt_uint8 *p) { return (p[0]<<24) + (p[1]...
function stbtt__isfont (line 1299) | static int stbtt__isfont(stbtt_uint8 *font)
function stbtt_uint32 (line 1311) | static stbtt_uint32 stbtt__find_table(stbtt_uint8 *data, stbtt_uint32 fo...
function stbtt_GetFontOffsetForIndex_internal (line 1324) | static int stbtt_GetFontOffsetForIndex_internal(unsigned char *font_coll...
function stbtt_GetNumberOfFonts_internal (line 1343) | static int stbtt_GetNumberOfFonts_internal(unsigned char *font_collection)
function stbtt__buf (line 1359) | static stbtt__buf stbtt__get_subrs(stbtt__buf cff, stbtt__buf fontdict)
function stbtt__get_svg (line 1373) | static int stbtt__get_svg(stbtt_fontinfo *info)
function stbtt_InitFont_internal (line 1388) | static int stbtt_InitFont_internal(stbtt_fontinfo *info, unsigned char *...
function STBTT_DEF (line 1501) | STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unico...
function STBTT_DEF (line 1594) | STBTT_DEF int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int un...
function stbtt_setvertex (line 1599) | static void stbtt_setvertex(stbtt_vertex *v, stbtt_uint8 type, stbtt_int...
function stbtt__GetGlyfOffset (line 1608) | static int stbtt__GetGlyfOffset(const stbtt_fontinfo *info, int glyph_in...
function STBTT_DEF (line 1630) | STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_in...
function STBTT_DEF (line 1646) | STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int code...
function STBTT_DEF (line 1651) | STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_i...
function stbtt__close_shape (line 1663) | static int stbtt__close_shape(stbtt_vertex *vertices, int num_vertices, ...
function stbtt__GetGlyphShapeTT (line 1679) | static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_...
type stbtt__csctx (line 1902) | typedef struct
function stbtt__track_vertex (line 1916) | static void stbtt__track_vertex(stbtt__csctx *c, stbtt_int32 x, stbtt_in...
function stbtt__csctx_v (line 1925) | static void stbtt__csctx_v(stbtt__csctx *c, stbtt_uint8 type, stbtt_int3...
function stbtt__csctx_close_shape (line 1941) | static void stbtt__csctx_close_shape(stbtt__csctx *ctx)
function stbtt__csctx_rmove_to (line 1947) | static void stbtt__csctx_rmove_to(stbtt__csctx *ctx, float dx, float dy)
function stbtt__csctx_rline_to (line 1955) | static void stbtt__csctx_rline_to(stbtt__csctx *ctx, float dx, float dy)
function stbtt__csctx_rccurve_to (line 1962) | static void stbtt__csctx_rccurve_to(stbtt__csctx *ctx, float dx1, float ...
function stbtt__buf (line 1973) | static stbtt__buf stbtt__get_subr(stbtt__buf idx, int n)
function stbtt__buf (line 1987) | static stbtt__buf stbtt__cid_get_glyph_subrs(const stbtt_fontinfo *info,...
function stbtt__run_charstring (line 2015) | static int stbtt__run_charstring(const stbtt_fontinfo *info, int glyph_i...
function stbtt__GetGlyphShapeT2 (line 2274) | static int stbtt__GetGlyphShapeT2(const stbtt_fontinfo *info, int glyph_...
function stbtt__GetGlyphInfoT2 (line 2291) | static int stbtt__GetGlyphInfoT2(const stbtt_fontinfo *info, int glyph_i...
function STBTT_DEF (line 2302) | STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_...
function STBTT_DEF (line 2310) | STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int gl...
function STBTT_DEF (line 2322) | STBTT_DEF int stbtt_GetKerningTableLength(const stbtt_fontinfo *info)
function STBTT_DEF (line 2337) | STBTT_DEF int stbtt_GetKerningTable(const stbtt_fontinfo *info, stbtt_ke...
function stbtt__GetGlyphKernInfoAdvance (line 2364) | static int stbtt__GetGlyphKernInfoAdvance(const stbtt_fontinfo *info, in...
function stbtt_int32 (line 2394) | static stbtt_int32 stbtt__GetCoverageIndex(stbtt_uint8 *coverageTable, i...
function stbtt_int32 (line 2452) | static stbtt_int32 stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int...
function stbtt_int32 (line 2501) | static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *...
function STBTT_DEF (line 2615) | STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int...
function STBTT_DEF (line 2627) | STBTT_DEF int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info,...
function STBTT_DEF (line 2634) | STBTT_DEF void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, in...
function STBTT_DEF (line 2639) | STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *as...
function STBTT_DEF (line 2646) | STBTT_DEF int stbtt_GetFontVMetricsOS2(const stbtt_fontinfo *info, int ...
function STBTT_DEF (line 2657) | STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int ...
function STBTT_DEF (line 2665) | STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, fl...
function STBTT_DEF (line 2671) | STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *in...
function STBTT_DEF (line 2677) | STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *v)
function STBTT_DEF (line 2682) | STBTT_DEF stbtt_uint8 *stbtt_FindSVGDoc(const stbtt_fontinfo *info, int gl)
function STBTT_DEF (line 2699) | STBTT_DEF int stbtt_GetGlyphSVG(const stbtt_fontinfo *info, int gl, cons...
function STBTT_DEF (line 2716) | STBTT_DEF int stbtt_GetCodepointSVG(const stbtt_fontinfo *info, int unic...
function STBTT_DEF (line 2726) | STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *fon...
function STBTT_DEF (line 2744) | STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int g...
function STBTT_DEF (line 2749) | STBTT_DEF void stbtt_GetCodepointBitmapBoxSubpixel(const stbtt_fontinfo ...
function STBTT_DEF (line 2754) | STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, i...
type stbtt__hheap_chunk (line 2763) | typedef struct stbtt__hheap_chunk
type stbtt__hheap (line 2768) | typedef struct stbtt__hheap
function stbtt__hheap_free (line 2796) | static void stbtt__hheap_free(stbtt__hheap *hh, void *p)
function stbtt__hheap_cleanup (line 2802) | static void stbtt__hheap_cleanup(stbtt__hheap *hh, void *userdata)
type stbtt__edge (line 2812) | typedef struct stbtt__edge {
type stbtt__active_edge (line 2818) | typedef struct stbtt__active_edge
function stbtt__active_edge (line 2840) | static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__ed...
function stbtt__active_edge (line 2862) | static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__ed...
function stbtt__fill_active_edges (line 2887) | static void stbtt__fill_active_edges(unsigned char *scanline, int len, s...
function stbtt__rasterize_sorted_edges (line 2929) | static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__...
function stbtt__handle_clipped_edge (line 3033) | static void stbtt__handle_clipped_edge(float *scanline, int x, stbtt__ac...
function stbtt__sized_trapezoid_area (line 3070) | static float stbtt__sized_trapezoid_area(float height, float top_width, ...
function stbtt__position_trapezoid_area (line 3077) | static float stbtt__position_trapezoid_area(float height, float tx0, flo...
function stbtt__sized_triangle_area (line 3082) | static float stbtt__sized_triangle_area(float height, float width)
function stbtt__fill_active_edges_new (line 3087) | static void stbtt__fill_active_edges_new(float *scanline, float *scanlin...
function stbtt__rasterize_sorted_edges (line 3305) | static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__...
function stbtt__sort_edges_ins_sort (line 3407) | static void stbtt__sort_edges_ins_sort(stbtt__edge *p, int n)
function stbtt__sort_edges_quicksort (line 3425) | static void stbtt__sort_edges_quicksort(stbtt__edge *p, int n)
function stbtt__sort_edges (line 3487) | static void stbtt__sort_edges(stbtt__edge *p, int n)
type stbtt__point (line 3493) | typedef struct
function stbtt__rasterize (line 3498) | static void stbtt__rasterize(stbtt__bitmap *result, stbtt__point *pts, i...
function stbtt__add_point (line 3555) | static void stbtt__add_point(stbtt__point *points, int n, float x, float y)
function stbtt__tesselate_curve (line 3563) | static int stbtt__tesselate_curve(stbtt__point *points, int *num_points,...
function stbtt__tesselate_cubic (line 3583) | static void stbtt__tesselate_cubic(stbtt__point *points, int *num_points...
function stbtt__point (line 3626) | static stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num...
function STBTT_DEF (line 3703) | STBTT_DEF void stbtt_Rasterize(stbtt__bitmap *result, float flatness_in_...
function STBTT_DEF (line 3716) | STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata)
function STBTT_DEF (line 3766) | STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info,...
function STBTT_DEF (line 3785) | STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigne...
function STBTT_DEF (line 3795) | STBTT_DEF void stbtt_MakeCodepointBitmapSubpixelPrefilter(const stbtt_fo...
function STBTT_DEF (line 3800) | STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *i...
function STBTT_DEF (line 3810) | STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, uns...
function stbtt_BakeFontBitmap_internal (line 3821) | static int stbtt_BakeFontBitmap_internal(unsigned char *data, int offset...
function STBTT_DEF (line 3867) | STBTT_DEF void stbtt_GetBakedQuad(const stbtt_bakedchar *chardata, int p...
type stbrp_coord (line 3895) | typedef int stbrp_coord;
type stbrp_context (line 3908) | typedef struct
type stbrp_node (line 3914) | typedef struct
type stbrp_rect (line 3919) | struct stbrp_rect
function stbrp_init_target (line 3925) | static void stbrp_init_target(stbrp_context *con, int pw, int ph, stbrp_...
function stbrp_pack_rects (line 3936) | static void stbrp_pack_rects(stbrp_context *con, stbrp_rect *rects, int ...
function STBTT_DEF (line 3965) | STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pi...
function STBTT_DEF (line 3997) | STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc)
function STBTT_DEF (line 4003) | STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsign...
function STBTT_DEF (line 4013) | STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *sp...
function stbtt__h_prefilter (line 4020) | static void stbtt__h_prefilter(unsigned char *pixels, int w, int h, int ...
function stbtt__v_prefilter (line 4082) | static void stbtt__v_prefilter(unsigned char *pixels, int w, int h, int ...
function stbtt__oversample_shift (line 4144) | static float stbtt__oversample_shift(int oversample)
function STBTT_DEF (line 4157) | STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, c...
function STBTT_DEF (line 4192) | STBTT_DEF void stbtt_MakeGlyphBitmapSubpixelPrefilter(const stbtt_fontin...
function STBTT_DEF (line 4216) | STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *sp...
function STBTT_DEF (line 4305) | STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, st...
function STBTT_DEF (line 4310) | STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsign...
function STBTT_DEF (line 4346) | STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigne...
function STBTT_DEF (line 4358) | STBTT_DEF void stbtt_GetScaledFontVMetrics(const unsigned char *fontdata...
function STBTT_DEF (line 4371) | STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int...
function stbtt__ray_intersect_bezier (line 4406) | static int stbtt__ray_intersect_bezier(float orig[2], float ray[2], floa...
function equal (line 4470) | static int equal(float *a, float *b)
function stbtt__compute_crossings_x (line 4475) | static int stbtt__compute_crossings_x(float x, float y, int nverts, stbt...
function stbtt__cuberoot (line 4543) | static float stbtt__cuberoot( float x )
function stbtt__solve_cubic (line 4552) | static int stbtt__solve_cubic(float a, float b, float c, float* r)
function STBTT_DEF (line 4773) | STBTT_DEF void stbtt_FreeSDF(unsigned char *bitmap, void *userdata)
function stbtt_int32 (line 4784) | static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint...
function stbtt_CompareUTF8toUTF16_bigendian_internal (line 4823) | static int stbtt_CompareUTF8toUTF16_bigendian_internal(char *s1, int len...
function STBTT_DEF (line 4830) | STBTT_DEF const char *stbtt_GetFontNameString(const stbtt_fontinfo *font...
function stbtt__matchpair (line 4851) | static int stbtt__matchpair(stbtt_uint8 *fc, stbtt_uint32 nm, stbtt_uint...
function stbtt__matches (line 4898) | static int stbtt__matches(stbtt_uint8 *fc, stbtt_uint32 offset, stbtt_ui...
function stbtt_FindMatchingFont_internal (line 4927) | static int stbtt_FindMatchingFont_internal(unsigned char *font_collectio...
function STBTT_DEF (line 4943) | STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset,
function STBTT_DEF (line 4950) | STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int...
function STBTT_DEF (line 4955) | STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data)
function STBTT_DEF (line 4960) | STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *...
function STBTT_DEF (line 4965) | STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *fontdata, cons...
function STBTT_DEF (line 4970) | STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len...
FILE: test/third_party/imgui/misc/cpp/imgui_stdlib.cpp
type InputTextCallback_UserData (line 10) | struct InputTextCallback_UserData
function InputTextCallback (line 17) | static int InputTextCallback(ImGuiInputTextCallbackData* data)
FILE: test/third_party/imgui/misc/cpp/imgui_stdlib.h
function namespace (line 11) | namespace ImGui
FILE: test/third_party/imgui/misc/fonts/binary_to_compressed_c.cpp
function main (line 36) | int main(int argc, char** argv)
function Encode85Byte (line 66) | char Encode85Byte(unsigned int x)
function binary_to_compressed_c (line 72) | bool binary_to_compressed_c(const char* filename, const char* symbol, bo...
function stb_uint (line 143) | static stb_uint stb_adler32(stb_uint adler32, stb_uchar *buffer, stb_uin...
function stb_matchlen (line 174) | static unsigned int stb_matchlen(stb_uchar *m1, stb_uchar *m2, stb_uint ...
function stb__write (line 188) | static void stb__write(unsigned char v)
function stb_out2 (line 197) | static void stb_out2(stb_uint v) { stb_out(v >> 8); stb_out(v); }
function stb_out3 (line 198) | static void stb_out3(stb_uint v) { stb_out(v >> 16); stb_out(v >> 8); st...
function stb_out4 (line 199) | static void stb_out4(stb_uint v) { stb_out(v >> 24); stb_out(v >> 16); s...
function outliterals (line 201) | static void outliterals(stb_uchar *in, int numlit)
function stb_not_crap (line 223) | static int stb_not_crap(int best, int dist)
function stb_compress_chunk (line 240) | static int stb_compress_chunk(stb_uchar *history,
function stb_compress_inner (line 345) | static int stb_compress_inner(stb_uchar *input, stb_uint length)
function stb_uint (line 380) | stb_uint stb_compress(stb_uchar *out, stb_uchar *input, stb_uint length)
FILE: test/third_party/imgui/misc/freetype/imgui_freetype.cpp
function ImGuiFreeTypeDefaultFreeFunc (line 60) | static void ImGuiFreeTypeDefaultFreeFunc(void* ptr, void* user_data) { ...
type GlyphInfo (line 105) | struct GlyphInfo
type FontInfo (line 116) | struct FontInfo
type FreeTypeFont (line 128) | struct FreeTypeFont
function FT_Glyph_Metrics (line 224) | const FT_Glyph_Metrics* FreeTypeFont::LoadGlyph(uint32_t codepoint)
function FT_Bitmap (line 258) | const FT_Bitmap* FreeTypeFont::RenderGlyphAndGetInfo(GlyphInfo* out_glyp...
type ImFontBuildSrcGlyphFT (line 365) | struct ImFontBuildSrcGlyphFT
method ImFontBuildSrcGlyphFT (line 371) | ImFontBuildSrcGlyphFT() { memset((void*)this, 0, sizeof(*this)); }
type ImFontBuildSrcDataFT (line 374) | struct ImFontBuildSrcDataFT
type ImFontBuildDstDataFT (line 387) | struct ImFontBuildDstDataFT
function ImFontAtlasBuildWithFreeTypeEx (line 395) | bool ImFontAtlasBuildWithFreeTypeEx(FT_Library ft_library, ImFontAtlas* ...
function FreeType_Free (line 715) | static void FreeType_Free(FT_Memory /*memory*/, void* block)
function ImFontAtlasBuildWithFreeType (line 743) | static bool ImFontAtlasBuildWithFreeType(ImFontAtlas* atlas)
function ImFontBuilderIO (line 767) | const ImFontBuilderIO* ImGuiFreeType::GetBuilderForFreeType()
FILE: test/third_party/imgui/misc/freetype/imgui_freetype.h
type ImFontAtlas (line 9) | struct ImFontAtlas
type ImFontBuilderIO (line 10) | struct ImFontBuilderIO
type ImGuiFreeTypeBuilderFlags (line 19) | enum ImGuiFreeTypeBuilderFlags
function namespace (line 33) | namespace ImGuiFreeType
FILE: third_party/glm/common.hpp
type glm (line 20) | namespace glm
FILE: third_party/glm/detail/_noise.hpp
type glm (line 5) | namespace glm{
type detail (line 6) | namespace detail
function GLM_FUNC_QUALIFIER (line 9) | GLM_FUNC_QUALIFIER T mod289(T const& x)
function GLM_FUNC_QUALIFIER (line 15) | GLM_FUNC_QUALIFIER T permute(T const& x)
function GLM_FUNC_QUALIFIER (line 21) | GLM_FUNC_QUALIFIER vec<2, T, Q> permute(vec<2, T, Q> const& x)
function GLM_FUNC_QUALIFIER (line 27) | GLM_FUNC_QUALIFIER vec<3, T, Q> permute(vec<3, T, Q> const& x)
function GLM_FUNC_QUALIFIER (line 33) | GLM_FUNC_QUALIFIER vec<4, T, Q> permute(vec<4, T, Q> const& x)
function GLM_FUNC_QUALIFIER (line 39) | GLM_FUNC_QUALIFIER T taylorInvSqrt(T const& r)
function GLM_FUNC_QUALIFIER (line 45) | GLM_FUNC_QUALIFIER vec<2, T, Q> taylorInvSqrt(vec<2, T, Q> const& r)
function GLM_FUNC_QUALIFIER (line 51) | GLM_FUNC_QUALIFIER vec<3, T, Q> taylorInvSqrt(vec<3, T, Q> const& r)
function GLM_FUNC_QUALIFIER (line 57) | GLM_FUNC_QUALIFIER vec<4, T, Q> taylorInvSqrt(vec<4, T, Q> const& r)
function GLM_FUNC_QUALIFIER (line 63) | GLM_FUNC_QUALIFIER vec<2, T, Q> fade(vec<2, T, Q> const& t)
function GLM_FUNC_QUALIFIER (line 69) | GLM_FUNC_QUALIFIER vec<3, T, Q> fade(vec<3, T, Q> const& t)
function GLM_FUNC_QUALIFIER (line 75) | GLM_FUNC_QUALIFIER vec<4, T, Q> fade(vec<4, T, Q> const& t)
FILE: third_party/glm/detail/_swizzle.hpp
type glm (line 3) | namespace glm{
type detail (line 4) | namespace detail
type _swizzle_base0 (line 8) | struct _swizzle_base0
method GLM_FUNC_QUALIFIER (line 11) | GLM_FUNC_QUALIFIER T& elem(size_t i){ return (reinterpret_cast<T*>...
method GLM_FUNC_QUALIFIER (line 12) | GLM_FUNC_QUALIFIER T const& elem(size_t i) const{ return (reinterp...
type _swizzle_base1 (line 21) | struct _swizzle_base1 : public _swizzle_base0<T, N>
type _swizzle_base1<2, T, Q, E0,E1,-1,-2, Aligned> (line 26) | struct _swizzle_base1<2, T, Q, E0,E1,-1,-2, Aligned> : public _swizz...
method GLM_FUNC_QUALIFIER (line 28) | GLM_FUNC_QUALIFIER vec<2, T, Q> operator ()() const { return vec<...
type _swizzle_base1<3, T, Q, E0,E1,E2,-1, Aligned> (line 32) | struct _swizzle_base1<3, T, Q, E0,E1,E2,-1, Aligned> : public _swizz...
method GLM_FUNC_QUALIFIER (line 34) | GLM_FUNC_QUALIFIER vec<3, T, Q> operator ()() const { return vec<...
type _swizzle_base1<4, T, Q, E0,E1,E2,E3, Aligned> (line 38) | struct _swizzle_base1<4, T, Q, E0,E1,E2,E3, Aligned> : public _swizz...
method GLM_FUNC_QUALIFIER (line 40) | GLM_FUNC_QUALIFIER vec<4, T, Q> operator ()() const { return vec<...
type _swizzle_base2 (line 55) | struct _swizzle_base2 : public _swizzle_base1<N, T, Q, E0,E1,E2,E3, ...
type op_equal (line 57) | struct op_equal
method GLM_FUNC_QUALIFIER (line 59) | GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e = t; }
type op_minus (line 62) | struct op_minus
method GLM_FUNC_QUALIFIER (line 64) | GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e -= t; }
type op_plus (line 67) | struct op_plus
method GLM_FUNC_QUALIFIER (line 69) | GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e += t; }
type op_mul (line 72) | struct op_mul
method GLM_FUNC_QUALIFIER (line 74) | GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e *= t; }
type op_div (line 77) | struct op_div
method GLM_FUNC_QUALIFIER (line 79) | GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e /= t; }
method GLM_FUNC_QUALIFIER (line 83) | GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const T& t)
method GLM_FUNC_QUALIFIER (line 90) | GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec<N, T, Q> const& ...
method GLM_FUNC_QUALIFIER (line 96) | GLM_FUNC_QUALIFIER void operator -= (vec<N, T, Q> const& that)
method GLM_FUNC_QUALIFIER (line 101) | GLM_FUNC_QUALIFIER void operator += (vec<N, T, Q> const& that)
method GLM_FUNC_QUALIFIER (line 106) | GLM_FUNC_QUALIFIER void operator *= (vec<N, T, Q> const& that)
method GLM_FUNC_QUALIFIER (line 111) | GLM_FUNC_QUALIFIER void operator /= (vec<N, T, Q> const& that)
method GLM_FUNC_QUALIFIER (line 116) | GLM_FUNC_QUALIFIER T& operator[](size_t i)
method GLM_FUNC_QUALIFIER (line 121) | GLM_FUNC_QUALIFIER T operator[](size_t i) const
method GLM_FUNC_QUALIFIER (line 129) | GLM_FUNC_QUALIFIER void _apply_op(vec<N, T, Q> const& that, const ...
type _swizzle_base2<N, T, Q, E0,E1,E2,E3, 1> (line 144) | struct _swizzle_base2<N, T, Q, E0,E1,E2,E3, 1> : public _swizzle_bas...
type Stub (line 146) | struct Stub {}
method GLM_FUNC_QUALIFIER (line 148) | GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const&) { retur...
method GLM_FUNC_QUALIFIER (line 150) | GLM_FUNC_QUALIFIER T operator[] (size_t i) const
type _swizzle (line 158) | struct _swizzle : public _swizzle_base2<N, T, Q, E0, E1, E2, E3, (E0...
method GLM_FUNC_QUALIFIER (line 164) | GLM_FUNC_QUALIFIER operator vec<N, T, Q> () const { return (*this)...
FILE: third_party/glm/detail/_vectorize.hpp
type glm (line 3) | namespace glm{
type detail (line 4) | namespace detail
type functor1 (line 7) | struct functor1{}
type functor1<vec, 1, R, T, Q> (line 10) | struct functor1<vec, 1, R, T, Q>
method call (line 12) | static vec<1, R, Q> call(R (*Func) (T x), vec<1, T, Q> const& v)
type functor1<vec, 2, R, T, Q> (line 19) | struct functor1<vec, 2, R, T, Q>
method call (line 21) | static vec<2, R, Q> call(R (*Func) (T x), vec<2, T, Q> const& v)
type functor1<vec, 3, R, T, Q> (line 28) | struct functor1<vec, 3, R, T, Q>
method call (line 30) | static vec<3, R, Q> call(R (*Func) (T x), vec<3, T, Q> const& v)
type functor1<vec, 4, R, T, Q> (line 37) | struct functor1<vec, 4, R, T, Q>
method call (line 39) | static vec<4, R, Q> call(R (*Func) (T x), vec<4, T, Q> const& v)
type functor2 (line 46) | struct functor2{}
type functor2<vec, 1, T, Q> (line 49) | struct functor2<vec, 1, T, Q>
method call (line 51) | call(T (*Func) (T x, T y), vec<1, T, Q> const& a, vec<1, T, Q> con...
type functor2<vec, 2, T, Q> (line 58) | struct functor2<vec, 2, T, Q>
method call (line 60) | call(T (*Func) (T x, T y), vec<2, T, Q> const& a, vec<2, T, Q> con...
type functor2<vec, 3, T, Q> (line 67) | struct functor2<vec, 3, T, Q>
method call (line 69) | call(T (*Func) (T x, T y), vec<3, T, Q> const& a, vec<3, T, Q> con...
type functor2<vec, 4, T, Q> (line 76) | struct functor2<vec, 4, T, Q>
method call (line 78) | call(T (*Func) (T x, T y), vec<4, T, Q> const& a, vec<4, T, Q> con...
type functor2_vec_sca (line 85) | struct functor2_vec_sca{}
type functor2_vec_sca<vec, 1, T, Q> (line 88) | struct functor2_vec_sca<vec, 1, T, Q>
method call (line 90) | call(T (*Func) (T x, T y), vec<1, T, Q> const& a, T b)
type functor2_vec_sca<vec, 2, T, Q> (line 97) | struct functor2_vec_sca<vec, 2, T, Q>
method call (line 99) | call(T (*Func) (T x, T y), vec<2, T, Q> const& a, T b)
type functor2_vec_sca<vec, 3, T, Q> (line 106) | struct functor2_vec_sca<vec, 3, T, Q>
method call (line 108) | call(T (*Func) (T x, T y), vec<3, T, Q> const& a, T b)
type functor2_vec_sca<vec, 4, T, Q> (line 115) | struct functor2_vec_sca<vec, 4, T, Q>
method call (line 117) | call(T (*Func) (T x, T y), vec<4, T, Q> const& a, T b)
type functor2_vec_int (line 124) | struct functor2_vec_int {}
type functor2_vec_int<1, T, Q> (line 127) | struct functor2_vec_int<1, T, Q>
method call (line 129) | call(int (*Func) (T x, int y), vec<1, T, Q> const& a, vec<1, int, ...
type functor2_vec_int<2, T, Q> (line 136) | struct functor2_vec_int<2, T, Q>
method call (line 138) | call(int (*Func) (T x, int y), vec<2, T, Q> const& a, vec<2, int, ...
type functor2_vec_int<3, T, Q> (line 145) | struct functor2_vec_int<3, T, Q>
method call (line 147) | call(int (*Func) (T x, int y), vec<3, T, Q> const& a, vec<3, int, ...
type functor2_vec_int<4, T, Q> (line 154) | struct functor2_vec_int<4, T, Q>
method call (line 156) | call(int (*Func) (T x, int y), vec<4, T, Q> const& a, vec<4, int, ...
FILE: third_party/glm/detail/compute_common.hpp
type glm (line 6) | namespace glm{
type detail (line 7) | namespace detail
type compute_abs (line 10) | struct compute_abs
type compute_abs<genFIType, true> (line 14) | struct compute_abs<genFIType, true>
method genFIType (line 16) | static genFIType call(genFIType x)
type compute_abs<float, true> (line 29) | struct compute_abs<float, true>
method call (line 31) | static float call(float x)
type compute_abs<genFIType, false> (line 39) | struct compute_abs<genFIType, false>
method genFIType (line 41) | static genFIType call(genFIType x)
FILE: third_party/glm/detail/compute_vector_relational.hpp
type glm (line 7) | namespace glm{
type detail (line 8) | namespace detail
type compute_equal (line 11) | struct compute_equal
method call (line 13) | static bool call(T a, T b)
FILE: third_party/glm/detail/glm.cpp
type glm (line 14) | namespace glm
type vec<1, uint8, lowp> (line 17) | struct vec<1, uint8, lowp>
type vec<1, uint16, lowp> (line 18) | struct vec<1, uint16, lowp>
type vec<1, uint32, lowp> (line 19) | struct vec<1, uint32, lowp>
type vec<1, uint64, lowp> (line 20) | struct vec<1, uint64, lowp>
type vec<1, int8, lowp> (line 21) | struct vec<1, int8, lowp>
type vec<1, int16, lowp> (line 22) | struct vec<1, int16, lowp>
type vec<1, int32, lowp> (line 23) | struct vec<1, int32, lowp>
type vec<1, int64, lowp> (line 24) | struct vec<1, int64, lowp>
type vec<1, float32, lowp> (line 25) | struct vec<1, float32, lowp>
type vec<1, float64, lowp> (line 26) | struct vec<1, float64, lowp>
type vec<1, uint8, mediump> (line 28) | struct vec<1, uint8, mediump>
type vec<1, uint16, mediump> (line 29) | struct vec<1, uint16, mediump>
type vec<1, uint32, mediump> (line 30) | struct vec<1, uint32, mediump>
type vec<1, uint64, mediump> (line 31) | struct vec<1, uint64, mediump>
type vec<1, int8, mediump> (line 32) | struct vec<1, int8, mediump>
type vec<1, int16, mediump> (line 33) | struct vec<1, int16, mediump>
type vec<1, int32, mediump> (line 34) | struct vec<1, int32, mediump>
type vec<1, int64, mediump> (line 35) | struct vec<1, int64, mediump>
type vec<1, float32, mediump> (line 36) | struct vec<1, float32, mediump>
type vec<1, float64, mediump> (line 37) | struct vec<1, float64, mediump>
type vec<1, uint8, highp> (line 39) | struct vec<1, uint8, highp>
type vec<1, uint16, highp> (line 40) | struct vec<1, uint16, highp>
type vec<1, uint32, highp> (line 41) | struct vec<1, uint32, highp>
type vec<1, uint64, highp> (line 42) | struct vec<1, uint64, highp>
type vec<1, int8, highp> (line 43) | struct vec<1, int8, highp>
type vec<1, int16, highp> (line 44) | struct vec<1, int16, highp>
type vec<1, int32, highp> (line 45) | struct vec<1, int32, highp>
type vec<1, int64, highp> (line 46) | struct vec<1, int64, highp>
type vec<1, float32, highp> (line 47) | struct vec<1, float32, highp>
type vec<1, float64, highp> (line 48) | struct vec<1, float64, highp>
type vec<2, uint8, lowp> (line 51) | struct vec<2, uint8, lowp>
type vec<2, uint16, lowp> (line 52) | struct vec<2, uint16, lowp>
type vec<2, uint32, lowp> (line 53) | struct vec<2, uint32, lowp>
type vec<2, uint64, lowp> (line 54) | struct vec<2, uint64, lowp>
type vec<2, int8, lowp> (line 55) | struct vec<2, int8, lowp>
type vec<2, int16, lowp> (line 56) | struct vec<2, int16, lowp>
type vec<2, int32, lowp> (line 57) | struct vec<2, int32, lowp>
type vec<2, int64, lowp> (line 58) | struct vec<2, int64, lowp>
type vec<2, float32, lowp> (line 59) | struct vec<2, float32, lowp>
type vec<2, float64, lowp> (line 60) | struct vec<2, float64, lowp>
type vec<2, uint8, mediump> (line 62) | struct vec<2, uint8, mediump>
type vec<2, uint16, mediump> (line 63) | struct vec<2, uint16, mediump>
type vec<2, uint32, mediump> (line 64) | struct vec<2, uint32, mediump>
type vec<2, uint64, mediump> (line 65) | struct vec<2, uint64, mediump>
type vec<2, int8, mediump> (line 66) | struct vec<2, int8, mediump>
type vec<2, int16, mediump> (line 67) | struct vec<2, int16, mediump>
type vec<2, int32, mediump> (line 68) | struct vec<2, int32, mediump>
type vec<2, int64, mediump> (line 69) | struct vec<2, int64, mediump>
type vec<2, float32, mediump> (line 70) | struct vec<2, float32, mediump>
type vec<2, float64, mediump> (line 71) | struct vec<2, float64, mediump>
type vec<2, uint8, highp> (line 73) | struct vec<2, uint8, highp>
type vec<2, uint16, highp> (line 74) | struct vec<2, uint16, highp>
type vec<2, uint32, highp> (line 75) | struct vec<2, uint32, highp>
type vec<2, uint64, highp> (line 76) | struct vec<2, uint64, highp>
type vec<2, int8, highp> (line 77) | struct vec<2, int8, highp>
type vec<2, int16, highp> (line 78) | struct vec<2, int16, highp>
type vec<2, int32, highp> (line 79) | struct vec<2, int32, highp>
type vec<2, int64, highp> (line 80) | struct vec<2, int64, highp>
type vec<2, float32, highp> (line 81) | struct vec<2, float32, highp>
type vec<2, float64, highp> (line 82) | struct vec<2, float64, highp>
type vec<3, uint8, lowp> (line 85) | struct vec<3, uint8, lowp>
type vec<3, uint16, lowp> (line 86) | struct vec<3, uint16, lowp>
type vec<3, uint32, lowp> (line 87) | struct vec<3, uint32, lowp>
type vec<3, uint64, lowp> (line 88) | struct vec<3, uint64, lowp>
type vec<3, int8, lowp> (line 89) | struct vec<3, int8, lowp>
type vec<3, int16, lowp> (line 90) | struct vec<3, int16, lowp>
type vec<3, int32, lowp> (line 91) | struct vec<3, int32, lowp>
type vec<3, int64, lowp> (line 92) | struct vec<3, int64, lowp>
type vec<3, float32, lowp> (line 93) | struct vec<3, float32, lowp>
type vec<3, float64, lowp> (line 94) | struct vec<3, float64, lowp>
type vec<3, uint8, mediump> (line 96) | struct vec<3, uint8, mediump>
type vec<3, uint16, mediump> (line 97) | struct vec<3, uint16, mediump>
type vec<3, uint32, mediump> (line 98) | struct vec<3, uint32, mediump>
type vec<3, uint64, mediump> (line 99) | struct vec<3, uint64, mediump>
type vec<3, int8, mediump> (line 100) | struct vec<3, int8, mediump>
type vec<3, int16, mediump> (line 101) | struct vec<3, int16, mediump>
type vec<3, int32, mediump> (line 102) | struct vec<3, int32, mediump>
type vec<3, int64, mediump> (line 103) | struct vec<3, int64, mediump>
type vec<3, float32, mediump> (line 104) | struct vec<3, float32, mediump>
type vec<3, float64, mediump> (line 105) | struct vec<3, float64, mediump>
type vec<3, uint8, highp> (line 107) | struct vec<3, uint8, highp>
type vec<3, uint16, highp> (line 108) | struct vec<3, uint16, highp>
type vec<3, uint32, highp> (line 109) | struct vec<3, uint32, highp>
type vec<3, uint64, highp> (line 110) | struct vec<3, uint64, highp>
type vec<3, int8, highp> (line 111) | struct vec<3, int8, highp>
type vec<3, int16, highp> (line 112) | struct vec<3, int16, highp>
type vec<3, int32, highp> (line 113) | struct vec<3, int32, highp>
type vec<3, int64, highp> (line 114) | struct vec<3, int64, highp>
type vec<3, float32, highp> (line 115) | struct vec<3, float32, highp>
type vec<3, float64, highp> (line 116) | struct vec<3, float64, highp>
type vec<4, uint8, lowp> (line 119) | struct vec<4, uint8, lowp>
type vec<4, uint16, lowp> (line 120) | struct vec<4, uint16, lowp>
type vec<4, uint32, lowp> (line 121) | struct vec<4, uint32, lowp>
type vec<4, uint64, lowp> (line 122) | struct vec<4, uint64, lowp>
type vec<4, int8, lowp> (line 123) | struct vec<4, int8, lowp>
type vec<4, int16, lowp> (line 124) | struct vec<4, int16, lowp>
type vec<4, int32, lowp> (line 125) | struct vec<4, int32, lowp>
type vec<4, int64, lowp> (line 126) | struct vec<4, int64, lowp>
type vec<4, float32, lowp> (line 127) | struct vec<4, float32, lowp>
type vec<4, float64, lowp> (line 128) | struct vec<4, float64, lowp>
type vec<4, uint8, mediump> (line 130) | struct vec<4, uint8, mediump>
type vec<4, uint16, mediump> (line 131) | struct vec<4, uint16, mediump>
type vec<4, uint32, mediump> (line 132) | struct vec<4, uint32, mediump>
type vec<4, uint64, mediump> (line 133) | struct vec<4, uint64, mediump>
type vec<4, int8, mediump> (line 134) | struct vec<4, int8, mediump>
type vec<4, int16, mediump> (line 135) | struct vec<4, int16, mediump>
type vec<4, int32, mediump> (line 136) | struct vec<4, int32, mediump>
type vec<4, int64, mediump> (line 137) | struct vec<4, int64, mediump>
type vec<4, float32, mediump> (line 138) | struct vec<4, float32, mediump>
type vec<4, float64, mediump> (line 139) | struct vec<4, float64, mediump>
type vec<4, uint8, highp> (line 141) | struct vec<4, uint8, highp>
type vec<4, uint16, highp> (line 142) | struct vec<4, uint16, highp>
type vec<4, uint32, highp> (line 143) | struct vec<4, uint32, highp>
type vec<4, uint64, highp> (line 144) | struct vec<4, uint64, highp>
type vec<4, int8, highp> (line 145) | struct vec<4, int8, highp>
type vec<4, int16, highp> (line 146) | struct vec<4, int16, highp>
type vec<4, int32, highp> (line 147) | struct vec<4, int32, highp>
type vec<4, int64, highp> (line 148) | struct vec<4, int64, highp>
type vec<4, float32, highp> (line 149) | struct vec<4, float32, highp>
type vec<4, float64, highp> (line 150) | struct vec<4, float64, highp>
type mat<2, 2, float32, lowp> (line 153) | struct mat<2, 2, float32, lowp>
type mat<2, 2, float64, lowp> (line 154) | struct mat<2, 2, float64, lowp>
type mat<2, 2, float32, mediump> (line 156) | struct mat<2, 2, float32, mediump>
type mat<2, 2, float64, mediump> (line 157) | struct mat<2, 2, float64, mediump>
type mat<2, 2, float32, highp> (line 159) | struct mat<2, 2, float32, highp>
type mat<2, 2, float64, highp> (line 160) | struct mat<2, 2, float64, highp>
type mat<2, 3, float32, lowp> (line 163) | struct mat<2, 3, float32, lowp>
type mat<2, 3, float64, lowp> (line 164) | struct mat<2, 3, float64, lowp>
type mat<2, 3, float32, mediump> (line 166) | struct mat<2, 3, float32, mediump>
type mat<2, 3, float64, mediump> (line 167) | struct mat<2, 3, float64, mediump>
type mat<2, 3, float32, highp> (line 169) | struct mat<2, 3, float32, highp>
type mat<2, 3, float64, highp> (line 170) | struct mat<2, 3, float64, highp>
type mat<2, 4, float32, lowp> (line 173) | struct mat<2, 4, float32, lowp>
type mat<2, 4, float64, lowp> (line 174) | struct mat<2, 4, float64, lowp>
type mat<2, 4, float32, mediump> (line 176) | struct mat<2, 4, float32, mediump>
type mat<2, 4, float64, mediump> (line 177) | struct mat<2, 4, float64, mediump>
type mat<2, 4, float32, highp> (line 179) | struct mat<2, 4, float32, highp>
type mat<2, 4, float64, highp> (line 180) | struct mat<2, 4, float64, highp>
type mat<3, 2, float32, lowp> (line 183) | struct mat<3, 2, float32, lowp>
type mat<3, 2, float64, lowp> (line 184) | struct mat<3, 2, float64, lowp>
type mat<3, 2, float32, mediump> (line 186) | struct mat<3, 2, float32, mediump>
type mat<3, 2, float64, mediump> (line 187) | struct mat<3, 2, float64, mediump>
type mat<3, 2, float32, highp> (line 189) | struct mat<3, 2, float32, highp>
type mat<3, 2, float64, highp> (line 190) | struct mat<3, 2, float64, highp>
type mat<3, 3, float32, lowp> (line 193) | struct mat<3, 3, float32, lowp>
type mat<3, 3, float64, lowp> (line 194) | struct mat<3, 3, float64, lowp>
type mat<3, 3, float32, mediump> (line 196) | struct mat<3, 3, float32, mediump>
type mat<3, 3, float64, mediump> (line 197) | struct mat<3, 3, float64, mediump>
type mat<3, 3, float32, highp> (line 199) | struct mat<3, 3, float32, highp>
type mat<3, 3, float64, highp> (line 200) | struct mat<3, 3, float64, highp>
type mat<3, 4, float32, lowp> (line 203) | struct mat<3, 4, float32, lowp>
type mat<3, 4, float64, lowp> (line 204) | struct mat<3, 4, float64, lowp>
type mat<3, 4, float32, mediump> (line 206) | struct mat<3, 4, float32, mediump>
type mat<3, 4, float64, mediump> (line 207) | struct mat<3, 4, float64, mediump>
type mat<3, 4, float32, highp> (line 209) | struct mat<3, 4, float32, highp>
type mat<3, 4, float64, highp> (line 210) | struct mat<3, 4, float64, highp>
type mat<4, 2, float32, lowp> (line 213) | struct mat<4, 2, float32, lowp>
type mat<4, 2, float64, lowp> (line 214) | struct mat<4, 2, float64, lowp>
type mat<4, 2, float32, mediump> (line 216) | struct mat<4, 2, float32, mediump>
type mat<4, 2, float64, mediump> (line 217) | struct mat<4, 2, float64, mediump>
type mat<4, 2, float32, highp> (line 219) | struct mat<4, 2, float32, highp>
type mat<4, 2, float64, highp> (line 220) | struct mat<4, 2, float64, highp>
type mat<4, 3, float32, lowp> (line 223) | struct mat<4, 3, float32, lowp>
type mat<4, 3, float64, lowp> (line 224) | struct mat<4, 3, float64, lowp>
type mat<4, 3, float32, mediump> (line 226) | struct mat<4, 3, float32, mediump>
type mat<4, 3, float64, mediump> (line 227) | struct mat<4, 3, float64, mediump>
type mat<4, 3, float32, highp> (line 229) | struct mat<4, 3, float32, highp>
type mat<4, 3, float64, highp> (line 230) | struct mat<4, 3, float64, highp>
type mat<4, 4, float32, lowp> (line 233) | struct mat<4, 4, float32, lowp>
type mat<4, 4, float64, lowp> (line 234) | struct mat<4, 4, float64, lowp>
type mat<4, 4, float32, mediump> (line 236) | struct mat<4, 4, float32, mediump>
type mat<4, 4, float64, mediump> (line 237) | struct mat<4, 4, float64, mediump>
type mat<4, 4, float32, highp> (line 239) | struct mat<4, 4, float32, highp>
type mat<4, 4, float64, highp> (line 240) | struct mat<4, 4, float64, highp>
type qua<float32, lowp> (line 243) | struct qua<float32, lowp>
type qua<float64, lowp> (line 244) | struct qua<float64, lowp>
type qua<float32, mediump> (line 246) | struct qua<float32, mediump>
type qua<float64, mediump> (line 247) | struct qua<float64, mediump>
type qua<float32, highp> (line 249) | struct qua<float32, highp>
type qua<float64, highp> (line 250) | struct qua<float64, highp>
type tdualquat<float32, lowp> (line 253) | struct tdualquat<float32, lowp>
type tdualquat<float64, lowp> (line 254) | struct tdualquat<float64, lowp>
type tdualquat<float32, mediump> (line 256) | struct tdualquat<float32, mediump>
type tdualquat<float64, mediump> (line 257) | struct tdualquat<float64, mediump>
type tdualquat<float32, highp> (line 259) | struct tdualquat<float32, highp>
type tdualquat<float64, highp> (line 260) | struct tdualquat<float64, highp>
FILE: third_party/glm/detail/qualifier.hpp
type glm (line 5) | namespace glm
type qualifier (line 8) | enum qualifier
type vec (line 35) | struct vec
type mat (line 36) | struct mat
type qua (line 37) | struct qua
type detail (line 56) | namespace detail
type is_aligned (line 59) | struct is_aligned
type is_aligned<glm::aligned_lowp> (line 66) | struct is_aligned<glm::aligned_lowp>
type is_aligned<glm::aligned_mediump> (line 72) | struct is_aligned<glm::aligned_mediump>
type is_aligned<glm::aligned_highp> (line 78) | struct is_aligned<glm::aligned_highp>
type storage (line 85) | struct storage
type type (line 87) | struct type {
type storage<L, T, true> (line 94) | struct storage<L, T, true>
type type (line 96) | struct alignas(L * sizeof(T)) type {
type storage<3, T, true> (line 102) | struct storage<3, T, true>
type type (line 104) | struct alignas(4 * sizeof(T)) type {
type storage<4, float, true> (line 112) | struct storage<4, float, true>
type storage<4, int, true> (line 118) | struct storage<4, int, true>
type storage<4, unsigned int, true> (line 124) | struct storage<4, unsigned int, true>
type storage<2, double, true> (line 130) | struct storage<2, double, true>
type storage<2, detail::int64, true> (line 136) | struct storage<2, detail::int64, true>
type storage<2, detail::uint64, true> (line 142) | struct storage<2, detail::uint64, true>
type storage<4, double, true> (line 150) | struct storage<4, double, true>
type storage<4, detail::int64, true> (line 158) | struct storage<4, detail::int64, true>
type storage<4, detail::uint64, true> (line 164) | struct storage<4, detail::uint64, true>
type storage<4, float, true> (line 172) | struct storage<4, float, true>
type storage<4, int, true> (line 178) | struct storage<4, int, true>
type storage<4, unsigned int, true> (line 184) | struct storage<4, unsigned int, true>
type genTypeEnum (line 190) | enum genTypeEnum
type genTypeTrait (line 198) | struct genTypeTrait
type genTypeTrait<mat<C, R, T> > (line 202) | struct genTypeTrait<mat<C, R, T> >
type init_gentype (line 208) | struct init_gentype
type init_gentype<genType, GENTYPE_QUAT> (line 213) | struct init_gentype<genType, GENTYPE_QUAT>
method genType (line 215) | static genType identity()
type init_gentype<genType, GENTYPE_MAT> (line 222) | struct init_gentype<genType, GENTYPE_MAT>
method genType (line 224) | static genType identity()
FILE: third_party/glm/detail/setup.hpp
type glm (line 541) | namespace glm {
type std (line 542) | namespace std {
function countof (line 608) | constexpr std::size_t countof(T const (&)[N])
type detail (line 628) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<long> (line 733) | struct make_unsigned<long>
type make_unsigned<int64> (line 739) | struct make_unsigned<int64>
type make_unsigned<unsigned char> (line 745) | struct make_unsigned<unsigned char>
type make_unsigned<unsigned short> (line 751) | struct make_unsigned<unsigned short>
type make_unsigned<unsigned int> (line 757) | struct make_unsigned<unsigned int>
type make_unsigned<unsigned long> (line 763) | struct make_unsigned<unsigned long>
type make_unsigned<uint64> (line 769) | struct make_unsigned<uint64>
type detail (line 660) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<long> (line 733) | struct make_unsigned<long>
type make_unsigned<int64> (line 739) | struct make_unsigned<int64>
type make_unsigned<unsigned char> (line 745) | struct make_unsigned<unsigned char>
type make_unsigned<unsigned short> (line 751) | struct make_unsigned<unsigned short>
type make_unsigned<unsigned int> (line 757) | struct make_unsigned<unsigned int>
type make_unsigned<unsigned long> (line 763) | struct make_unsigned<unsigned long>
type make_unsigned<uint64> (line 769) | struct make_unsigned<uint64>
type detail (line 693) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<long> (line 733) | struct make_unsigned<long>
type make_unsigned<int64> (line 739) | struct make_unsigned<int64>
type make_unsigned<unsigned char> (line 745) | struct make_unsigned<unsigned char>
type make_unsigned<unsigned short> (line 751) | struct make_unsigned<unsigned short>
type make_unsigned<unsigned int> (line 757) | struct make_unsigned<unsigned int>
type make_unsigned<unsigned long> (line 763) | struct make_unsigned<unsigned long>
type make_unsigned<uint64> (line 769) | struct make_unsigned<uint64>
type detail (line 702) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<long> (line 733) | struct make_unsigned<long>
type make_unsigned<int64> (line 739) | struct make_unsigned<int64>
type make_unsigned<unsigned char> (line 745) | struct make_unsigned<unsigned char>
type make_unsigned<unsigned short> (line 751) | struct make_unsigned<unsigned short>
type make_unsigned<unsigned int> (line 757) | struct make_unsigned<unsigned int>
type make_unsigned<unsigned long> (line 763) | struct make_unsigned<unsigned long>
type make_unsigned<uint64> (line 769) | struct make_unsigned<uint64>
type glm (line 589) | namespace glm
type std (line 542) | namespace std {
function countof (line 608) | constexpr std::size_t countof(T const (&)[N])
type detail (line 628) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<long> (line 733) | struct make_unsigned<long>
type make_unsigned<int64> (line 739) | struct make_unsigned<int64>
type make_unsigned<unsigned char> (line 745) | struct make_unsigned<unsigned char>
type make_unsigned<unsigned short> (line 751) | struct make_unsigned<unsigned short>
type make_unsigned<unsigned int> (line 757) | struct make_unsigned<unsigned int>
type make_unsigned<unsigned long> (line 763) | struct make_unsigned<unsigned long>
type make_unsigned<uint64> (line 769) | struct make_unsigned<uint64>
type detail (line 660) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<long> (line 733) | struct make_unsigned<long>
type make_unsigned<int64> (line 739) | struct make_unsigned<int64>
type make_unsigned<unsigned char> (line 745) | struct make_unsigned<unsigned char>
type make_unsigned<unsigned short> (line 751) | struct make_unsigned<unsigned short>
type make_unsigned<unsigned int> (line 757) | struct make_unsigned<unsigned int>
type make_unsigned<unsigned long> (line 763) | struct make_unsigned<unsigned long>
type make_unsigned<uint64> (line 769) | struct make_unsigned<uint64>
type detail (line 693) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<long> (line 733) | struct make_unsigned<long>
type make_unsigned<int64> (line 739) | struct make_unsigned<int64>
type make_unsigned<unsigned char> (line 745) | struct make_unsigned<unsigned char>
type make_unsigned<unsigned short> (line 751) | struct make_unsigned<unsigned short>
type make_unsigned<unsigned int> (line 757) | struct make_unsigned<unsigned int>
type make_unsigned<unsigned long> (line 763) | struct make_unsigned<unsigned long>
type make_unsigned<uint64> (line 769) | struct make_unsigned<uint64>
type detail (line 702) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<long> (line 733) | struct make_unsigned<long>
type make_unsigned<int64> (line 739) | struct make_unsigned<int64>
type make_unsigned<unsigned char> (line 745) | struct make_unsigned<unsigned char>
type make_unsigned<unsigned short> (line 751) | struct make_unsigned<unsigned short>
type make_unsigned<unsigned int> (line 757) | struct make_unsigned<unsigned int>
type make_unsigned<unsigned long> (line 763) | struct make_unsigned<unsigned long>
type make_unsigned<uint64> (line 769) | struct make_unsigned<uint64>
type glm (line 605) | namespace glm
type std (line 542) | namespace std {
function countof (line 608) | constexpr std::size_t countof(T const (&)[N])
type detail (line 628) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<long> (line 733) | struct make_unsigned<long>
type make_unsigned<int64> (line 739) | struct make_unsigned<int64>
type make_unsigned<unsigned char> (line 745) | struct make_unsigned<unsigned char>
type make_unsigned<unsigned short> (line 751) | struct make_unsigned<unsigned short>
type make_unsigned<unsigned int> (line 757) | struct make_unsigned<unsigned int>
type make_unsigned<unsigned long> (line 763) | struct make_unsigned<unsigned long>
type make_unsigned<uint64> (line 769) | struct make_unsigned<uint64>
type detail (line 660) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<long> (line 733) | struct make_unsigned<long>
type make_unsigned<int64> (line 739) | struct make_unsigned<int64>
type make_unsigned<unsigned char> (line 745) | struct make_unsigned<unsigned char>
type make_unsigned<unsigned short> (line 751) | struct make_unsigned<unsigned short>
type make_unsigned<unsigned int> (line 757) | struct make_unsigned<unsigned int>
type make_unsigned<unsigned long> (line 763) | struct make_unsigned<unsigned long>
type make_unsigned<uint64> (line 769) | struct make_unsigned<uint64>
type detail (line 693) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<long> (line 733) | struct make_unsigned<long>
type make_unsigned<int64> (line 739) | struct make_unsigned<int64>
type make_unsigned<unsigned char> (line 745) | struct make_unsigned<unsigned char>
type make_unsigned<unsigned short> (line 751) | struct make_unsigned<unsigned short>
type make_unsigned<unsigned int> (line 757) | struct make_unsigned<unsigned int>
type make_unsigned<unsigned long> (line 763) | struct make_unsigned<unsigned long>
type make_unsigned<uint64> (line 769) | struct make_unsigned<uint64>
type detail (line 702) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<long> (line 733) | struct make_unsigned<long>
type make_unsigned<int64> (line 739) | struct make_unsigned<int64>
type make_unsigned<unsigned char> (line 745) | struct make_unsigned<unsigned char>
type make_unsigned<unsigned short> (line 751) | struct make_unsigned<unsigned short>
type make_unsigned<unsigned int> (line 757) | struct make_unsigned<unsigned int>
type make_unsigned<unsigned long> (line 763) | struct make_unsigned<unsigned long>
type make_unsigned<uint64> (line 769) | struct make_unsigned<uint64>
type glm (line 627) | namespace glm{
type std (line 542) | namespace std {
function countof (line 608) | constexpr std::size_t countof(T const (&)[N])
type detail (line 628) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<long> (line 733) | struct make_unsigned<long>
type make_unsigned<int64> (line 739) | struct make_unsigned<int64>
type make_unsigned<unsigned char> (line 745) | struct make_unsigned<unsigned char>
type make_unsigned<unsigned short> (line 751) | struct make_unsigned<unsigned short>
type make_unsigned<unsigned int> (line 757) | struct make_unsigned<unsigned int>
type make_unsigned<unsigned long> (line 763) | struct make_unsigned<unsigned long>
type make_unsigned<uint64> (line 769) | struct make_unsigned<uint64>
type detail (line 660) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<long> (line 733) | struct make_unsigned<long>
type make_unsigned<int64> (line 739) | struct make_unsigned<int64>
type make_unsigned<unsigned char> (line 745) | struct make_unsigned<unsigned char>
type make_unsigned<unsigned short> (line 751) | struct make_unsigned<unsigned short>
type make_unsigned<unsigned int> (line 757) | struct make_unsigned<unsigned int>
type make_unsigned<unsigned long> (line 763) | struct make_unsigned<unsigned long>
type make_unsigned<uint64> (line 769) | struct make_unsigned<uint64>
type detail (line 693) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<long> (line 733) | struct make_unsigned<long>
type make_unsigned<int64> (line 739) | struct make_unsigned<int64>
type make_unsigned<unsigned char> (line 745) | struct make_unsigned<unsigned char>
type make_unsigned<unsigned short> (line 751) | struct make_unsigned<unsigned short>
type make_unsigned<unsigned int> (line 757) | struct make_unsigned<unsigned int>
type make_unsigned<unsigned long> (line 763) | struct make_unsigned<unsigned long>
type make_unsigned<uint64> (line 769) | struct make_unsigned<uint64>
type detail (line 702) | namespace detail
type is_int (line 631) | struct is_int
type test (line 633) | enum test {value = 0}
type is_int<unsigned int> (line 637) | struct is_int<unsigned int>
type test (line 639) | enum test {value = ~0}
type is_int<signed int> (line 643) | struct is_int<signed int>
type test (line 645) | enum test {value = ~0}
type make_unsigned (line 705) | struct make_unsigned
type make_unsigned<char> (line 709) | struct make_unsigned<char>
type make_unsigned<signed char> (line 715) | struct make_unsigned<signed char>
type make_unsigned<short> (line 721) | struct make_unsigned<short>
type make_unsigned<int> (line 727) | struct make_unsigned<int>
type make_unsigned<lon
Condensed preview — 575 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (6,399K chars).
[
{
"path": ".gitignore",
"chars": 278,
"preview": "# Compilation folder\n/build\n\n# Visual Studio Code \n.vscode\n.vscode/*\n!.vscode/settings.json\n!.vscode/tasks.json\n!.vscode"
},
{
"path": "CMakeLists.txt",
"chars": 2322,
"preview": "#[[\n MIT License\n\n Copyright (c) 2022 Alberto Morcillo Sanz\n\n Permission is hereby granted, free of charge, to "
},
{
"path": "LICENSE",
"chars": 1078,
"preview": "MIT License\n\nCopyright (c) 2022 Alberto Morcillo Sanz\n\nPermission is hereby granted, free of charge, to any person obtai"
},
{
"path": "README.md",
"chars": 4928,
"preview": "# RendererGL\n\nRendererGL is a basic 3D renderer written in C++ and OpenGL that allows working with 3D graphics without t"
},
{
"path": "compile.md",
"chars": 157,
"preview": "# Compile\n\nCreate build folder\n```\nmkdir build (if not created)\ncd build\n```\n\nCall cmake in order to generate Makefile\n`"
},
{
"path": "src/CMakeLists.txt",
"chars": 1178,
"preview": "#[[\n MIT License\n\n Copyright (c) 2022 Alberto Morcillo Sanz\n\n Permission is hereby granted, free of charge, to "
},
{
"path": "src/engine/CMakeLists.txt",
"chars": 3576,
"preview": "#[[\n MIT License\n\n Copyright (c) 2022 Alberto Morcillo Sanz\n\n Permission is hereby granted, free of charge, to "
},
{
"path": "src/engine/Vec3.h",
"chars": 1934,
"preview": "#pragma once\n\ntemplate<typename T>\nstruct Vec3 {\n\n T x, y, z;\n T r, g, b;\n T nx, ny, nz;\n T tx, ty;\n T ta"
},
{
"path": "src/engine/group/DynamicPolytope.cpp",
"chars": 253,
"preview": "#include \"DynamicPolytope.h\"\n\nDynamicPolytope::DynamicPolytope(size_t length) \n : Polytope(length), pos(0) {\n}\n\nvoid "
},
{
"path": "src/engine/group/DynamicPolytope.h",
"chars": 299,
"preview": "#pragma once\n\n#include \"Polytope.h\"\n\n/*\n TODO: Resize if needed\n*/\nclass DynamicPolytope : public Polytope {\n GENE"
},
{
"path": "src/engine/group/Group.cpp",
"chars": 1049,
"preview": "#include \"Group.h\"\n\nunsigned long Group::groupCount = 0;\n\nGroup::Group(unsigned int _primitive, bool _showWire) \n : p"
},
{
"path": "src/engine/group/Group.h",
"chars": 2384,
"preview": "#pragma once\n\n#include <iostream>\n#include <vector>\n#include <memory>\n\n#include \"Polytope.h\"\n#include \"DynamicPolytope.h"
},
{
"path": "src/engine/group/Polytope.cpp",
"chars": 6285,
"preview": "#include \"Polytope.h\"\n\n#include <GL/glew.h>\n\nPolytope::Polytope(size_t length) \n : vertexLength(length), modelMatrix("
},
{
"path": "src/engine/group/Polytope.h",
"chars": 4302,
"preview": "#pragma once\n\n#include <iostream>\n#include <vector>\n#include <memory>\n\n#include <glm/vec3.hpp>\n#include <glm/vec4.hpp>\n#"
},
{
"path": "src/engine/group/Scene.cpp",
"chars": 1512,
"preview": "#include \"Scene.h\"\n\nScene::Scene() \n : modelMatrix(1.f), visible(true) { \n}\n\nvoid Scene::removeGroup(Group::Ptr& g"
},
{
"path": "src/engine/group/Scene.h",
"chars": 1343,
"preview": "#pragma once\n\n#include \"Group.h\"\n#include \"engine/model/Model.h\"\n\n#include \"engine/ptr.h\"\n\nclass Scene {\n GENERATE_PT"
},
{
"path": "src/engine/lighting/DirectionalLight.cpp",
"chars": 372,
"preview": "#include \"DirectionalLight.h\"\n\nDirectionalLight::DirectionalLight(const glm::vec3& direction) \n : Light(direction) {\n"
},
{
"path": "src/engine/lighting/DirectionalLight.h",
"chars": 557,
"preview": "#pragma once\n\n#include \"Light.h\"\n\n// Its the same as Light, but replacing position by direction. JUST NOTATION\nclass Dir"
},
{
"path": "src/engine/lighting/Light.cpp",
"chars": 408,
"preview": "#include \"Light.h\"\n\n#include <GL/glew.h>\n\nbool Light::blinn = true;\n\nLight::Light(const glm::vec3& position)\n : Light"
},
{
"path": "src/engine/lighting/Light.h",
"chars": 1512,
"preview": "#pragma once\n\n#include <iostream>\n#include <memory>\n\n#include <glm/vec3.hpp>\n#include <glm/vec4.hpp>\n#include <glm/mat4x"
},
{
"path": "src/engine/lighting/Material.h",
"chars": 731,
"preview": "#pragma once\n\n#include <glm/vec3.hpp>\n#include <glm/vec4.hpp>\n#include <glm/mat4x4.hpp>\n#include <glm/gtc/type_ptr.hpp>\n"
},
{
"path": "src/engine/lighting/PBRMaterial.h",
"chars": 1080,
"preview": "#pragma once\n\n#include \"Material.h\"\n\nclass PBRMaterial : public Material {\n GENERATE_PTR(PBRMaterial)\nprivate:\n gl"
},
{
"path": "src/engine/lighting/PhongMaterial.h",
"chars": 1008,
"preview": "#pragma once\n\n#include \"Material.h\"\n\nclass PhongMaterial : public Material {\n GENERATE_PTR(PhongMaterial)\nprivate:\n "
},
{
"path": "src/engine/lighting/PointLight.cpp",
"chars": 483,
"preview": "#include \"PointLight.h\"\n\nPointLight::PointLight(const glm::vec3& position) \n : PointLight(position, glm::vec3(1)) {\n}"
},
{
"path": "src/engine/lighting/PointLight.h",
"chars": 943,
"preview": "#pragma once\n\n#include \"Light.h\"\n\n#define CONSTANT 1.0f\n#define LINEAR 0.09f\n#define QUADRATIC 0.032f\n\nclass PointLight "
},
{
"path": "src/engine/model/Model.cpp",
"chars": 9914,
"preview": "#include \"Model.h\"\n\nModel::Model(const std::string& _path, bool _pbr) \n : path(_path), pbr(_pbr) {\n loadModel();\n}"
},
{
"path": "src/engine/model/Model.h",
"chars": 865,
"preview": "#pragma once\n\n#include <iostream>\n#include <vector>\n#include <memory>\n\n#include <assimp/Importer.hpp>\n#include <assimp/s"
},
{
"path": "src/engine/opengl/buffer/Buffer.h",
"chars": 339,
"preview": "#pragma once\n\n#include <GL/glew.h>\n\n#include \"engine/ptr.h\"\n\nclass Buffer {\nprotected:\n unsigned int id;\n virtual "
},
{
"path": "src/engine/opengl/buffer/FrameBuffer.cpp",
"chars": 1200,
"preview": "#include \"FrameBuffer.h\"\n\nFrameBuffer::FrameBuffer()\n : Buffer() {\n initBuffer();\n}\n\nFrameBuffer::~FrameBuffer() {"
},
{
"path": "src/engine/opengl/buffer/FrameBuffer.h",
"chars": 504,
"preview": "#pragma once\n\n#include \"Buffer.h\"\n\nclass FrameBuffer : public Buffer {\n GENERATE_PTR(FrameBuffer)\npublic:\n FrameBu"
},
{
"path": "src/engine/opengl/buffer/IndexBuffer.cpp",
"chars": 1908,
"preview": "#include \"IndexBuffer.h\"\n\n#include <string.h>\n\nIndexBuffer::IndexBuffer() : Buffer() { }\n\nIndexBuffer::IndexBuffer(const"
},
{
"path": "src/engine/opengl/buffer/IndexBuffer.h",
"chars": 692,
"preview": "#include <iostream>\n#include <vector>\n\n#include \"Buffer.h\"\n\nclass IndexBuffer : public Buffer {\n GENERATE_PTR(IndexBu"
},
{
"path": "src/engine/opengl/buffer/MultiSampleRenderBuffer.cpp",
"chars": 511,
"preview": "#include \"MultiSampleRenderBuffer.h\"\n\nMultiSampleRenderBuffer::MultiSampleRenderBuffer(unsigned int width, unsigned int "
},
{
"path": "src/engine/opengl/buffer/MultiSampleRenderBuffer.h",
"chars": 486,
"preview": "#pragma once\n\n#include \"RenderBuffer.h\"\n\nclass MultiSampleRenderBuffer : public RenderBuffer {\n GENERATE_PTR(MultiSam"
},
{
"path": "src/engine/opengl/buffer/RenderBuffer.cpp",
"chars": 646,
"preview": "#include \"RenderBuffer.h\"\n\nRenderBuffer::RenderBuffer(unsigned int _width, unsigned int _height, int _internalFormat) \n "
},
{
"path": "src/engine/opengl/buffer/RenderBuffer.h",
"chars": 643,
"preview": "#pragma once\n\n#include \"Buffer.h\"\n\nclass RenderBuffer : public Buffer {\n GENERATE_PTR(RenderBuffer)\nprotected:\n un"
},
{
"path": "src/engine/opengl/buffer/VertexArray.cpp",
"chars": 674,
"preview": "#include \"VertexArray.h\"\n\nVertexArray::VertexArray() \n : Buffer() {\n initBuffer();\n}\n\nVertexArray::VertexArray(con"
},
{
"path": "src/engine/opengl/buffer/VertexArray.h",
"chars": 417,
"preview": "#pragma once\n\n#include \"Buffer.h\"\n\nclass VertexArray : public Buffer {\n GENERATE_PTR(VertexArray)\npublic:\n VertexA"
},
{
"path": "src/engine/opengl/buffer/VertexBuffer.cpp",
"chars": 6858,
"preview": "#include \"VertexBuffer.h\"\n\n#include <string.h>\n\nVertexBuffer::VertexBuffer() : Buffer() { }\n\nVertexBuffer::VertexBuffer("
},
{
"path": "src/engine/opengl/buffer/VertexBuffer.h",
"chars": 1314,
"preview": "#pragma once\n\n#include <iostream>\n#include <vector>\n#include <memory>\n\n#include \"Buffer.h\"\n#include \"IndexBuffer.h\"\n\n#in"
},
{
"path": "src/engine/opengl/glsl/BlinnPhong.frag",
"chars": 7815,
"preview": "#version 330 core\n\n#define MAX_LIGHTS 64\n#define MAX_TEXTURES 64\n\nstruct Material {\n vec3 ambient;\n vec3 diffuse;\n"
},
{
"path": "src/engine/opengl/glsl/BlinnPhong.vert",
"chars": 1225,
"preview": "#version 330 core\n\nlayout (location = 0) in vec3 aPos;\nlayout (location = 1) in vec3 aColor;\nlayout (location = 2) in ve"
},
{
"path": "src/engine/opengl/glsl/Default.frag",
"chars": 285,
"preview": "#version 330 core\n\nout vec4 FragColor;\n\nin vec3 ourColor;\nin vec3 Normal;\nin vec2 TexCoord;\n\nuniform sampler2D tex;\nunif"
},
{
"path": "src/engine/opengl/glsl/Default.vert",
"chars": 376,
"preview": "#version 330 core\n\nlayout (location = 0) in vec3 aPos;\nlayout (location = 1) in vec3 aColor;\nlayout (location = 2) in ve"
},
{
"path": "src/engine/opengl/glsl/HDR.frag",
"chars": 757,
"preview": "#version 330 core\n\nout vec4 FragColor;\n\nin vec2 TexCoords;\n\nuniform sampler2D hdrBuffer;\nuniform bool hdr;\nuniform float"
},
{
"path": "src/engine/opengl/glsl/HDR.vert",
"chars": 197,
"preview": "#version 330 core\n\nlayout (location = 0) in vec3 aPos;\nlayout (location = 3) in vec2 aTexCoords;\n\nout vec2 TexCoords;\n\nv"
},
{
"path": "src/engine/opengl/glsl/PBR.frag",
"chars": 7374,
"preview": "#version 330 core\n\n#define MAX_LIGHTS 64\n#define MAX_TEXTURES 64\n\nstruct Material {\n vec3 albedo;\n float metallic;"
},
{
"path": "src/engine/opengl/glsl/PBR.vert",
"chars": 1225,
"preview": "#version 330 core\n\nlayout (location = 0) in vec3 aPos;\nlayout (location = 1) in vec3 aColor;\nlayout (location = 2) in ve"
},
{
"path": "src/engine/opengl/glsl/Selection.frag",
"chars": 98,
"preview": "#version 330 core\n\nout vec4 FragColor;\n\nvoid main() {\n FragColor = vec4(1.0, 1.0, 1.0, 0.60);\n}"
},
{
"path": "src/engine/opengl/glsl/Selection.vert",
"chars": 156,
"preview": "#version 330 core\n\nlayout (location = 0) in vec3 aPos;\n\nuniform mat4 mvp;\n\nvoid main() {\n vec4 pos = mvp * vec4(aPos,"
},
{
"path": "src/engine/opengl/glsl/SimpleDepth.frag",
"chars": 266,
"preview": "#version 330 core\n\n/*\nSince we have no color buffer and disabled the draw and read buffers, \nthe resulting fragments do "
},
{
"path": "src/engine/opengl/glsl/SimpleDepth.vert",
"chars": 187,
"preview": "#version 330 core\n\nlayout (location = 0) in vec3 aPos;\n\nuniform mat4 lightSpaceMatrix;\nuniform mat4 model;\n\nvoid main()\n"
},
{
"path": "src/engine/opengl/glsl/SkyBox.frag",
"chars": 148,
"preview": "#version 330 core\n\nout vec4 FragColor;\n\nin vec3 TexCoords;\n\nuniform samplerCube skybox;\n\nvoid main() {\n FragColor = t"
},
{
"path": "src/engine/opengl/glsl/SkyBox.vert",
"chars": 239,
"preview": "#version 330 core\n\nlayout (location = 0) in vec3 aPos;\n\nout vec3 TexCoords;\n\nuniform mat4 projection;\nuniform mat4 view;"
},
{
"path": "src/engine/opengl/glsl/TexturedQuad.frag",
"chars": 180,
"preview": "#version 330 core\n\nout vec4 FragColor;\n\nin vec2 TexCoords;\n\nuniform sampler2D tex;\n\nvoid main() {\n\n vec3 color = text"
},
{
"path": "src/engine/opengl/glsl/TexturedQuad.vert",
"chars": 197,
"preview": "#version 330 core\n\nlayout (location = 0) in vec3 aPos;\nlayout (location = 3) in vec2 aTexCoords;\n\nout vec2 TexCoords;\n\nv"
},
{
"path": "src/engine/opengl/shader/Shader.cpp",
"chars": 4665,
"preview": "#include \"Shader.h\"\n\n#include <fstream>\n\nShader::Shader(const std::string& _code, const ShaderType& _shaderType) \n : "
},
{
"path": "src/engine/opengl/shader/Shader.h",
"chars": 2412,
"preview": "#pragma once\n\n#include <iostream>\n#include <vector>\n#include <string>\n\n#include <GL/glew.h>\n\n#include <glm/vec3.hpp>\n#in"
},
{
"path": "src/engine/ptr.h",
"chars": 557,
"preview": "#pragma once\n\n#include <iostream>\n#include <memory>\n\n#define GENERATE_PTR(clazz) public: \\\n "
},
{
"path": "src/engine/renderer/Camera.cpp",
"chars": 405,
"preview": "#include \"Camera.h\"\n\nCamera::Camera(const glm::mat4& _projectionMatrix, const glm::mat4& _viewMatrix) \n : projectionM"
},
{
"path": "src/engine/renderer/Camera.h",
"chars": 1603,
"preview": "#pragma once\n\n#include <glm/vec3.hpp>\n#include <glm/vec4.hpp>\n#include <glm/mat4x4.hpp>\n#include <glm/gtc/type_ptr.hpp>\n"
},
{
"path": "src/engine/renderer/FPSCamera.cpp",
"chars": 2471,
"preview": "#include \"FPSCamera.h\"\n\n#include <iostream>\n\n#define DEFAULT_SENSITIVITY 0.1\n#define DEFAULT_CAMERA_SPEED 0.1\n\nFPSCamera"
},
{
"path": "src/engine/renderer/FPSCamera.h",
"chars": 1549,
"preview": "#pragma once\n\n#include \"Camera.h\"\n\nclass FPSCamera : public Camera {\n GENERATE_PTR(FPSCamera)\npublic:\n enum class "
},
{
"path": "src/engine/renderer/FrameCapturer.h",
"chars": 3463,
"preview": "#pragma once\n\n#include <iostream>\n\n#include <GL/glew.h>\n\n#include <glm/vec3.hpp>\n\n#include \"engine/opengl/buffer/FrameBu"
},
{
"path": "src/engine/renderer/MouseRayCasting.cpp",
"chars": 1548,
"preview": "#include \"MouseRayCasting.h\"\n\nMouseRayCasting::MouseRayCasting(const Camera::Ptr& _camera, unsigned int _width, unsigned"
},
{
"path": "src/engine/renderer/MouseRayCasting.h",
"chars": 1647,
"preview": "// Thanks to: https://antongerdelan.net/opengl/raycasting.html\n#pragma once\n\n#include \"Camera.h\"\n\nclass MouseRayCasting "
},
{
"path": "src/engine/renderer/Renderer.cpp",
"chars": 24225,
"preview": "#include \"Renderer.h\"\n\n#define SHADOW_MAP_WIDTH 1024\n#define SHADOW_MAP_HEIGHT 1024\n\nRenderer::Renderer(unsigned int _vi"
},
{
"path": "src/engine/renderer/Renderer.h",
"chars": 6663,
"preview": "#pragma once\n\n#include <iostream>\n#include <vector>\n\n#define GLEW_STATIC\n#include <GL/glew.h>\n\n#include \"engine/group/Sc"
},
{
"path": "src/engine/renderer/SkyBox.cpp",
"chars": 1762,
"preview": "#include \"SkyBox.h\"\n\n#include \"engine/texture/Texture.h\"\n\n#include \"engine/Vec3.h\"\n\nSkyBox::SkyBox(const std::vector<std"
},
{
"path": "src/engine/renderer/SkyBox.h",
"chars": 1072,
"preview": "#pragma once\n\n#include <iostream>\n#include <vector>\n#include <memory>\n\n#include \"engine/opengl/buffer/VertexArray.h\"\n#in"
},
{
"path": "src/engine/renderer/TrackballCamera.cpp",
"chars": 2540,
"preview": "#include \"TrackballCamera.h\"\n\n#include <iostream>\n\nTrackballCamera::TrackballCamera(const glm::mat4& projectionMatrix, c"
},
{
"path": "src/engine/renderer/TrackballCamera.h",
"chars": 1126,
"preview": "#pragma once\n\n#include \"Camera.h\"\n\nclass TrackballCamera : public Camera {\n GENERATE_PTR(TrackballCamera)\nprivate:\n "
},
{
"path": "src/engine/shapes/Cube.cpp",
"chars": 3236,
"preview": "#include \"Cube.h\"\n\n#include <iostream>\n#include <vector>\n\n#include \"engine/Vec3.h\"\n\nstd::vector<Vec3f> vertices = \n{\n "
},
{
"path": "src/engine/shapes/Cube.h",
"chars": 138,
"preview": "#pragma once\n\n#include \"Shape.h\"\n\nclass Cube : public Shape {\n GENERATE_PTR(Cube)\npublic:\n Cube();\n virtual ~Cu"
},
{
"path": "src/engine/shapes/Shape.cpp",
"chars": 434,
"preview": "#include \"Shape.h\"\n\nShape::Shape(size_t length) \n : Polytope(length) {\n}\n\nShape::Shape(Polytope::Ptr polytope)\n : "
},
{
"path": "src/engine/shapes/Shape.h",
"chars": 418,
"preview": "#pragma once\n\n#include \"engine/group/Polytope.h\"\n\nclass Shape : public Polytope {\n GENERATE_PTR(Shape)\npublic:\n Sh"
},
{
"path": "src/engine/shapes/Sphere.cpp",
"chars": 2626,
"preview": "#include \"Sphere.h\"\n\n#define DEFAULT_RADIUS 1\n#define DEFAULT_LATITUDES 64\n#define DEFAULT_LONGITUDES 64\n\nSphere::Sphere"
},
{
"path": "src/engine/shapes/Sphere.h",
"chars": 289,
"preview": "#pragma once\n\n#include \"Shape.h\"\n\nclass Sphere : public Shape {\n GENERATE_PTR(Sphere)\npublic:\n Sphere();\n Spher"
},
{
"path": "src/engine/texture/ColorBufferTexture.cpp",
"chars": 625,
"preview": "#include \"ColorBufferTexture.h\"\n\nColorBufferTexture::ColorBufferTexture(int _width, int _height) \n : Texture() {\n "
},
{
"path": "src/engine/texture/ColorBufferTexture.h",
"chars": 295,
"preview": "#pragma once\n\n#include \"Texture.h\"\n\nclass ColorBufferTexture : public Texture {\n GENERATE_PTR(ColorBufferTexture)\npub"
},
{
"path": "src/engine/texture/CubeMapTexture.cpp",
"chars": 1332,
"preview": "#include \"CubeMapTexture.h\"\n\nCubeMapTexture::CubeMapTexture(const std::vector<std::string>& _faces) \n : Texture(), fa"
},
{
"path": "src/engine/texture/CubeMapTexture.h",
"chars": 510,
"preview": "#pragma once\n\n#include <iostream>\n#include <vector>\n\n#include \"Texture.h\"\n\nclass CubeMapTexture : public Texture {\n G"
},
{
"path": "src/engine/texture/DepthTexture.cpp",
"chars": 904,
"preview": "#include \"DepthTexture.h\"\n\nDepthTexture::DepthTexture(int _width, int _height) \n : Texture() {\n width = _width;\n "
},
{
"path": "src/engine/texture/DepthTexture.h",
"chars": 265,
"preview": "#pragma once\n\n#include \"Texture.h\"\n\nclass DepthTexture : public Texture {\n GENERATE_PTR(DepthTexture)\npublic:\n Dep"
},
{
"path": "src/engine/texture/MultiSampleTexture.cpp",
"chars": 739,
"preview": "#include \"MultiSampleTexture.h\"\n\nMultiSampleTexture::MultiSampleTexture(unsigned int width, unsigned int height, unsigne"
},
{
"path": "src/engine/texture/MultiSampleTexture.h",
"chars": 510,
"preview": "#pragma once\n\n#include \"Texture.h\"\n\nclass MultiSampleTexture : public Texture {\n GENERATE_PTR(MultiSampleTexture)\npro"
},
{
"path": "src/engine/texture/Texture.cpp",
"chars": 3628,
"preview": "#include \"Texture.h\"\n\n#define STB_IMAGE_IMPLEMENTATION\n#include \"vendor/stb_image.h\"\n\nunsigned int Texture::count = 0;\ni"
},
{
"path": "src/engine/texture/Texture.h",
"chars": 2569,
"preview": "#pragma once\n\n#include <iostream>\n#include <memory>\n\n#include <GL/glew.h>\n\n#include \"engine/ptr.h\"\n\nstruct Image {\n u"
},
{
"path": "src/engine/texture/vendor/stb_image.h",
"chars": 283876,
"preview": "/* stb_image - v2.26 - public domain image loader - http://nothings.org/stb\n no warrant"
},
{
"path": "test/CMakeLists.txt",
"chars": 2488,
"preview": "#[[\n MIT License\n\n Copyright (c) 2022 Alberto Morcillo Sanz\n\n Permission is hereby granted, free of charge, to "
},
{
"path": "test/testCube/CMakeLists.txt",
"chars": 1666,
"preview": "#[[\n MIT License\n\n Copyright (c) 2022 Alberto Morcillo Sanz\n\n Permission is hereby granted, free of charge, to "
},
{
"path": "test/testCube/README.md",
"chars": 100,
"preview": "## Dependencies\n\n* [GLFW](https://github.com/glfw/glfw) for creating a window with an OpenGL context"
},
{
"path": "test/testCube/src/main.cpp",
"chars": 2194,
"preview": "#include <iostream>\n#include <vector>\n\n#include <engine/renderer/Renderer.h>\n#include <engine/renderer/TrackballCamera.h"
},
{
"path": "test/testHDRI/CMakeLists.txt",
"chars": 1721,
"preview": "#[[\n MIT License\n\n Copyright (c) 2022 Alberto Morcillo Sanz\n\n Permission is hereby granted, free of charge, to "
},
{
"path": "test/testHDRI/README.md",
"chars": 100,
"preview": "## Dependencies\n\n* [GLFW](https://github.com/glfw/glfw) for creating a window with an OpenGL context"
},
{
"path": "test/testHDRI/src/ImguiStyles.h",
"chars": 5404,
"preview": "#pragma once\n\n// From https://github.com/procedural/gpulib/blob/master/gpulib_imgui.h\n// https://github.com/ocornut/imgu"
},
{
"path": "test/testHDRI/src/main.cpp",
"chars": 9127,
"preview": "#include <iostream>\n#include <vector>\n\n#include <engine/renderer/Renderer.h>\n#include <engine/renderer/TrackballCamera.h"
},
{
"path": "test/testImGuiGLFW/CMakeLists.txt",
"chars": 1734,
"preview": "#[[\n MIT License\n\n Copyright (c) 2022 Alberto Morcillo Sanz\n\n Permission is hereby granted, free of charge, to "
},
{
"path": "test/testImGuiGLFW/README.md",
"chars": 167,
"preview": "## Dependencies\n\n* [GLFW](https://github.com/glfw/glfw) for creating a window with an OpenGL context\n* [IMGUI](https://g"
},
{
"path": "test/testImGuiGLFW/imgui.ini",
"chars": 465,
"preview": "[Window][DockSpace]\nPos=0,0\nSize=1280,900\nCollapsed=0\n\n[Window][Debug##Default]\nPos=60,60\nSize=400,400\nCollapsed=0\n\n[Win"
},
{
"path": "test/testImGuiGLFW/src/ImguiStyles.h",
"chars": 5404,
"preview": "#pragma once\n\n// From https://github.com/procedural/gpulib/blob/master/gpulib_imgui.h\n// https://github.com/ocornut/imgu"
},
{
"path": "test/testImGuiGLFW/src/main.cpp",
"chars": 45973,
"preview": "/**\n * @file main.cpp\n * \n * @author MorcilloSanz\n * @brief This file is an example of how to use RendererGL with GLFW a"
},
{
"path": "test/testLighting/CMakeLists.txt",
"chars": 1670,
"preview": "#[[\n MIT License\n\n Copyright (c) 2022 Alberto Morcillo Sanz\n\n Permission is hereby granted, free of charge, to "
},
{
"path": "test/testLighting/README.md",
"chars": 100,
"preview": "## Dependencies\n\n* [GLFW](https://github.com/glfw/glfw) for creating a window with an OpenGL context"
},
{
"path": "test/testLighting/src/main.cpp",
"chars": 1771,
"preview": "#include <iostream>\n#include <vector>\n\n#include <engine/renderer/Renderer.h>\n#include <engine/renderer/TrackballCamera.h"
},
{
"path": "test/testModelPBR/CMakeLists.txt",
"chars": 1725,
"preview": "#[[\n MIT License\n\n Copyright (c) 2022 Alberto Morcillo Sanz\n\n Permission is hereby granted, free of charge, to "
},
{
"path": "test/testModelPBR/README.md",
"chars": 100,
"preview": "## Dependencies\n\n* [GLFW](https://github.com/glfw/glfw) for creating a window with an OpenGL context"
},
{
"path": "test/testModelPBR/src/ImguiStyles.h",
"chars": 5404,
"preview": "#pragma once\n\n// From https://github.com/procedural/gpulib/blob/master/gpulib_imgui.h\n// https://github.com/ocornut/imgu"
},
{
"path": "test/testModelPBR/src/main.cpp",
"chars": 11282,
"preview": "#include <iostream>\n#include <vector>\n\n#include <engine/renderer/Renderer.h>\n#include <engine/renderer/TrackballCamera.h"
},
{
"path": "test/testPBR/CMakeLists.txt",
"chars": 1665,
"preview": "#[[\n MIT License\n\n Copyright (c) 2022 Alberto Morcillo Sanz\n\n Permission is hereby granted, free of charge, to "
},
{
"path": "test/testPBR/README.md",
"chars": 100,
"preview": "## Dependencies\n\n* [GLFW](https://github.com/glfw/glfw) for creating a window with an OpenGL context"
},
{
"path": "test/testPBR/src/main.cpp",
"chars": 7651,
"preview": "#include <iostream>\n#include <vector>\n\n#include <engine/renderer/Renderer.h>\n#include <engine/renderer/TrackballCamera.h"
},
{
"path": "test/testPointCloud/CMakeLists.txt",
"chars": 1727,
"preview": "#[[\n MIT License\n\n Copyright (c) 2022 Alberto Morcillo Sanz\n\n Permission is hereby granted, free of charge, to "
},
{
"path": "test/testPointCloud/README.md",
"chars": 100,
"preview": "## Dependencies\n\n* [GLFW](https://github.com/glfw/glfw) for creating a window with an OpenGL context"
},
{
"path": "test/testPointCloud/src/ImguiStyles.h",
"chars": 5404,
"preview": "#pragma once\n\n// From https://github.com/procedural/gpulib/blob/master/gpulib_imgui.h\n// https://github.com/ocornut/imgu"
},
{
"path": "test/testPointCloud/src/main.cpp",
"chars": 12235,
"preview": "#include <iostream>\n#include <vector>\n#include <fstream>\n\n#include <engine/renderer/Renderer.h>\n#include <engine/rendere"
},
{
"path": "test/third_party/imgui/.editorconfig",
"chars": 788,
"preview": "# See http://editorconfig.org to read about the EditorConfig format.\n# - In theory automatically supported by VS2017+ an"
},
{
"path": "test/third_party/imgui/.gitattributes",
"chars": 397,
"preview": "* text=auto\n\n*.c text\n*.cpp text\n*.h text\n*.m text\n*.mm text\n*.md text\n*.txt text\n*.html text\n*.bat text\n*.frag text\n*.v"
},
{
"path": "test/third_party/imgui/.gitignore",
"chars": 926,
"preview": "## OSX artifacts\n.DS_Store\n\n## Dear ImGui artifacts\nimgui.ini\n\n## General build artifacts\n*.o\n*.obj\n*.exe\nexamples/build"
},
{
"path": "test/third_party/imgui/LICENSE.txt",
"chars": 1083,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2014-2022 Omar Cornut\n\nPermission is hereby granted, free of charge, to any person "
},
{
"path": "test/third_party/imgui/backends/imgui_impl_glfw.cpp",
"chars": 60594,
"preview": "// dear imgui: Platform Backend for GLFW\n// This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan, WebGPU..)"
},
{
"path": "test/third_party/imgui/backends/imgui_impl_glfw.h",
"chars": 3828,
"preview": "// dear imgui: Platform Backend for GLFW\n// This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan, WebGPU..)"
},
{
"path": "test/third_party/imgui/backends/imgui_impl_opengl3.cpp",
"chars": 40197,
"preview": "// dear imgui: Renderer Backend for modern OpenGL with shaders / programmatic pipeline\n// - Desktop GL: 2.x 3.x 4.x\n// -"
},
{
"path": "test/third_party/imgui/backends/imgui_impl_opengl3.h",
"chars": 2998,
"preview": "// dear imgui: Renderer Backend for modern OpenGL with shaders / programmatic pipeline\n// - Desktop GL: 2.x 3.x 4.x\n// -"
},
{
"path": "test/third_party/imgui/backends/imgui_impl_opengl3_loader.h",
"chars": 32793,
"preview": "//-----------------------------------------------------------------------------\n// About imgui_impl_opengl3_loader.h:\n//"
},
{
"path": "test/third_party/imgui/backends/imgui_impl_vulkan.cpp",
"chars": 91216,
"preview": "// dear imgui: Renderer Backend for Vulkan\n// This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32"
},
{
"path": "test/third_party/imgui/backends/imgui_impl_vulkan.h",
"chars": 9604,
"preview": "// dear imgui: Renderer Backend for Vulkan\n// This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32"
},
{
"path": "test/third_party/imgui/backends/vulkan/generate_spv.sh",
"chars": 254,
"preview": "#!/bin/bash\n## -V: create SPIR-V binary\n## -x: save binary output as text-based 32-bit hexadecimal numbers\n## -o: output"
},
{
"path": "test/third_party/imgui/backends/vulkan/glsl_shader.frag",
"chars": 249,
"preview": "#version 450 core\nlayout(location = 0) out vec4 fColor;\n\nlayout(set=0, binding=0) uniform sampler2D sTexture;\n\nlayout(lo"
},
{
"path": "test/third_party/imgui/backends/vulkan/glsl_shader.vert",
"chars": 454,
"preview": "#version 450 core\nlayout(location = 0) in vec2 aPos;\nlayout(location = 1) in vec2 aUV;\nlayout(location = 2) in vec4 aCol"
},
{
"path": "test/third_party/imgui/imconfig.h",
"chars": 9868,
"preview": "//-----------------------------------------------------------------------------\n// COMPILE-TIME OPTIONS FOR DEAR IMGUI\n/"
},
{
"path": "test/third_party/imgui/imgui.cpp",
"chars": 945966,
"preview": "// dear imgui, 1.88 WIP\n// (main code and documentation)\n\n// Help:\n// - Read FAQ at http://dearimgui.org/faq\n// - Newcom"
},
{
"path": "test/third_party/imgui/imgui.h",
"chars": 326724,
"preview": "// dear imgui, v1.88 WIP\n// (headers)\n\n// Help:\n// - Read FAQ at http://dearimgui.org/faq\n// - Newcomers, read 'Programm"
},
{
"path": "test/third_party/imgui/imgui_demo.cpp",
"chars": 424832,
"preview": "// dear imgui, v1.88 WIP\n// (demo code)\n\n// Help:\n// - Read FAQ at http://dearimgui.org/faq\n// - Newcomers, read 'Progra"
},
{
"path": "test/third_party/imgui/imgui_draw.cpp",
"chars": 214461,
"preview": "// dear imgui, v1.88 WIP\n// (drawing and font code)\n\n/*\n\nIndex of this file:\n\n// [SECTION] STB libraries implementation\n"
},
{
"path": "test/third_party/imgui/imgui_internal.h",
"chars": 234873,
"preview": "// dear imgui, v1.88 WIP\n// (internal structures/api)\n\n// You may use this file to debug, understand or extend ImGui fea"
},
{
"path": "test/third_party/imgui/imgui_tables.cpp",
"chars": 216524,
"preview": "// dear imgui, v1.88 WIP\n// (tables and columns code)\n\n/*\n\nIndex of this file:\n\n// [SECTION] Commentary\n// [SECTION] Hea"
},
{
"path": "test/third_party/imgui/imgui_widgets.cpp",
"chars": 416077,
"preview": "// dear imgui, v1.88 WIP\n// (widgets code)\n\n/*\n\nIndex of this file:\n\n// [SECTION] Forward Declarations\n// [SECTION] Widg"
},
{
"path": "test/third_party/imgui/imstb_rectpack.h",
"chars": 20344,
"preview": "// [DEAR IMGUI]\n// This is a slightly modified version of stb_rect_pack.h 1.01.\n// Grep for [DEAR IMGUI] to find the cha"
},
{
"path": "test/third_party/imgui/imstb_textedit.h",
"chars": 54933,
"preview": "// [DEAR IMGUI]\n// This is a slightly modified version of stb_textedit.h 1.14.\n// Those changes would need to be pushed "
},
{
"path": "test/third_party/imgui/imstb_truetype.h",
"chars": 199422,
"preview": "// [DEAR IMGUI]\n// This is a slightly modified version of stb_truetype.h 1.26.\n// Mostly fixing for compiler and static "
},
{
"path": "test/third_party/imgui/misc/README.txt",
"chars": 998,
"preview": "\nmisc/cpp/\n InputText() wrappers for C++ standard library (STL) type: std::string.\n This is also an example of how you"
},
{
"path": "test/third_party/imgui/misc/cpp/README.txt",
"chars": 557,
"preview": "\nimgui_stdlib.h + imgui_stdlib.cpp\n InputText() wrappers for C++ standard library (STL) type: std::string.\n This is al"
},
{
"path": "test/third_party/imgui/misc/cpp/imgui_stdlib.cpp",
"chars": 2954,
"preview": "// dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.)\n// This is also an example of how you m"
},
{
"path": "test/third_party/imgui/misc/cpp/imgui_stdlib.h",
"chars": 1015,
"preview": "// dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.)\n// This is also an example of how you m"
},
{
"path": "test/third_party/imgui/misc/debuggers/README.txt",
"chars": 487,
"preview": "\nHELPER FILES FOR POPULAR DEBUGGERS\n\nimgui.gdb\n GDB: disable stepping into trivial functions.\n (read comments insi"
},
{
"path": "test/third_party/imgui/misc/debuggers/imgui.gdb",
"chars": 555,
"preview": "# GDB configuration to aid debugging experience\n\n# To enable these customizations edit $HOME/.gdbinit (or ./.gdbinit if "
},
{
"path": "test/third_party/imgui/misc/debuggers/imgui.natstepfilter",
"chars": 1275,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n.natstepfilter file for Visual Studio debugger.\nPurpose: instruct debugger t"
},
{
"path": "test/third_party/imgui/misc/debuggers/imgui.natvis",
"chars": 2179,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<!--\r\n.natvis file for Visual Studio debugger.\r\nPurpose: provide nicer views on "
},
{
"path": "test/third_party/imgui/misc/fonts/binary_to_compressed_c.cpp",
"chars": 13664,
"preview": "// dear imgui\n// (binary_to_compressed_c.cpp)\n// Helper tool to turn a file into a C array, if you want to embed font da"
},
{
"path": "test/third_party/imgui/misc/freetype/README.md",
"chars": 1808,
"preview": "# imgui_freetype\n\nBuild font atlases using FreeType instead of stb_truetype (which is the default font rasterizer).\n<br>"
},
{
"path": "test/third_party/imgui/misc/freetype/imgui_freetype.cpp",
"chars": 38152,
"preview": "// dear imgui: FreeType font builder (used as a replacement for the stb_truetype builder)\n// (code)\n\n// Get the latest v"
},
{
"path": "test/third_party/imgui/misc/freetype/imgui_freetype.h",
"chars": 3544,
"preview": "// dear imgui: FreeType font builder (used as a replacement for the stb_truetype builder)\n// (headers)\n\n#pragma once\n\n#i"
},
{
"path": "test/third_party/imgui/misc/single_file/imgui_single_file.h",
"chars": 751,
"preview": "// dear imgui: single-file wrapper include\n// We use this to validate compiling all *.cpp files in a same compilation un"
},
{
"path": "third_party/CMakeLists.txt",
"chars": 1175,
"preview": "#[[\n MIT License\n\n Copyright (c) 2022 Alberto Morcillo Sanz\n\n Permission is hereby granted, free of charge, to "
},
{
"path": "third_party/glm/CMakeLists.txt",
"chars": 2738,
"preview": "file(GLOB ROOT_SOURCE *.cpp)\r\nfile(GLOB ROOT_INLINE *.inl)\r\nfile(GLOB ROOT_HEADER *.hpp)\r\nfile(GLOB ROOT_TEXT ../*.txt)\r"
},
{
"path": "third_party/glm/common.hpp",
"chars": 28157,
"preview": "/// @ref core\r\n/// @file glm/common.hpp\r\n///\r\n/// @see <a href=\"http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pd"
},
{
"path": "third_party/glm/detail/_features.hpp",
"chars": 11770,
"preview": "#pragma once\r\n\r\n// #define GLM_CXX98_EXCEPTIONS\r\n// #define GLM_CXX98_RTTI\r\n\r\n// #define GLM_CXX11_RVALUE_REFERENCES\r\n//"
},
{
"path": "third_party/glm/detail/_fixes.hpp",
"chars": 407,
"preview": "#include <cmath>\r\n\r\n//! Workaround for compatibility with other libraries\r\n#ifdef max\r\n#undef max\r\n#endif\r\n\r\n//! Workaro"
},
{
"path": "third_party/glm/detail/_noise.hpp",
"chars": 2360,
"preview": "#pragma once\r\n\r\n#include \"../common.hpp\"\r\n\r\nnamespace glm{\r\nnamespace detail\r\n{\r\n\ttemplate<typename T>\r\n\tGLM_FUNC_QUALIF"
},
{
"path": "third_party/glm/detail/_swizzle.hpp",
"chars": 49213,
"preview": "#pragma once\r\n\r\nnamespace glm{\r\nnamespace detail\r\n{\r\n\t// Internal class for implementing swizzle operators\r\n\ttemplate<ty"
},
{
"path": "third_party/glm/detail/_swizzle_func.hpp",
"chars": 35019,
"preview": "#pragma once\r\n\r\n#define GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, CONST, A, B)\t\\\r\n\tvec<2, T, Q> A ## B() CONST\t\t\t\t\t\t\t\\\r\n\t{\t\t\t\t\t\t\t"
},
{
"path": "third_party/glm/detail/_vectorize.hpp",
"chars": 5508,
"preview": "#pragma once\r\n\r\nnamespace glm{\r\nnamespace detail\r\n{\r\n\ttemplate<template<length_t L, typename T, qualifier Q> class vec, "
},
{
"path": "third_party/glm/detail/compute_common.hpp",
"chars": 1242,
"preview": "#pragma once\r\n\r\n#include \"setup.hpp\"\r\n#include <limits>\r\n\r\nnamespace glm{\r\nnamespace detail\r\n{\r\n\ttemplate<typename genFI"
},
{
"path": "third_party/glm/detail/compute_vector_relational.hpp",
"chars": 630,
"preview": "#pragma once\r\n\r\n//#include \"compute_common.hpp\"\r\n#include \"setup.hpp\"\r\n#include <limits>\r\n\r\nnamespace glm{\r\nnamespace de"
},
{
"path": "third_party/glm/detail/func_common.inl",
"chars": 25400,
"preview": "/// @ref core\r\n/// @file glm/detail/func_common.inl\r\n\r\n#include \"../vector_relational.hpp\"\r\n#include \"compute_common.hpp"
},
{
"path": "third_party/glm/detail/func_common_simd.inl",
"chars": 6235,
"preview": "/// @ref core\r\n/// @file glm/detail/func_common_simd.inl\r\n\r\n#if GLM_ARCH & GLM_ARCH_SSE2_BIT\r\n\r\n#include \"../simd/common"
},
{
"path": "third_party/glm/detail/func_exponential.inl",
"chars": 4500,
"preview": "/// @ref core\r\n/// @file glm/detail/func_exponential.inl\r\n\r\n#include \"../vector_relational.hpp\"\r\n#include \"_vectorize.hp"
},
{
"path": "third_party/glm/detail/func_exponential_simd.inl",
"chars": 850,
"preview": "/// @ref core\r\n/// @file glm/detail/func_exponential_simd.inl\r\n\r\n#include \"../simd/exponential.h\"\r\n\r\n#if GLM_ARCH & GLM_"
},
{
"path": "third_party/glm/detail/func_geometric.inl",
"chars": 7694,
"preview": "#include \"../exponential.hpp\"\r\n#include \"../common.hpp\"\r\n\r\nnamespace glm{\r\nnamespace detail\r\n{\r\n\ttemplate<length_t L, ty"
},
{
"path": "third_party/glm/detail/func_geometric_simd.inl",
"chars": 4279,
"preview": "/// @ref core\r\n/// @file glm/detail/func_geometric_simd.inl\r\n\r\n#include \"../simd/geometric.h\"\r\n\r\n#if GLM_ARCH & GLM_ARCH"
},
{
"path": "third_party/glm/detail/func_integer.inl",
"chars": 15366,
"preview": "/// @ref core\r\n\r\n#include \"_vectorize.hpp\"\r\n#if(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC)\r\n#\tinclude <i"
},
{
"path": "third_party/glm/detail/func_integer_simd.inl",
"chars": 1699,
"preview": "#include \"../simd/integer.h\"\r\n\r\n#if GLM_ARCH & GLM_ARCH_SSE2_BIT\r\n\r\nnamespace glm{\r\nnamespace detail\r\n{\r\n\ttemplate<quali"
},
{
"path": "third_party/glm/detail/func_matrix.inl",
"chars": 13130,
"preview": "#include \"../geometric.hpp\"\r\n#include <limits>\r\n\r\nnamespace glm{\r\nnamespace detail\r\n{\r\n\ttemplate<length_t C, length_t R,"
},
{
"path": "third_party/glm/detail/func_matrix_simd.inl",
"chars": 8812,
"preview": "#if GLM_ARCH & GLM_ARCH_SSE2_BIT\r\n\r\n#include \"type_mat4x4.hpp\"\r\n#include \"../geometric.hpp\"\r\n#include \"../simd/matrix.h\""
},
{
"path": "third_party/glm/detail/func_packing.inl",
"chars": 3140,
"preview": "/// @ref core\r\n/// @file glm/detail/func_packing.inl\r\n\r\n#include \"../common.hpp\"\r\n#include \"type_half.hpp\"\r\n\r\nnamespace "
},
{
"path": "third_party/glm/detail/func_packing_simd.inl",
"chars": 78,
"preview": "namespace glm{\r\nnamespace detail\r\n{\r\n\r\n}//namespace detail\r\n}//namespace glm\r\n"
},
{
"path": "third_party/glm/detail/func_trigonometric.inl",
"chars": 5413,
"preview": "#include \"_vectorize.hpp\"\r\n#include <cmath>\r\n#include <limits>\r\n\r\nnamespace glm\r\n{\r\n\t// radians\r\n\ttemplate<typename genT"
},
{
"path": "third_party/glm/detail/func_trigonometric_simd.inl",
"chars": 0,
"preview": ""
},
{
"path": "third_party/glm/detail/func_vector_relational.inl",
"chars": 2495,
"preview": "namespace glm\r\n{\r\n\ttemplate<length_t L, typename T, qualifier Q>\r\n\tGLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, bool, Q> less"
},
{
"path": "third_party/glm/detail/func_vector_relational_simd.inl",
"chars": 78,
"preview": "namespace glm{\r\nnamespace detail\r\n{\r\n\r\n}//namespace detail\r\n}//namespace glm\r\n"
},
{
"path": "third_party/glm/detail/glm.cpp",
"chars": 8728,
"preview": "/// @ref core\r\n/// @file glm/glm.cpp\r\n\r\n#ifndef GLM_ENABLE_EXPERIMENTAL\r\n#define GLM_ENABLE_EXPERIMENTAL\r\n#endif\r\n#inclu"
},
{
"path": "third_party/glm/detail/qualifier.hpp",
"chars": 6126,
"preview": "#pragma once\r\n\r\n#include \"setup.hpp\"\r\n\r\nnamespace glm\r\n{\r\n\t/// Qualify GLM types in term of alignment (packed, aligned) "
},
{
"path": "third_party/glm/detail/setup.hpp",
"chars": 40588,
"preview": "#ifndef GLM_SETUP_INCLUDED\r\n\r\n#include <cassert>\r\n#include <cstddef>\r\n\r\n#define GLM_VERSION_MAJOR\t\t\t0\r\n#define GLM_VERSI"
},
{
"path": "third_party/glm/detail/type_float.hpp",
"chars": 1642,
"preview": "#pragma once\r\n\r\n#include \"setup.hpp\"\r\n\r\n#if GLM_COMPILER == GLM_COMPILER_VC12\r\n#\tpragma warning(push)\r\n#\tpragma warning("
},
{
"path": "third_party/glm/detail/type_half.hpp",
"chars": 270,
"preview": "#pragma once\r\n\r\n#include \"setup.hpp\"\r\n\r\nnamespace glm{\r\nnamespace detail\r\n{\r\n\ttypedef short hdata;\r\n\r\n\tGLM_FUNC_DECL flo"
},
{
"path": "third_party/glm/detail/type_half.inl",
"chars": 4754,
"preview": "namespace glm{\r\nnamespace detail\r\n{\r\n\tGLM_FUNC_QUALIFIER float overflow()\r\n\t{\r\n\t\tvolatile float f = 1e10;\r\n\r\n\t\tfor(int i"
},
{
"path": "third_party/glm/detail/type_mat2x2.hpp",
"chars": 6331,
"preview": "/// @ref core\r\n/// @file glm/detail/type_mat2x2.hpp\r\n\r\n#pragma once\r\n\r\n#include \"type_vec2.hpp\"\r\n#include <limits>\r\n#inc"
},
{
"path": "third_party/glm/detail/type_mat2x2.inl",
"chars": 14503,
"preview": "#include \"../matrix.hpp\"\r\n\r\nnamespace glm\r\n{\r\n\t// -- Constructors --\r\n\r\n#\tif GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISAB"
},
{
"path": "third_party/glm/detail/type_mat2x3.hpp",
"chars": 5455,
"preview": "/// @ref core\r\n/// @file glm/detail/type_mat2x3.hpp\r\n\r\n#pragma once\r\n\r\n#include \"type_vec2.hpp\"\r\n#include \"type_vec3.hpp"
},
{
"path": "third_party/glm/detail/type_mat2x3.inl",
"chars": 13953,
"preview": "namespace glm\r\n{\r\n\t// -- Constructors --\r\n\r\n#\tif GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE\r\n\t\ttemplate<typename T, q"
},
{
"path": "third_party/glm/detail/type_mat2x4.hpp",
"chars": 5516,
"preview": "/// @ref core\r\n/// @file glm/detail/type_mat2x4.hpp\r\n\r\n#pragma once\r\n\r\n#include \"type_vec2.hpp\"\r\n#include \"type_vec4.hpp"
},
{
"path": "third_party/glm/detail/type_mat2x4.inl",
"chars": 14680,
"preview": "namespace glm\r\n{\r\n\t// -- Constructors --\r\n\r\n#\tif GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE\r\n\t\ttemplate<typename T, q"
},
{
"path": "third_party/glm/detail/type_mat3x2.hpp",
"chars": 5548,
"preview": "/// @ref core\r\n/// @file glm/detail/type_mat3x2.hpp\r\n\r\n#pragma once\r\n\r\n#include \"type_vec2.hpp\"\r\n#include \"type_vec3.hpp"
},
{
"path": "third_party/glm/detail/type_mat3x2.inl",
"chars": 15037,
"preview": "namespace glm\r\n{\r\n\t// -- Constructors --\r\n\r\n#\tif GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE\r\n\t\ttemplate<typename T, q"
},
{
"path": "third_party/glm/detail/type_mat3x3.hpp",
"chars": 6515,
"preview": "/// @ref core\r\n/// @file glm/detail/type_mat3x3.hpp\r\n\r\n#pragma once\r\n\r\n#include \"type_vec3.hpp\"\r\n#include <limits>\r\n#inc"
},
{
"path": "third_party/glm/detail/type_mat3x3.inl",
"chars": 17789,
"preview": "#include \"../matrix.hpp\"\r\n\r\nnamespace glm\r\n{\r\n\t// -- Constructors --\r\n\r\n#\tif GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISAB"
},
{
"path": "third_party/glm/detail/type_mat3x4.hpp",
"chars": 5700,
"preview": "/// @ref core\r\n/// @file glm/detail/type_mat3x4.hpp\r\n\r\n#pragma once\r\n\r\n#include \"type_vec3.hpp\"\r\n#include \"type_vec4.hpp"
},
{
"path": "third_party/glm/detail/type_mat3x4.inl",
"chars": 17491,
"preview": "namespace glm\r\n{\r\n\t// -- Constructors --\r\n\r\n#\tif GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE\r\n\t\ttemplate<typename T, q"
},
{
"path": "third_party/glm/detail/type_mat4x2.hpp",
"chars": 5676,
"preview": "/// @ref core\r\n/// @file glm/detail/type_mat4x2.hpp\r\n\r\n#pragma once\r\n\r\n#include \"type_vec2.hpp\"\r\n#include \"type_vec4.hpp"
}
]
// ... and 375 more files (download for full content)
About this extraction
This page contains the full source code of the MorcilloSanz/RendererGL GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 575 files (5.8 MB), approximately 1.5M tokens, and a symbol index with 2869 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.