summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
Diffstat (limited to 'gfx')
-rw-r--r--gfx/camera_controller.h5
-rw-r--r--gfx/followCameraController.h4
-rw-r--r--gfx/gl/camera.h5
-rw-r--r--gfx/gl/glSource.h5
-rw-r--r--gfx/gl/programHandle.h5
-rw-r--r--gfx/gl/shader.h5
-rw-r--r--gfx/gl/uiShader.h5
-rw-r--r--gfx/image.h5
-rw-r--r--gfx/models/mesh.h5
-rw-r--r--gfx/models/obj.h5
-rw-r--r--gfx/models/stb_image.c4
-rw-r--r--gfx/models/stb_image.impl.c2
-rw-r--r--gfx/models/texture.h5
-rw-r--r--gfx/models/vertex.hpp5
-rw-r--r--gfx/renderable.h5
15 files changed, 15 insertions, 55 deletions
diff --git a/gfx/camera_controller.h b/gfx/camera_controller.h
index e6fc16d..fd5c885 100644
--- a/gfx/camera_controller.h
+++ b/gfx/camera_controller.h
@@ -1,5 +1,4 @@
-#ifndef CAMERA_CONTROLLER_H
-#define CAMERA_CONTROLLER_H
+#pragma once
#include <special_members.hpp>
@@ -13,5 +12,3 @@ public:
virtual void updateCamera(Camera *) const = 0;
};
-
-#endif
diff --git a/gfx/followCameraController.h b/gfx/followCameraController.h
index cfe70c2..63010c2 100644
--- a/gfx/followCameraController.h
+++ b/gfx/followCameraController.h
@@ -1,5 +1,4 @@
-#ifndef FOLLOW_CAMERA_CONTROLLER_H
-#define FOLLOW_CAMERA_CONTROLLER_H
+#pragma once
#include <game/vehicles/vehicle.h>
#include <gfx/camera_controller.h>
@@ -17,4 +16,3 @@ private:
VehicleWPtr target;
Mode mode;
};
-#endif
diff --git a/gfx/gl/camera.h b/gfx/gl/camera.h
index 1d3f5b3..9fbb0a1 100644
--- a/gfx/gl/camera.h
+++ b/gfx/gl/camera.h
@@ -1,5 +1,4 @@
-#ifndef CAMERA_INCLUDED_H
-#define CAMERA_INCLUDED_H
+#pragma once
#include <glm/glm.hpp>
@@ -17,5 +16,3 @@ public:
private:
glm::mat4 projection;
};
-
-#endif
diff --git a/gfx/gl/glSource.h b/gfx/gl/glSource.h
index 7b43c48..c6b1f41 100644
--- a/gfx/gl/glSource.h
+++ b/gfx/gl/glSource.h
@@ -1,5 +1,4 @@
-#ifndef SHADER_SOURCE_H
-#define SHADER_SOURCE_H
+#pragma once
#include <GL/glew.h>
#include <glRef.hpp>
@@ -15,5 +14,3 @@ struct GLsource {
[[nodiscard]] ShaderRef compile() const;
static void CheckShaderError(GLuint shader, GLuint flag, bool isProgram, std::string_view errorMessage);
};
-
-#endif
diff --git a/gfx/gl/programHandle.h b/gfx/gl/programHandle.h
index 5bd5c05..a2a7a2d 100644
--- a/gfx/gl/programHandle.h
+++ b/gfx/gl/programHandle.h
@@ -1,5 +1,4 @@
-#ifndef PROGRAM_HANDLE_H
-#define PROGRAM_HANDLE_H
+#pragma once
#include <GL/glew.h>
#include <glRef.hpp>
@@ -12,5 +11,3 @@ public:
ProgramRef m_program;
GLint viewProjection_uniform, model_uniform;
};
-
-#endif
diff --git a/gfx/gl/shader.h b/gfx/gl/shader.h
index 7df7a07..8411b94 100644
--- a/gfx/gl/shader.h
+++ b/gfx/gl/shader.h
@@ -1,5 +1,4 @@
-#ifndef SHADER_INCLUDED_H
-#define SHADER_INCLUDED_H
+#pragma once
#include "programHandle.h"
#include <GL/glew.h>
@@ -26,5 +25,3 @@ private:
std::array<ProgramHandle, 4> programs;
};
-
-#endif
diff --git a/gfx/gl/uiShader.h b/gfx/gl/uiShader.h
index 502ba13..ea5bf25 100644
--- a/gfx/gl/uiShader.h
+++ b/gfx/gl/uiShader.h
@@ -1,5 +1,4 @@
-#ifndef UISHADER_H
-#define UISHADER_H
+#pragma once
#include "programHandle.h"
#include <GL/glew.h>
@@ -18,5 +17,3 @@ private:
};
UIProgramHandle progDefault, progText;
};
-
-#endif
diff --git a/gfx/image.h b/gfx/image.h
index 23e9a9b..47437ca 100644
--- a/gfx/image.h
+++ b/gfx/image.h
@@ -1,5 +1,4 @@
-#ifndef IMAGE_H
-#define IMAGE_H
+#pragma once
#include <span> // IWYU pragma: export
#include <special_members.hpp>
@@ -17,5 +16,3 @@ public:
unsigned int width, height, numComponents;
std::span<unsigned char> data;
};
-
-#endif
diff --git a/gfx/models/mesh.h b/gfx/models/mesh.h
index 9b74f48..c6f11a2 100644
--- a/gfx/models/mesh.h
+++ b/gfx/models/mesh.h
@@ -1,5 +1,4 @@
-#ifndef MESH_INCLUDED_H
-#define MESH_INCLUDED_H
+#pragma once
#include <GL/glew.h>
#include <glArrays.h>
@@ -21,5 +20,3 @@ private:
GLenum mode;
};
using MeshPtr = std::shared_ptr<const Mesh>;
-
-#endif
diff --git a/gfx/models/obj.h b/gfx/models/obj.h
index 6db16c0..e28f7de 100644
--- a/gfx/models/obj.h
+++ b/gfx/models/obj.h
@@ -1,5 +1,4 @@
-#ifndef OBJ_H
-#define OBJ_H
+#pragma once
#ifndef yyFlexLexer
# define yyFlexLexer objbaseFlexLexer
@@ -37,5 +36,3 @@ public:
using NamedMeshes = std::map<std::string, std::shared_ptr<const Mesh>>;
[[nodiscard]] NamedMeshes createMeshes() const;
};
-
-#endif
diff --git a/gfx/models/stb_image.c b/gfx/models/stb_image.c
deleted file mode 100644
index c15369e..0000000
--- a/gfx/models/stb_image.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef TIDY
-# define STB_IMAGE_IMPLEMENTATION
-# include "stb/stb_image.h"
-#endif
diff --git a/gfx/models/stb_image.impl.c b/gfx/models/stb_image.impl.c
new file mode 100644
index 0000000..38c72e9
--- /dev/null
+++ b/gfx/models/stb_image.impl.c
@@ -0,0 +1,2 @@
+#define STB_IMAGE_IMPLEMENTATION
+#include "stb/stb_image.h"
diff --git a/gfx/models/texture.h b/gfx/models/texture.h
index e029a9b..04aa9ec 100644
--- a/gfx/models/texture.h
+++ b/gfx/models/texture.h
@@ -1,5 +1,4 @@
-#ifndef TEXTURE_H
-#define TEXTURE_H
+#pragma once
#include <cache.h>
#include <filesystem>
@@ -18,5 +17,3 @@ public:
private:
glTexture m_texture;
};
-
-#endif
diff --git a/gfx/models/vertex.hpp b/gfx/models/vertex.hpp
index 3d7f933..f2e38f6 100644
--- a/gfx/models/vertex.hpp
+++ b/gfx/models/vertex.hpp
@@ -1,5 +1,4 @@
-#ifndef VERTEX_H
-#define VERTEX_H
+#pragma once
#include <glm/glm.hpp>
@@ -14,5 +13,3 @@ public:
glm::vec2 texCoord;
glm::vec3 normal;
};
-
-#endif
diff --git a/gfx/renderable.h b/gfx/renderable.h
index dea36c6..565f705 100644
--- a/gfx/renderable.h
+++ b/gfx/renderable.h
@@ -1,5 +1,4 @@
-#ifndef RENDERABLE_H
-#define RENDERABLE_H
+#pragma once
#include <special_members.hpp>
@@ -13,5 +12,3 @@ public:
virtual void render(const Shader & shader) const = 0;
};
-
-#endif