#189 Bug in ilut_directx9.c

open
nobody
None
5
2010-03-14
2010-03-14
Anonymous
No

In ilut_directx9.c, in the function MakeD3D9Compliant(), the first declaration is "ILuint color". Using an unsigned integer here causes the "perform alpha key on images if requested" test further below in the function to always pass, causing white pixels to have transparency, usually resulting in ugly patterns. Using ILint instead fixes it.

Another issue is that the function scales the image to power-of-two dimensions even if the device supports non-power-of-two textures. An ILUT state should be added to allow the user to control this or something.

Another thing is that ilutD3D9TexFromFile() seems to perform considerably worse than the following:
ilInit();
iluInit();
ilutInit();

ILuint iImage = (ILuint)-1;
ilGenImages( 1, &iImage );
ilBindImage( iImage );

if( IL_TRUE == ilLoadImage( sNewTexture ) )
pTexture = ilutD3D9Texture( g_pD3DDevice );

Finally, it was a real pain to be able to use DevIL in my DirectX 9 application because I'm using the Express Edition of Visual C++, so I couldn't compile DevIL using it, and DX9 support is compiled out of ILUT by default :(
In <a href="http://my.opera.com/adelamro/blog/2010/03/13/loading-directx-textures-using-devil-and-visual-c-express-edition">this</a> blog post I describe how I managed to use it anyway, in case someone else needs it.

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks