Ejemplo n.º 1
0
void GLWidget::initializeGL()
{
// 	glEnable(GL_LIGHTING);
// 	glEnable(GL_LIGHT0);

	setAutoBufferSwap(false);

	// We do not want blending by now
	glDisable(GL_BLEND);
	// We do not want depth test by now
	glDisable(GL_DEPTH_TEST);

	/**
		FIXME
		If the line below is uncommented, the program crashes. I could not trace
		the problem of the crash.
		If you happen to know where it it, please, let me know.
		Lisandro.
	*/
// 	glEnableClientState(GL_NORMAL_ARRAY);

	if(fileRender) {
		emit rebuildLists();
	}
}
Ejemplo n.º 2
0
static void initLists()
{
	gUpdateFlag = TRUE;
	rebuildLists();
	gCurRow=0; 
	gCurRef=0;
	refreshLists();
	gUpdateFlag = FALSE;
}
Ejemplo n.º 3
0
QPixmap GLWidget::snapshot(int width, int height)
{
	// renderPixmap will call initializeGL, resizeGL and paintGL in a
	// new QGLContext. Since fileRender=true, initializeGL will
	// rebuild the display lists (delete de currents and generate new ones)
	fileRender= true;
	QPixmap pixmap= renderPixmap(width, height);
	fileRender= false;
	// new lists need to be generated for the original context
	emit rebuildLists();
	return pixmap;
}
Ejemplo n.º 4
0
// GTK periodical function 
gint check_update( gpointer data )
{
	if (gNeedRebuild) {
		gNeedRebuild = FALSE;
		gNeedRefresh = FALSE;
		gUpdateFlag = TRUE;
		rebuildLists();
		refreshLists();
		gUpdateFlag = FALSE;
	} else if (gNeedRefresh) {
		gNeedRefresh = FALSE;
		gUpdateFlag = TRUE;
		refreshLists();
		gUpdateFlag = FALSE;
	}
		
	return TRUE;
}