-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Division by Zero in SOIL_load_OGL_texture on VS2017 15.9.11 #24
Comments
Original comment by Michael Legner (Bitbucket: Sokar, GitHub: Sokar). Hi Martin, If created a small application with which I can reproduce it just fine: https://bitbucket.org/Sokar/soil_issue24/src/master/ the image use ist "img_test.bmp" from the bin folder of SOIL2. I also got a bit more information, the exception happens in Line 1618 of Soil2.c which reads
with reduce_block_x being zero. I hope it helps to reproduce the exception. |
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). You must initialize an OpenGL context before trying to load any image. Your example will never work. It's crashing in that line because it's being unable to determine the max texture size, because there's no GL context to obtain it. Regards |
Original report by Michael Legner (Bitbucket: Sokar, GitHub: Sokar).
Hi,
I'm currently working with the Book "Computer Graphics Programming in OpenGL with C++" ( http://merclearning.com/titles/Computer_Graphics_Programming_in_OpenGL_with_C++.html ) which uses your library to load textures.
Unfortunatly, I encountered a problem with it: just calling SOIL_load_OGL_texture as described in the book results in division by zero exception.
Code:
GLuint texId = SOIL_load_OGL_texture(texFilePath.c_str(), SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_INVERT_Y);
texFilePath is a std::string and valid path, otherwise SOIL results in "unable to fopen" error. Loading with stb_image.h works. I'm on Windows 10 x64 in Visual Studio 2017 Community Edition Version 15.9.11.
The text was updated successfully, but these errors were encountered: