View Full Version : Texture mapping help?
03-04-2004, 02:12 AM
Ok, can anybody please tell me why i cannot texture map anything in my application. I am loading opengl from within a library i have created. then when trying to display any object with texture mapping, i just simply get the shape with the most recent color selected...
What are the obvious reasons for this??
03-04-2004, 02:44 AM
Defualt minification filtering is GL_NEAREST_MIPMAP_LINEAR. If you didn't specify a mipmap chain your texture unit stays off. Use glTexParameteri to switch to GL_LINEAR or GL_NEAREST.
03-04-2004, 03:04 AM
This is the section i think you mean....
Tried both ways as you can see, any other ideas?
03-04-2004, 04:11 AM
Does your texture have power of two dimensions?
Are you trying to load the texture before you have a rendering context?
Are you loading the data from the file correctly?
These are just a few questions that come to mind. We'd need to see your code to give better answers.
03-04-2004, 04:21 AM
Yes it does seem like i am trying to load the textures prior to setting the rendering context.
What would be the explanation why this didn,t work?
03-04-2004, 04:32 AM
I have the same problem when i followed the codes written on a tutorial website.
But i solved it when i added:
gluBuild2DMipmaps(GL_TEXTURE_2D, 3,ImageWidth,ImageHeight, GL_RGBA, GL_UNSIGNED_BYTE, ImageBuffer);
after glTexImage2D() command.
DId u omit that sentence?
03-04-2004, 04:39 AM
Nope, I had that there. Thanks all for your help, its now sorted by making sure i create the textures after setting up the rendering context.
03-04-2004, 09:27 AM
Just for the record,
is not an option, magnification allows only GL_NEAREST and GL_LINEAR and your code throws a GL error. There is no bigger texture than level of detail 0 to mipmap with.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.