Closed SpartanJ closed 5 years ago
Original comment by Edvin Hansson (Bitbucket: [Edvin Hansson](https://bitbucket.org/Edvin Hansson), ).
Hi again!
I don’t feel like that’s the issue. The parameter I’m using for “std::ifstream” should start the cursor at the end of the file already and the size matches with the file when I check via debugging.
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).
Oh, sorry, you’re right about that. But I still don’t think this is a bug from the library. I took your code and made a minimal example and works. You can use the code to find your problem: https://puu.sh/DFXrM/3fba7c7b28.cpp
Original comment by Edvin Hansson (Bitbucket: [Edvin Hansson](https://bitbucket.org/Edvin Hansson), ).
I’ve realized what the problem was…
I didn’t use std::ios::binary when loading the file…
std::ifstream stream("test.dds", std::ios::ate);
std::ifstream stream("test.dds", std::ios::binary | std::ios::ate);
I knew it would be something like this. I should have gone through each line thoroughly before creating an issue, sorry about that.
Thanks for trying to help me out though! Hopefully someone else with the same “problem” runs into this thread in the future.
Cheers!
Original report by Anonymous.
Hi!
I'm having problems loading a DDS file from memory. Loading it via "SOIL_load_OGL_texture" works perfectly while "SOIL_load_OGL_texture_from_memory" only partially loads the image with a corrupted palette.
Here's the code I'm using, maybe I'm missing something obvious.
I've attached the DDS file I'm testing on and comparisons between outside and inside of the application.
Cheers!