started on assimp importing and texture stuff

This commit is contained in:
2026-05-01 20:06:54 -05:00
parent cb1d8f753d
commit f9010eea81
20 changed files with 8673 additions and 42 deletions

36
src/Texture.h Normal file
View File

@@ -0,0 +1,36 @@
//
// Created by lbmas on 4/29/2026.
//
#ifndef B_ENGINE_TEXTURE_H
#define B_ENGINE_TEXTURE_H
#include <memory>
#include <string_view>
#include <string>
class Texture
{
public:
static std::shared_ptr<Texture> load_from_file(std::string_view filePath);
static std::shared_ptr<Texture> load_from_data(unsigned char* data, int width, int height, int channels);
Texture() = default;
~Texture();
void bind(unsigned int slot);
void unbind();
[[nodiscard]] int get_width() const { return width; }
[[nodiscard]] int get_height() const { return height; }
[[nodiscard]] int get_channels() const { return channels; }
private:
unsigned int id = 0;
std::string filePath;
int width = 0;
int height = 0;
int channels = 0;
};
#endif //B_ENGINE_TEXTURE_H