
Loading Textures
Posted Tuesday, 5 February, 2008 - 11:44 by Datriot inI'm pretty new to OpenGL, as I've been a DirectX use for the most part. I must say that texture loading and usage is quite different in OpenGL and I'm not sure how to go about loading and displaying one ( preferably on a quad ).
There's some tutorials out there, but one catered for OpenTK would be helpful so help would be appreciated. :)


Comments
Re: Loading Textures
Well that's good then, at least I know I won't have to re-do what I've so far for a more effective method.
Re: Loading Textures
These kind of things would be wonderful to have in the OpenTK.Utilities.dll !
Just imagine:
Texture tex = OpenTK.Utilities.Texture.Load("c:/mypic.png");
.. where Load() sets some sane defaults for the tex object.
Re: Loading Textures
Inertia has written a .dds loader which works almost exactly like this. I'm doing the same for .wav and .ogg files, so this functionality will appear in OpenTK.Utilities sooner or later. ;)
Re: Loading Textures
There's a GDI+ loader aswell http://www.opentk.com/node/253
The idea of the utilities.dll is to draw a clean line between bindings and higher level functions. Some people might only want to use OpenTK.dll and deal with asset/content loading on their own, since the loaders are not optimized for speed (and will probably never be). No matter how much one would optimize the .dds loader there will always be the need to flip the image upside down (DirectX vs. OpenGL texture matrix) and we cannot make it faster than the user can: by creating his custom file format and save/load (the already flipped image which the utilities.dll gave you) directly.
However unless you're loading 100MB+ of textures the OpenTK loaders will serve you well.