PDA

View Full Version : pb with pbuffer



pantxua
04-29-2004, 04:30 AM
Hi, I'm trying to render my scene in a texture with a pbuffer. It works but i have a problem with glCallList and with lighting: it has no effect (with glCallList objects don't appear and they are no lighted even with a light actived). This a part of my source code :

teapot0 = glGenLists(1);
if(teapot0 != 0){
glNewList(teapot0,GL_COMPILE);
glutSolidTeapot(2);
glEndList();
}
if(pb->ispBufferActive()){
pb->setpBufferCurrent();
}
glClearColor(0.0,0.0,0.0,1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(aperture,ratio,nearPlan,farPlan);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glPushMatrix();
look();
glTranslated(-eyePosition.x, -eyePosition.y, -eyePosition.z);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR,mat_spec_blanc);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE,mat_diff_noir);
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT,mat_ambi_noir);
glMaterialf(GL_FRONT_AND_BACK,GL_SHININESS,mat_shi niness_max);
glCallList(teapot0);
glPopMatrix();
pb->unsetpBufferCurrent();
...

is there an option to add in pixelformat in pbuffer, or something else ? thx

dslprog
04-29-2004, 05:29 AM
I think you're activating the pbuffer's rendering context after creating the display list. The display lists are not shared between rendering contexts unless you call wglShareLists.

pantxua
04-29-2004, 11:46 PM
it works!!!!!
thanks a lot

pantxua
04-30-2004, 03:24 AM
it works! thanks a lot