Exemplo n.º 1
0
void CkQuadView::render(double alpha,CkView *v_old) {
#ifndef CMK_LIVEVIZ3D_CLIENT
	CkAbort("CkQuadView::render should never be called on server!\n");
#else
	glEnable(GL_TEXTURE_2D);
	CkQuadView *old=(CkQuadView *)v_old; // FIXME: what if he's not a quadview?
	
	if (old==NULL || old->nCorners!=nCorners || alpha>0.99) 
	{ /* just draw us */
		glColor4f(1.0,1.0,1.0,1.0);
		render();
	} 
	else 
	{ /* have old, and need to blend with him. */
#if 0 /* use multitexture: needs to have same corners (which sucks) */
		c_tex->bind(); // we're in texture unit 0
		glActiveTextureARB(GL_TEXTURE1_ARB);
		old->c_tex->bind(); // he's in texture unit 1
		glEnable(GL_TEXTURE_2D);
		oglTextureCombineLinear(1.0-alpha);
		glBegin (nCorners==4?GL_QUADS:GL_TRIANGLE_STRIP);
		for (int i=0;i<nCorners;i++) {
			glMultiTexCoord2dvARB(GL_TEXTURE0_ARB,texCoord[i]); 
			glMultiTexCoord2dvARB(GL_TEXTURE1_ARB,old->texCoord[i]);
			glVertex3dv(alpha*corners[i]+(1-alpha)*old->corners[i]); 
		}
		glEnd();
		glDisable(GL_TEXTURE_2D);
		glActiveTextureARB(GL_TEXTURE0_ARB);
#else /* draw two copies: first him, then me. */
		double separation=1.3;
		float of=smooth(separation*(1-alpha));
		glColor4f(of,of,of,of);
		old->render();
		
		float nf=smooth(separation*alpha);
		glColor4f(nf,nf,nf,nf);
		render();
		
		glColor4f(1.0,1.0,1.0,1.0);
#endif
	}
	
	
	if (oglToggles['f']) 
	{ // Draw a little frame around this texture
		glDisable(GL_TEXTURE_2D);
		for (int i=0;i<nCorners;i++)
			oglLine(corners[i],corners[(i+1)%nCorners]);
		glEnable(GL_TEXTURE_2D);
	}
#endif
}
Exemplo n.º 2
0
Arquivo: g_render.c Projeto: aosm/X11
void __glXDisp_MultiTexCoord2dvARB(GLbyte *pc)
{

#ifdef __GLX_ALIGN64
	if ((unsigned long)(pc) & 7) {
	    __GLX_MEM_COPY(pc-4, pc, 20);
	    pc -= 4;
	}
#endif
	glMultiTexCoord2dvARB( 
		*(GLenum   *)(pc + 16),
		(GLdouble *)(pc + 0)
	);
}
Exemplo n.º 3
0
void __stdcall glMultiTexCoord2dv(GLenum target, const GLdouble *v )
{
 if (!ARB_multitexture) return;
 glMultiTexCoord2dvARB(target, v);
}