Skip to content

Commit ab60a32

Browse files
committed
Fixing formatting and include style
since all of the third party libs are expected to be built directly, we use "" instead of the <> style imports just to keep it consistent.
1 parent 14f6ab2 commit ab60a32

11 files changed

Lines changed: 44 additions & 39 deletions

File tree

include/camera.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include <glm/gtc/matrix_transform.hpp>
3+
#include "glm/gtc/matrix_transform.hpp"
44

55
struct Camera {
66
enum class MoveDirection {

include/mesh.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

3-
#include <glm/vec2.hpp>
4-
#include <glm/vec3.hpp>
3+
#include "glm/vec2.hpp"
4+
#include "glm/vec3.hpp"
55
#include <vector>
66
#include <optional>
77

include/model.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "mesh.h"
55
#include <filesystem>
66
#include <vector>
7-
#include <assimp/scene.h>
7+
#include "assimp/scene.h"
88
#include "texture.h"
99

1010
class Model

include/shader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <filesystem>
44
#include <string_view>
55
#include "glad/gl.h"
6-
#include <glm/mat4x4.hpp>
6+
#include "glm/mat4x4.hpp"
77

88
bool CheckShaderCompileSuccess(unsigned int shader_id);
99

include/texture.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

33
// clang-format off
4-
#include <glad/gl.h>
5-
#include <GLFW/glfw3.h>
4+
#include "glad/gl.h"
5+
#include "GLFW/glfw3.h"
66
// clang-format on
77

88
#include <filesystem>

include/window.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// clang format will change the input order which MUST be in this specific
44
// order
55
// clang-format off
6-
#include <glad/gl.h>
7-
#include <GLFW/glfw3.h>
6+
#include "glad/gl.h"
7+
#include "GLFW/glfw3.h"
88
// clang-format on
99

1010
#include <string>

src/main.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
// clang format will change the input order which MUST be in this specific
22
// order
33
// clang-format off
4-
#include <glad/gl.h>
5-
#include <GLFW/glfw3.h>
4+
#include "glad/gl.h"
5+
#include "GLFW/glfw3.h"
66
// clang-format on
77

88
#include <chrono>
99
#include <filesystem>
1010
#include <format>
11-
#include <glm/gtc/matrix_transform.hpp>
1211
#include <iostream>
1312

1413
#include "glm/ext/matrix_clip_space.hpp"
15-
#include "model.h"
16-
#include "shader.h"
17-
#include "window.h"
18-
14+
#include "glm/gtc/matrix_transform.hpp"
1915
#include "imgui.h"
2016
#include "imgui_impl_glfw.h"
2117
#include "imgui_impl_opengl3.h"
18+
#include "model.h"
19+
#include "shader.h"
20+
#include "window.h"
2221

2322
int main(int argc, const char** const argv) {
2423
if (argc != 2) {
@@ -37,11 +36,16 @@ int main(int argc, const char** const argv) {
3736
IMGUI_CHECKVERSION();
3837
ImGui::CreateContext();
3938
ImGuiIO& io = ImGui::GetIO();
40-
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
41-
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
39+
io.ConfigFlags |=
40+
ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
41+
io.ConfigFlags |=
42+
ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
4243

4344
// Setup Platform/Renderer backends
44-
ImGui_ImplGlfw_InitForOpenGL(window.GetWindow(), true); // Second param install_callback=true will install GLFW callbacks and chain to existing ones.
45+
ImGui_ImplGlfw_InitForOpenGL(
46+
window.GetWindow(),
47+
true); // Second param install_callback=true will install GLFW
48+
// callbacks and chain to existing ones.
4549
ImGui_ImplOpenGL3_Init();
4650

4751
Model model = Model(model_path);
@@ -114,7 +118,8 @@ int main(int argc, const char** const argv) {
114118
if (ms_elapsed > FPS_REPORT_INTERVAL_MS) {
115119
float fps = frames_displayed / (ms_elapsed / 1000.0f);
116120
std::cout << std::format(
117-
"[renderer2] {:.1f} FPS | {} vertices | {} triangles | {} meshes\n",
121+
"[renderer2] {:.1f} FPS | {} vertices | {} triangles | {} "
122+
"meshes\n",
118123
fps, vertex_count, triangle_count, mesh_count);
119124
frames_displayed = 0;
120125
past_time = std::chrono::steady_clock::now();

src/mesh.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include "mesh.h"
22

33
// clang-format off
4-
#include <glad/gl.h>
5-
#include <GLFW/glfw3.h>
4+
#include "glad/gl.h"
5+
#include "GLFW/glfw3.h"
66
// clang-format on
77

88
#include <cassert>

src/model.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
#include "model.h"
22

3-
#include <assimp/postprocess.h>
4-
#include <assimp/scene.h>
5-
#include <stb/stb_image.h>
6-
73
#include <algorithm>
8-
#include <assimp/Importer.hpp>
94
#include <format>
105
#include <iostream>
116

7+
#include "assimp/Importer.hpp"
8+
#include "assimp/postprocess.h"
9+
#include "assimp/scene.h"
10+
#include "stb/stb_image.h"
1211
#include "texture.h"
1312

1413
// clang-format off
15-
#include <glad/gl.h>
16-
#include <GLFW/glfw3.h>
14+
#include "glad/gl.h"
15+
#include "GLFW/glfw3.h"
1716
// clang-format on
1817

1918
Model::Model(const std::filesystem::path &path) { loadModel(path); }
@@ -25,15 +24,15 @@ void Model::Draw(Shader &shader) {
2524

2625
size_t Model::GetVertexCount() const {
2726
size_t total = 0;
28-
for (const auto& mesh : meshes) {
27+
for (const auto &mesh : meshes) {
2928
total += mesh.GetVertices().size();
3029
}
3130
return total;
3231
}
3332

3433
size_t Model::GetTriangleCount() const {
3534
size_t total = 0;
36-
for (const auto& mesh : meshes) {
35+
for (const auto &mesh : meshes) {
3736
total += mesh.GetIndices().size() / 3;
3837
}
3938
return total;

src/shader.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
// clang format will change the input order which MUST be in this specific
44
// order
55
// clang-format off
6-
#include <glad/gl.h>
7-
#include <GLFW/glfw3.h>
6+
#include "glad/gl.h"
7+
#include "GLFW/glfw3.h"
88
// clang-format on
99

1010
#include <filesystem>
1111
#include <fstream>
12-
#include <glm/gtc/matrix_transform.hpp>
13-
#include <glm/gtc/type_ptr.hpp>
1412
#include <iostream>
1513
#include <sstream>
1614
#include <stdexcept>
1715

16+
#include "glm/gtc/matrix_transform.hpp"
17+
#include "glm/gtc/type_ptr.hpp"
18+
1819
bool CheckShaderCompileSuccess(unsigned int shader_id) {
1920
int success;
2021
char infoLog[512];

0 commit comments

Comments
 (0)