Compiler: Code::Blocks
[Edit]Problem Fixed: See second thread
Hey everyone, and thanks in advance for any help you can give me. I'm working on a game using OpenGL for my graphics. In rendering, I have to set the S and T wrap coordinates via glTexParameteri(2d, wraps/t, GL_CLAMP_TO_EDGE) in order to render a skybox correctly. However almost directly after, I have to render a plane using the GL_REPEAT parameter. Here's the code:
Oh btw, PlayEnvironment is derived from Environment, it just contains a skybox and details to render it. The Play Environment also renders the table that I need.
Environment:Code:void PlayEnvironment::draw() { Environment::draw(); //To environemnts draw first glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); std::cout << glGetError(); tableTex->Set(); tablePlane->drawGL(); }
Now, I've noticed when I comment out the GL_CLAMP parameter call, it works fine on the table, however when it's in there it doesn't, and I do need the clamp to edge to call for the skybox.Code:bool Environment::draw() { glDisable(GL_DEPTH_TEST); glDepthMask(GL_FALSE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glPushMatrix(); glTranslatef(center[0], center[1], center[2]); glRotatef(rotate, 0.0f, 1.0f, 0.0f); for(int x = 0; x < 6; ++x) { planeTexs[x]->Set(); planes[x]->drawGL(); } glEnable(GL_DEPTH_TEST); glDepthMask(GL_TRUE); return true; }
Anyway, bottom line, does anyone know why the GL_REPEAT parameter call isn't working as intended (it is basically skipped over, and clamp to edge is applied to the table) ?



LinkBack URL
About LinkBacks


