lid6j86's picture

Texture manager

I was wondering about texture management with OpenTK.

I am reading a book that provides TAO examples and recommends Devil as a texture manager, but as I understand OpenTK is far more complete than TAO ever was. My question is two-fold. Does OpenTK provide texture management? if not, what would you recommend I use?

I'm new to textures so I have no idea how to work them yet.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
flopoloco's picture

The difference between Devil and .NET while loading images is that .NET supports most common image types out of the box, speaking of JPG, PNG, BMP. I don't know about other image types but chances are that rarely used due to practical reasons (for example I think that Devil supports the ancient TGA format that was popular in the late 90s) and efficiency (if you want compressed images then JPG is the way to go, why use GIF?).

Regarding loading images into OpenGL:
1. You have to load the image with .NET
2. Make some .NET " tricks" (standard sequence of commands) to send it to GPU memory and get a handle of the image.
3. Then all you need is to have the appropriate UV data related to vertices and you render you get texture rendering.

I have made an example recently so check the part that loads the texture.

lid6j86's picture

thanks for the example.

It looks clean and simple (something more difficult to find that it should be)

flopoloco's picture

I like making clean and simple code, it takes more effort but it's for the better, better code quality that leads to fewer bugs.

lid6j86's picture

the biggest problem i have is that i have to see the absolute most basic torn down version so i know what is necessary. that way i can rebuild everything else and understand how the code is optimized or why other things are added. i'm still trying to wrap my head around textures but its getting better. textures are difficult to get started with. sometimes i feel like im spinning my wheels