drawcode / oolongengine

Automatically exported from code.google.com/p/oolongengine
0 stars 0 forks source link

CTexture::LoadTextureFromImageFile(...) does not function as intended by the code #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In Texture.mm -> unsigned int CTexture::LoadTextureFromImageFile(...)  :

the main else block in the member function LoadTextureFromImageFile (line 92) 
looks like it is intended to put a 4 color texture in case the image was not 
able to be loaded (providing a visual cue if the texture failed to load) .  
This is nice however it fails because of the below:

line 92 declares a scope local variable  GLuint textureID; which hides the 
previous textureID declared in the same function above on line 48.  This 
consequently means the textureId output variable (2nd argument) is not set to 
the newly created texture name , instead it returns 0 .  

Not a big deal if your texture is able to load, but if it doesn't load you 
don't get an error from the function and yet no texture is created.

Original issue reported on code.google.com by efsk...@gmail.com on 1 Jan 2012 at 11:20

GoogleCodeExporter commented 9 years ago
I should have mentioned, removing line 92 is all that is required to that is 
required to fix this.

Original comment by efsk...@gmail.com on 1 Jan 2012 at 11:21

GoogleCodeExporter commented 9 years ago
good point, fixed here: 
http://code.google.com/p/oolongengine/source/detail?r=220

Original comment by erwin.coumans on 19 Apr 2012 at 3:08