int DrawGLScene(GLvoid) // Here''s Where We Do All The Drawing
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); // Clear The Screen And The Depth Buffer
/* */
glLoadIdentity(); // Reset The Current Modelview Matrix
camera.setlook();
/* set point we are looking at */
gluLookAt( camera.pos.x, camera.pos.y, camera.pos.z,
camera.lx, camera.ly, camera.lz,
0.0f, 1.0f, 0.0f);
/* set the light for the new camera placing */
glLightfv(GL_LIGHT1, GL_POSITION, LightPosition); // Position The Light
// TEXTURE-UNIT #0
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
//glDisable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, ft.texID);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE);
// TEXTURE-UNIT #1
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
//glDisable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, floortex.texID);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE /*COMBINE_EXT*/);
glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE);
/* draw the sector aka flooor */
sector1.drawl();
/* back to one texture */
glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);
glActiveTextureARB(GL_TEXTURE0_ARB);
/* draw the object aka star aka object1 */
glBindTexture(GL_TEXTURE_2D, startex.texID);
object1.drawl();
/* particlesystem drawing */
glBindTexture(GL_TEXTURE_2D, particletex.texID);
glDisable(GL_LIGHTING);
glDepthMask(GL_FALSE);
//ps1.draw(&camera);
ps2.draw(&camera);
glDepthMask(GL_TRUE);
/* turn lights back on */
if(light){
glEnable(GL_LIGHTING);
}
return TRUE; // Everything Went OK
}
weird thing
I get a strange thing on one of my objects, a bit hard to explain what it looks like. so i put my thing up on the net. If someone can take a look at it and tell me what might be the cause of this?
http://home.no.net/zauron/opengl.zip
u need to press S a bit to get some distance and u see a weird "flakkering at the edges of my object. I am compleatly lost.
Here is how i draw
Hey, just wanted to know but did you try using glFlush() to clear everything before the next frame? That might help.
I see nothing wrong with the demo. If you''re talking about the jaggies, up the rez and prepare for a performance hit, or do some sort of AA.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement