Dicewars-Siedler/src/engine/renderer/loader/Loader.h
2026-02-07 19:44:07 +01:00

37 lines
970 B
C++

//
// Created by sebastian on 24.12.25.
//
#ifndef DICEWARS_SIEDLER_LOADER_H
#define DICEWARS_SIEDLER_LOADER_H
#include <string>
#include <vector>
#include "../model/RawModel.h"
#include "../textures/ModelTexture.h"
#include "glad/glad.h"
class Loader
{
public:
RawModel loadToVAO(const std::vector<float> &vertices, const std::vector<float> &normals, const std::vector<float> &textureCoords, const
std::vector<int> &indices);
~Loader();
void cleanUp();
ModelTexture loadTextureFromFile(const std::string& path);
private:
GLuint createVAO();
GLuint loadTexture(const std::string &path);
void storeDataInAttributeList(int attributeNumber, int coordinateSize, const std::vector<float> &data);
void bindIndicesBuffer(const std::vector<int> &indices);
void unbindVAO();
std::vector<GLuint> vaoIDs;
std::vector<GLuint> vboIDs;
std::vector<GLuint> textureIDs;
};
#endif //DICEWARS_SIEDLER_LOADER_H