some DevIL and OpenGL texture questions
Hi all,
after some time I decided to move to OpenGL from DirectX, found DevIL for image manipulations, but seems that I cannot find some answers on net. These questions may seem trivial, but I'm a pretty new to OpenGL.
First of all, if I load texture with DevIL and draw one rectangle, the UV coordinates seems tumbled up, like mirrored image. Probably I'm missing some parameter flag, because if I load it normally, the image is shown properly. What I'm missing?
Also is this enough to load image? :
ilInit();
ilutInit();
ilutRenderer( ILUT_OPENGL );
tex_id = ilutGLLoadImage( "cp.jpg" );
the texture is shown properly, but do I need:
ILuint handle = ilGenImage();
ilBindImage( handle );
because is working without it.
And last one, when I load texture with:
ilLoadDataL( pData, lDataSize, width, height,16,16 );
how can I make OpenGL texture from it?
thanks in advance
If the textures is showing up upside down it is probably because in DirectX the coordinate 0,0 is at the top left of the image and in OpenGL the coordinate 0,0 is at the bottom left of the image. I haven't used DevIL since they were known as OpenIL so I can't help you much on the rest. If you can't find answers here you can also try the DevIL Help forum, they have a link to their forums on the DevIL home page on the right side.
Quote:Original post by Brad789
If the textures is showing up upside down it is probably because in DirectX the coordinate 0,0 is at the top left of the image and in OpenGL the coordinate 0,0 is at the bottom left of the image. I haven't used DevIL since they were known as OpenIL so I can't help you much on the rest. If you can't find answers here you can also try the DevIL Help forum, they have a link to their forums on the DevIL home page on the right side.
Thanks for your reply. I just flipped UV coordinates so it is not so big problem.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement