i make a small game with SDL+OpenGL
and now i have this problem
how to draw only a single part of an GLuint texture(like clips in SDL)
i make a small game with SDL+OpenGL
and now i have this problem
how to draw only a single part of an GLuint texture(like clips in SDL)
what’s a ‘single part of a texture’?
You could use a smaller range for your texture coordinates rather than 0.0 --> 1.0. You can now render anything from a single texel to the entire texture.
i mean a small part of an image
You can’t draw a texture. You can only draw polygons and apply a texture to them. How the texture appears depends on texture coordinates. You might want to read the OpenGL programming guide. It teaches the basics.
Basically, you use coordinates such as {0.0, 0.5}