Skip to main content
gamedev.net
🔒 Locked

glTexParameteri()

Started by GarlandIX Jan 7, 2003 at 11:16 AM 5 replies 750+ views
Original Post
GarlandIX
GarlandIX
When using glTexParameteri() to set the texture filtering and wrapping modes, do I have to do this before the call to glTexImage2D() or gluBuild2DMipmaps(), or is it possible to change the texture filtering and wrapping modes via glTexParameteri() after the textures already been loaded? For example, is it possible to do this:
void DrawScene()
{
// the texture has already been loaded and glTexImage() has been called
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
// then draw whatever
}
 
------------------------------ BASIC programmers don''t die, they just GOSUB and don''t return.
------------------------------BASIC programmers don't die, they just GOSUB and don't return.
Brother Bob
Brother Bob
What stops you from trying it out yourself and see what happens?
Ingenu
Ingenu
AFAIR you can.

get a NeHe tutorial and change the lines you''re interested in, to be sure.


-* So many things to do, so little time to spend. *-
-* So many things to do, so little time to spend. *-
GarlandIX
GarlandIX
Brother bob: And what stops me from trying it myself (which I am) and at the same time posting it here so that while I am in the process of trying and debugging an application of my own written simply to test this (which I am), perhaps I could get an answer from those who know more about this than I do (who are all over this site), and perhaps gain some wisdom on why or why not the thing I am asking about works.

------------------------------
BASIC programmers don''t die, they just GOSUB and don''t return.
------------------------------BASIC programmers don't die, they just GOSUB and don't return.
Brother Bob
Brother Bob
If you did try it yourself, then that''s good and I apologize. It''s a typical spoonfeed-question which easily can be answered by a simple program and a few minutes of programming. I, incorrectly, assumed the worst.

Anyways, as you proably know by now, it is possible. Anything you change with glTexParameter can be changed at any time, and changes takes effect immediately.
GarlandIX
GarlandIX
Thanks AP that''s exactly what I was looking for. And brother bob, you''re right, I should have figured it out myself instead of being a lazy mofo (actually, I did write a program to try and test this, but my texture loading function keeps crashing the program and i still havent been able fix it *sigh).

------------------------------
BASIC programmers don''t die, they just GOSUB and don''t return.
------------------------------BASIC programmers don't die, they just GOSUB and don't return.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.