Removes Assimp dependency. Changes the asset loading process to use a queue system for texture uploads to OpenGL, which improves performance by offloading the texture loading to the main thread. The asset manager now directly loads texture data using stb_image and uploads it to the GPU in the main thread, eliminating the need for Assimp.
27 lines
457 B
C++
27 lines
457 B
C++
//
|
|
// Created by spenc on 5/21/2025.
|
|
//
|
|
|
|
|
|
#include "Texture2D.h"
|
|
#define STB_IMAGE_IMPLEMENTATION
|
|
#include <stb/stb_image.h>
|
|
#include <GL/glew.h>
|
|
#include "Texture2D.h"
|
|
|
|
namespace OX {
|
|
|
|
Texture2D::~Texture2D() {
|
|
if (m_TextureID)
|
|
glDeleteTextures(1, &m_TextureID);
|
|
}
|
|
|
|
void Texture2D::SetFromGL(uint32_t texID, int width, int height) {
|
|
m_TextureID = texID;
|
|
m_Width = width;
|
|
m_Height = height;
|
|
}
|
|
|
|
}
|
|
|