Example #1
0
void display(void)
{
   GLint viewport[4];
   int jitter;

   glGetIntegerv (GL_VIEWPORT, viewport);

   glClear(GL_ACCUM_BUFFER_BIT);
   for (jitter = 0; jitter < ACSIZE; jitter++) {
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
      glPushMatrix ();
/*	Note that 4.5 is the distance in world space between
 *	left and right and bottom and top.
 *	This formula converts fractional pixel movement to 
 *	world coordinates.
 */
      glTranslatef (j8[jitter].x*4.5/viewport[2],
                    j8[jitter].y*4.5/viewport[3], 0.0);
      displayObjects ();
      glPopMatrix ();
      glAccum(GL_ACCUM, 1.0/ACSIZE);
   }
   glAccum (GL_RETURN, 1.0);
   glFlush();
}
Example #2
0
void display()
{
	static int frame_no=0;
	static int sceneRotation=0;

    glClearColor (0.3,0.3,0.8,1.0);												//background color - color buffer

    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);//clearing buffers of: colors, z-buffer, "szablonowego"
	// wybór macierzy modelowania
    //glMatrixMode (GL_MODELVIEW);
	//glLoadIdentity ();
	
	frame_no += engineSpeed;
	if(frame_no<720) frame_no ++; else frame_no = 0;
	if(sceneRotation<3600 ) sceneRotation ++; else sceneRotation = 0;
	
	//okrazanie sceny przez obserwatora
	//glMatrixMode( GL_PROJECTION );//rotacja sceny
	//glPushMatrix();//rotacja sceny
	//	glRotatef( frame_no, 0.0, 1.0, 0.0 );//rotacja sceny
	//	glMatrixMode( GL_MODELVIEW );//rotacja sceny
		displayObjects(frame_no, sceneRotation);								//displaying scene
	//	glMatrixMode( GL_PROJECTION );//rotacja sceny
	//glPopMatrix();//

	glFlush();
	glutSwapBuffers();
	glfwSwapBuffers();
}
Example #3
0
void display(void)
{
   GLint viewport[4];
   int jitter;

   glGetIntegerv (GL_VIEWPORT, viewport);

   glClear(GL_ACCUM_BUFFER_BIT);
   for (jitter = 0; jitter < ACSIZE; jitter++) {
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
      accPerspective (50.0, 
         (GLdouble) viewport[2]/(GLdouble) viewport[3], 
         1.0, 15.0, j8[jitter].x, j8[jitter].y, 0.0, 0.0, 1.0);
      displayObjects ();
      glAccum(GL_ACCUM, 1.0/ACSIZE);
   }
   glAccum (GL_RETURN, 1.0);
   glFlush();
}
Example #4
0
void C3D::display ()
{
  //## begin C3D::display%40E2158C0209.body preserve=yes

    GLint viewport[4];
   int jitter;
//   int i;

   glGetIntegerv (GL_VIEWPORT, viewport);

   glClear(GL_ACCUM_BUFFER_BIT);
//   for ( i = 0; i < 10; i++ )
   for (jitter = 0; jitter < ACSIZE; jitter++) {
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
      accPerspective (50.0, 
         (GLdouble) viewport[2]/(GLdouble) viewport[3], 
         1.0, 15.0, j8[jitter].x, j8[jitter].y, 0.0, 0.0, 1.0);
      displayObjects ();
      glAccum(GL_ACCUM, 1.0/ACSIZE);
   }
   glAccum (GL_RETURN, 1.0);
   glFlush();
  //## end C3D::display%40E2158C0209.body
}