--- a/Shark.h Sun Nov 26 16:27:50 2023 +0100
+++ b/Shark.h Tue Nov 28 22:45:33 2023 +0100
@@ -34,6 +34,7 @@
#include "EPoll.h"
#include "Logger.h"
#include "MappedFile.h"
+#include "ImageLoader.h"
class Shark {
private:
@@ -155,11 +156,21 @@
} initialCtx, ctx;
- const struct {
- int width = 640;
- int height = 398;
- GLfloat ratio = (GLfloat) width / (GLfloat) height;
- } TEX;
+ class Texture {
+ public:
+ GLuint id;
+ std::string fileName;
+ int width;
+ int height;
+
+ GLfloat getRatio() const {
+ return (GLfloat) width / (GLfloat) height;
+ }
+ };
+
+ ImageLoader imageLoader;
+
+ std::vector<Texture> textures;
Configuration cfg;
std::ostream& logOutput = std::cerr;
@@ -170,7 +181,7 @@
void log(LogLevel level, std::string message);
int setNonBlocking(int fd);
void loadVertices();
- GLuint loadTexture(const std::string& fileName, int width, int height);
+ Texture loadTexture(const std::string& fileName);
void loadTextures(GLuint shaderProgram);
GLuint loadShaders();
public: