Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/libprojectM/Renderer/TextureManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,23 @@ auto TextureManager::LoadTexture(const ScannedFile& file) -> std::shared_ptr<Tex

int width{};
int height{};
int channels{};

unsigned int const tex = SOIL_load_OGL_texture(
file.filePath.c_str(),
SOIL_LOAD_RGBA,
std::unique_ptr<unsigned char, decltype(&SOIL_free_image_data)> imageData(SOIL_load_image(file.filePath.c_str(), &width, &height, &channels, SOIL_LOAD_RGBA), SOIL_free_image_data);

if (imageData == nullptr)
{
return {};
}

unsigned int const tex = SOIL_create_OGL_texture(
imageData.get(),
&width, &height, SOIL_LOAD_RGBA,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_MULTIPLY_ALPHA);

imageData.reset();

if (tex == 0)
{
return {};
Expand Down
1 change: 1 addition & 0 deletions src/libprojectM/UserSprites/MilkdropSprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace UserSprites {
MilkdropSprite::MilkdropSprite()
: m_mesh(Renderer::VertexBufferUsage::DynamicDraw, false, true)
{
m_mesh.SetRenderPrimitiveType(Renderer::Mesh::PrimitiveType::TriangleStrip);
m_mesh.SetVertexCount(4);
}

Expand Down
Loading