View Full Version : glTexGen*() ????????
How do I use glTexGen*() function
03-10-2001, 01:20 AM
Lesson 6 on NeHe site.
Salut Leyder Dylan
je c comment appliquer des textures pis toute le kit..... je veux savoir comment utiliser la function glTexGen*() qui sert a generer les coordonner de la texture en passant..
03-10-2001, 05:21 AM
What's the problem you're having with it. It's a straight forward function. You give it 2 paramaters. The first is the number of textures you want it to generate IDs for, the second is a pointer (You do understand pointers, right? If not better get more into C/C++ before you start OpenGL.) to an unsigned int array (or single value if you only need 1). It fills in the array (single value) with a texture ID that is not in use.
glTexGenf() doesnt accept pointer??.. http://www.eecs.tulane.edu/www/graphics/doc/OpenGL-Man-Pages/glTexGen.html
I use it like that:
glTexGenf(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
How do I get the coord back??
03-10-2001, 07:00 PM
Doh! I feel like a complete idiot now. I was thinking glGenTextures... (Well... switch around Tex & Gen and get rid of the 'ures' and they are almost the same.) http://www.opengl.org/discussion_boards/ubb/smile.gif
You can also use glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
To generate coordinates for environment mapping.
03-11-2001, 07:10 AM
You won't actually get the coordinates back. OpenGL will automatically generate them for you without having to use the glTexCoord functions. I'm not sure if there is anyway to get them back. If you need the coordinates, you'll probably have to generate them yourself.
Thank Deiussum http://www.opengl.org/discussion_boards/ubb/smile.gif
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.