src/graphics moved to src/graphics/core

This commit is contained in:
MihailRis
2024-03-18 20:47:35 +03:00
parent ba762584a7
commit b56408a202
63 changed files with 156 additions and 147 deletions
@@ -1,7 +1,7 @@
#include "Atlas.h"
#include <stdexcept>
#include "../maths/LMPacker.h"
#include "../../maths/LMPacker.h"
#include "Texture.h"
#include "ImageData.h"
@@ -1,5 +1,5 @@
#ifndef GRAPHICS_ATLAS_H_
#define GRAPHICS_ATLAS_H_
#ifndef GRAPHICS_CORE_ATLAS_H_
#define GRAPHICS_CORE_ATLAS_H_
#include <set>
#include <string>
@@ -7,7 +7,7 @@
#include <vector>
#include <unordered_map>
#include "UVRegion.h"
#include "../typedefs.h"
#include "../../typedefs.h"
class ImageData;
class Texture;
@@ -45,4 +45,4 @@ public:
Atlas* build(uint extrusion, uint maxResolution=8192);
};
#endif // GRAPHICS_ATLAS_H_
#endif // GRAPHICS_CORE_ATLAS_H_
@@ -1,5 +1,5 @@
#ifndef SRC_GRAPHICS_BATCH2D_H_
#define SRC_GRAPHICS_BATCH2D_H_
#ifndef GRAPHICS_CORE_BATCH2D_H_
#define GRAPHICS_CORE_BATCH2D_H_
#include <memory>
#include <stdlib.h>
@@ -87,4 +87,4 @@ public:
void lineWidth(float width);
};
#endif /* SRC_GRAPHICS_BATCH2D_H_ */
#endif // GRAPHICS_CORE_BATCH2D_H_
@@ -4,7 +4,7 @@
#include "Texture.h"
#include <GL/glew.h>
#include "../typedefs.h"
#include "../../typedefs.h"
inline constexpr uint B3D_VERTEX_SIZE = 9;
@@ -1,8 +1,8 @@
#ifndef GRAPHICS_BATCH3D_H_
#define GRAPHICS_BATCH3D_H_
#ifndef GRAPHICS_CORE_BATCH3D_H_
#define GRAPHICS_CORE_BATCH3D_H_
#include "UVRegion.h"
#include "../typedefs.h"
#include "../../typedefs.h"
#include <memory>
#include <stdlib.h>
@@ -51,4 +51,4 @@ public:
void flushPoints();
};
#endif /* GRAPHICS_BATCH3D_H_ */
#endif // GRAPHICS_CORE_BATCH3D_H_
@@ -1,5 +1,5 @@
#ifndef GRAPHICS_CUBEMAP_H_
#define GRAPHICS_CUBEMAP_H_
#ifndef GRAPHICS_CORE_CUBEMAP_H_
#define GRAPHICS_CORE_CUBEMAP_H_
#include "Texture.h"
@@ -12,4 +12,4 @@ public:
virtual void unbind() override;
};
#endif // GRAPHICS_CUBEMAP_H_
#endif // GRAPHICS_CORE_CUBEMAP_H_
@@ -1,10 +1,10 @@
#ifndef GRAPHICS_FONT_H_
#define GRAPHICS_FONT_H_
#ifndef GRAPHICS_CORE_FONT_H_
#define GRAPHICS_CORE_FONT_H_
#include <memory>
#include <string>
#include <vector>
#include "../typedefs.h"
#include "../../typedefs.h"
class Texture;
class Batch2D;
@@ -40,4 +40,4 @@ public:
void draw(Batch2D* batch, std::wstring_view text, int x, int y, FontStyle style);
};
#endif /* GRAPHICS_FONT_H_ */
#endif // GRAPHICS_CORE_FONT_H_
@@ -1,7 +1,7 @@
#ifndef SRC_GRAPHICS_FRAMEBUFFER_H_
#define SRC_GRAPHICS_FRAMEBUFFER_H_
#ifndef GRAPHICS_CORE_FRAMEBUFFER_H_
#define GRAPHICS_CORE_FRAMEBUFFER_H_
#include "../typedefs.h"
#include "../../typedefs.h"
#include <memory>
@@ -39,4 +39,4 @@ public:
uint getHeight() const;
};
#endif /* SRC_GRAPHICS_FRAMEBUFFER_H_ */
#endif // GRAPHICS_CORE_FRAMEBUFFER_H_
@@ -1,9 +1,9 @@
#ifndef GRAPHICS_GFX_CONTEXT_H_
#define GRAPHICS_GFX_CONTEXT_H_
#ifndef GRAPHICS_CORE_GFX_CONTEXT_H_
#define GRAPHICS_CORE_GFX_CONTEXT_H_
#include "../typedefs.h"
#include "Viewport.h"
#include "../window/Window.h"
#include "../../window/Window.h"
#include "../../typedefs.h"
class Batch2D;
class Framebuffer;
@@ -35,4 +35,4 @@ public:
void setScissors(glm::vec4 area);
};
#endif // GRAPHICS_GFX_CONTEXT_H_
#endif // GRAPHICS_CORE_GFX_CONTEXT_H_
@@ -1,7 +1,7 @@
#ifndef GRAPHICS_IMAGE_DATA_H_
#define GRAPHICS_IMAGE_DATA_H_
#ifndef GRAPHICS_CORE_IMAGE_DATA_H_
#define GRAPHICS_CORE_IMAGE_DATA_H_
#include "../typedefs.h"
#include "../../typedefs.h"
enum class ImageFormat {
rgb888,
@@ -46,4 +46,4 @@ public:
extern ImageData* add_atlas_margins(ImageData* image, int grid_size);
#endif // GRAPHICS_IMAGE_DATA_H_
#endif // GRAPHICS_CORE_IMAGE_DATA_H_
@@ -1,5 +1,5 @@
#ifndef GRAPHICS_LINEBATCH_H_
#define GRAPHICS_LINEBATCH_H_
#ifndef GRAPHICS_CORE_LINEBATCH_H_
#define GRAPHICS_CORE_LINEBATCH_H_
#include <memory>
#include <stdlib.h>
@@ -33,4 +33,4 @@ public:
void lineWidth(float width);
};
#endif /* GRAPHICS_LINEBATCH_H_ */
#endif // GRAPHICS_CORE_LINEBATCH_H_
@@ -1,8 +1,8 @@
#ifndef GRAPHICS_MESH_H_
#define GRAPHICS_MESH_H_
#ifndef GRAPHICS_CORE_MESH_H_
#define GRAPHICS_CORE_MESH_H_
#include <stdlib.h>
#include "../typedefs.h"
#include "../../typedefs.h"
struct vattr {
ubyte size;
@@ -39,4 +39,4 @@ public:
static int meshesCount;
};
#endif /* GRAPHICS_MESH_H_ */
#endif // GRAPHICS_CORE_MESH_H_
@@ -1,5 +1,5 @@
#ifndef GRAPHICS_POST_PROCESSING_H_
#define GRAPHICS_POST_PROCESSING_H_
#ifndef GRAPHICS_CORE_POST_PROCESSING_H_
#define GRAPHICS_CORE_POST_PROCESSING_H_
#include "Viewport.h"
#include "GfxContext.h"
@@ -34,4 +34,4 @@ public:
void render(const GfxContext& context, Shader* screenShader);
};
#endif // GRAPHICS_POST_PROCESSING_H_
#endif // GRAPHICS_CORE_POST_PROCESSING_H_
@@ -4,13 +4,14 @@
#include <fstream>
#include <iostream>
#include <sstream>
#include <filesystem>
#include <glm/gtc/type_ptr.hpp>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include "../coders/GLSLExtension.h"
#include "../../coders/GLSLExtension.h"
namespace fs = std::filesystem;
@@ -1,9 +1,9 @@
#ifndef GRAPHICS_SHADER_H_
#define GRAPHICS_SHADER_H_
#ifndef GRAPHICS_CORE_SHADER_H_
#define GRAPHICS_CORE_SHADER_H_
#include <string>
#include <glm/glm.hpp>
#include "../typedefs.h"
#include "../../typedefs.h"
class GLSLExtension;
@@ -33,4 +33,4 @@ public:
);
};
#endif /* GRAPHICS_SHADER_H_ */
#endif // GRAPHICS_SHADER_H_
@@ -1,8 +1,8 @@
#ifndef GRAPHICS_TEXTURE_H_
#define GRAPHICS_TEXTURE_H_
#ifndef GRAPHICS_CORE_TEXTURE_H_
#define GRAPHICS_CORE_TEXTURE_H_
#include <string>
#include "../typedefs.h"
#include "../../typedefs.h"
#include "ImageData.h"
class Texture {
@@ -31,4 +31,4 @@ public:
static Texture* from(const ImageData* image);
};
#endif /* GRAPHICS_TEXTURE_H_ */
#endif // GRAPHICS_CORE_TEXTURE_H_
@@ -1,7 +1,7 @@
#ifndef TEXTURE_ANIMATION_H
#define TEXTURE_ANIMATION_H
#ifndef GRAPHICS_CORE_TEXTURE_ANIMATION_H_
#define GRAPHICS_CORE_TEXTURE_ANIMATION_H_
#include "../typedefs.h"
#include "../../typedefs.h"
#include <glm/glm.hpp>
#include <vector>
@@ -49,4 +49,4 @@ private:
std::vector<TextureAnimation> animations;
};
#endif // !TEXTURE_ANIMATION_H
#endif // GRAPHICS_CORE_TEXTURE_ANIMATION_H_
@@ -1,5 +1,5 @@
#ifndef SRC_GRAPHICS_UVREGION_H_
#define SRC_GRAPHICS_UVREGION_H_
#ifndef GRAPHICS_CORE_UVREGION_H_
#define GRAPHICS_CORE_UVREGION_H_
class UVRegion {
public:
@@ -14,4 +14,4 @@ public:
UVRegion() : u1(0.0f), v1(0.0f), u2(1.0f), v2(1.0f){}
};
#endif /* SRC_GRAPHICS_UVREGION_H_ */
#endif // SRC_GRAPHICS_UVREGION_H_
@@ -1,9 +1,9 @@
#ifndef GRAPHICS_VIEWPORT_H_
#define GRAPHICS_VIEWPORT_H_
#ifndef GRAPHICS_CORE_VIEWPORT_H_
#define GRAPHICS_CORE_VIEWPORT_H_
#include <glm/glm.hpp>
#include "../typedefs.h"
#include "../../typedefs.h"
class Viewport {
uint width;
@@ -1,5 +1,5 @@
#ifndef GRAPHICS_GL_UTIL_H_
#define GRAPHICS_GL_UTIL_H_
#ifndef GRAPHICS_CORE_GL_UTIL_H_
#define GRAPHICS_CORE_GL_UTIL_H_
#include <GL/glew.h>
@@ -16,4 +16,4 @@ namespace gl {
}
}
#endif // GRAPHICS_GL_UTIL_H_
#endif // GRAPHICS_CORE_GL_UTIL_H_