Re: [Plib-devel] Texture and blend modes
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2000-08-18 18:17:09
|
Sam Stickland wrote: > How are these specified in ssg? I'll take a wild guess that ssg > doesn't manage texture environment modes (GL_MODULATE, GL_DECAL etc.) > at all, and it only cares whether blending is on or off. Well, when you add a texture into an ssgSimpleState, you can either pass it an 'ssgTexture' or an OpenGL texture handle - or even a filename (which will result in an ssgTexture being constructed on your behalf). Hence, there are really just two options - ssgTexture or do-it-yourself. ssgTexture does indeed only specify GL_MODULATE - it's hard-wired in the constructor function with no way to change it. > So, do I set the required mode in a predraw callback function? You have (at least) five options: 1) Derive a new class from ssgTexture (say ssgDecalTexture) that does GL_DECAL instead of GL_MODULATE. 2) Load the texture yourself, do the glBindTexture, set GL_DECAL using glTexEnvi, pass the texture handle to SSG. 3) In a pre-draw callback, set the glTexEnv to GL_DECAL. 4) Use ssgTexture to load the texture and do either a ssgSimpleState::getTextureHandle() or an ssgTexture::getHandle() to get the texture handle. Then you can glBindTexture(handle) and change the glTexEnv setting. 5) Edit the SSG source code to add 'setEnvMode/getEnvMode' methods to ssgTexture - then contribute your change via CVS and earn fame, the recognition of your peers, etc, etc. While you are about it - add Mag/Min filter and texture wrap options. People who know me well soon realise that I ALWAYS put my most favored option at the end of a list of choices. :-) -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net |