Example #1
0
void Win3D::capturing() {
  glClear(GL_ACCUM_BUFFER_BIT);
  for (int jitter = 0; jitter < 4; jitter++) {
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    accPerspective(mPersp,
                   static_cast<double>(mWinWidth)
                   / static_cast<double>(mWinHeight),
                   0.1, 10.0, Jitter::j4[jitter].x, Jitter::j4[jitter].y,
                   0.0, 0.0, 1.0);
    gluLookAt(mEye[0], mEye[1], mEye[2], 0.0, 0.0, -1.0, 0.0, 1.0, 0.0);

    initGL();

    mTrackBall.applyGLRotation();
    glScalef(mZoom, mZoom, mZoom);
    glTranslatef(mTrans[0]*0.001, mTrans[1]*0.001, mTrans[2]*0.001);

    initLights();
    draw();

    glAccum(GL_ACCUM, 0.25);
  }
  glAccum(GL_RETURN, 1.0);
}
Example #2
0
void InstantRadiosity( int N, double rho )
{
  double Start = N;

  for ( int Reflections = 0, End = N; End > 0; End = (int)Start, Reflections++ ) {
    Start *= rho;

    for ( int i = (int)Start; i < End; i++ ) {
      // Select starting point on light source
      Point y( phi( 2, i ), phi( 3, i ) );
      Color L( Le( y ) ); // Le( y ) * supp Le; supp Le?
      double w = N;

      // trace reflections
      for ( int j = 0; j <= Reflections; j++ ) {
        glRenderShadowedScene( N / floor( w ) * L, y );
        glAccum( GL_ACCUM, 1 / N );

        // diffuse scattering
        Vector ω = ωd( phi( 2 * j + 2, i ), phi( 2 * j + 3, ( i ) );

        //trace ray from y into direction ω
        y = h( y, ω );

        // Attenuate and compensate
        L *= fd( y );
        w *= ρ;
      }
    }
  }

  glAccum( GL_RETURN, 1.0 );
}
Example #3
0
void CALLBACK Paint(void)
{
	int jitter;
	GLint viewport[4];

	glGetIntegerv(GL_VIEWPORT,viewport);
	if(!viewport[3])return;
	glClear(GL_ACCUM_BUFFER_BIT);

	for(jitter=0;jitter<8;jitter++)
	{
		glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

		accPerspective(45.0,(GLdouble)viewport[2]/(GLdouble)viewport[3],
			1.0,15.0,0.0,0.0,0.33*j8[jitter].x,0.33*j8[jitter].y,5.0);

		renderTeapot(-1.1,-0.5,-4.5,0.1745,0.01175,0.01175,
			0.61424,0.04136,0.04136,0.727811,0.626959,0.626959,0.6);
		renderTeapot(-0.5,-0.5,-5.0,0.24725,0.1995,0.0745,
			0.75164,0.60648,0.22648,0.628281,0.555802,0.366065,0.4);
		renderTeapot(0.2,-0.5,-5.5,0.19225,0.19225,0.19225,
			0.50754,0.50754,0.50754,0.508273,0.508273,0.508273,0.4);
		renderTeapot(1.0,-0.5,-6.0,0.0215,0.1745,0.0215,
			0.07568,0.61424,0.07568,0.633,0.727811,0.633,0.6);
		renderTeapot(1.8,-0.5,-6.5,0.0,0.1,0.06,0.0,0.50980392,
			0.50980392,0.50196078,0.50196078,0.50196078,0.25);

		glAccum(GL_ACCUM,0.125);
		glFlush();
		auxSwapBuffers();
	}
	glAccum(GL_RETURN,1.0);
	glFlush();
	auxSwapBuffers();
}
Example #4
0
void 
acfilter(int width, int height)
{
  glClear(GL_COLOR_BUFFER_BIT | GL_ACCUM_BUFFER_BIT);
  glMatrixMode(GL_TEXTURE);

  if (pause) {
    draw_rect(width, height);
    stop();
    glClear(GL_COLOR_BUFFER_BIT);
  }
  draw_rect(width / 2, height / 2);
  stop();
  glAccum(GL_ACCUM, 0.25);

  glTranslatef(1.0 / width, 0, 0);
  draw_rect(width / 2, height / 2);
  stop();
  glAccum(GL_ACCUM, 0.25);

  glLoadIdentity();
  glTranslatef(0, 1.0 / height, 0);
  draw_rect(width / 2, height / 2);
  stop();
  glAccum(GL_ACCUM, 0.25);

  glLoadIdentity();
  glTranslatef(1.0 / width, 1.0 / height, 0);
  draw_rect(width / 2, height / 2);
  stop();
  glAccum(GL_ACCUM, 0.25);

  glAccum(GL_RETURN, 1.0);
  glMatrixMode(GL_MODELVIEW);
}
    void MotionBlurDrawCallback::operator()(osgProducer::OsgSceneHandler &handler, Producer::Camera &camera)
    {
        double t = handler.getSceneView()->getFrameStamp()->getReferenceTime();

        if (!cleared_)
        {
            // clear the accumulation buffer
            glClearColor(0, 0, 0, 0);
            glClear(GL_ACCUM_BUFFER_BIT);
            cleared_ = true;
            t0_ = t;
        }

        double dt = fabs(t - t0_);
        t0_ = t;

        // call the scene handler's draw function
        handler.drawImplementation(camera);        

        // compute the blur factor
        double s = powf(0.2, dt / globalData.odeConfig.motionPersistence);

        // scale, accumulate and return
        glAccum(GL_MULT, s);
        glAccum(GL_ACCUM, 1 - s);
        glAccum(GL_RETURN, 1.0f);
    }
Example #6
0
static void Draw(void)
{

	glPushMatrix();

	glScalef(0.8, 0.8, 1.0);

	glClear(GL_COLOR_BUFFER_BIT);
	glCallList(thing1);
	glAccum(GL_LOAD, 0.5);

	glClear(GL_COLOR_BUFFER_BIT);
	glCallList(thing2);
	glAccum(GL_ACCUM, 0.5);

	glAccum(GL_RETURN, 1.0);

	glPopMatrix();

	if (doubleBuffer) {
		glutSwapBuffers();
	}
	else {
		glFlush();
	}
}
void GraphicsSubsystem::accumFrame(int cur, int n)
{
	if(cur == 0)
		glAccum(GL_LOAD, 1.0f / n);
	else
		glAccum(GL_ACCUM, 1.0f / n);
}
 void draw(int vertex_count) {
   // Copy the previous frame's buffer back in
   glAccum(GL_RETURN, 1);
   renderer_once::draw(vertex_count);
   // Store the screen contents back to the buffer
   glAccum(GL_LOAD, 1);
 }
Example #9
0
void Interface::Display (void)
{
	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	switch (_this->status) {
		case 5: 
			glRotatef(_this->randomA, 0, 1, 0);
			glRotatef(_this->randomB, 1, 0, 0);
			glRotatef(_this->randomC, 0, 0, 1);
		break;
	}

	if(_this->blurActive) {	//para efeito Blur
		for(int i = 0; i < _this->blurFrames; i++) {//para efeito Blur
			if(_this->blurFirstFrame) {//para efeito Blur
				glAccum(GL_LOAD, 5);//para efeito Blur
				_this->blurFirstFrame = false;//para efeito Blur
			}
			
			glPushMatrix();
				glRotatef( 45, 0, 1, 0);
				_this->magicCube->draws ();
			glPopMatrix();

			glAccum(GL_MULT, _this->blurQ);//para efeito Blur
			glAccum(GL_ACCUM, 1-_this->blurQ);//para efeito Blur
		}
		glAccum(GL_RETURN, 1.0);//para efeito Blur
	}
	glPushMatrix();
		_this->info();//Monstra texto
	glPopMatrix();
	glutSwapBuffers();
}
Example #10
0
void displayAccum(int accsize)
{
    int i;

    glClear(GL_ACCUM_BUFFER_BIT);
    loaddxdy(accsize);
    for (i = 0; i < accsize; i++) {
#ifdef DEBUG
        printf("Pass %d\n", i);
#endif
        glPushMatrix();
        glTranslatef(dx[i], dy[i], 0.0);

        glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
        /* draw the scene */
        zeichne_geometrie();
        glPopMatrix();
        glAccum(GL_ACCUM, 1.0/accsize);
    }
#ifdef DEBUG
    printf("final job\n");
#endif
    glAccum(GL_RETURN, 1.0); /* return accum. picture to screen */
    glFlush();
}
Example #11
0
void 
my_display(void)
{
#ifdef ANTIALIASING
   int passes = 8;
   int i;
#endif

#ifdef BLACK_LETTERS_WHITE_BACKGROUND
   glClearColor(1.0, 1.0, 1.0, 0.0);
#else
   glClearColor(0.0, 0.0, 0.0, 0.0);
#endif

#ifdef ANTIALIASING
   glClear(GL_ACCUM_BUFFER_BIT);

   for (i=0; i<passes; i++) {
      glClear(GL_COLOR_BUFFER_BIT);
      do_ortho(GL_TRUE, j8[i].x, j8[i].y);
      draw_logo(scale);
      glAccum(GL_ACCUM, 1.0/(GLfloat)passes);
   }
   glAccum(GL_RETURN, 1.0);
   glFlush();
#else
   glClear(GL_COLOR_BUFFER_BIT);
   do_ortho(GL_FALSE, 0.0, 0.0);
   draw_logo(scale);
#endif

   glutSwapBuffers();
}
Example #12
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();
}
// redraw the window
void display(void)
{
    mgr->getNavigator()->updateCameraTransformation();

    mgr->getWindow()->activate();
    mgr->getWindow()->frameInit();

    raction->setWindow(getCPtr(mgr->getWindow()));

    ViewportPtr viewport = mgr->getWindow()->getPort(0);

    glClear(GL_ACCUM_BUFFER_BIT);

    for (int i=0; i < JITTERSIZE[activeJitter]; i++) {
        beginEditCP(cameraDecorator);
            cameraDecorator->setOffset(
                (JITTER[activeJitter][i].x() - 0.5) * jitterRadius,
                (JITTER[activeJitter][i].y() - 0.5) * jitterRadius);
        endEditCP(cameraDecorator);

        viewport->render(raction);
    
        glAccum(GL_ACCUM, 1.0f / float(JITTERSIZE[activeJitter]));
        glAccum(GL_RETURN, float(JITTERSIZE[activeJitter]) / float(i + 1));
    }

    glAccum(GL_RETURN, 1.0f);

    mgr->getWindow()->swap();
    mgr->getWindow()->frameExit();
}
Example #14
0
void render_efxMotionBlurAccum () {

	local = (efxMotionBlurAccum_section *) mySection->vars;

	glAccum(GL_MULT, local->decay);
	glAccum(GL_ACCUM, 1 - local->decay);
	glAccum(GL_RETURN, 1);
}
Example #15
0
void display(){
    float xRotTrad = (rotateX/180 * 3.141592654f);
    float yRotTrad = (rotateY/180 * 3.141592654f);
    if (moveForward) {
        cameraX -= float(sinf(yRotTrad));
        cameraY += float(sinf(xRotTrad));
        cameraZ += float(cosf(yRotTrad));
    }
    if (moveBack) {
        cameraX += float(sinf(yRotTrad));
        cameraY -= float(sinf(xRotTrad));
        cameraZ -= float(cosf(yRotTrad));
    }
    if (moveLeft) {
        cameraX += float(cosf(yRotTrad));
        cameraZ += float(sinf(yRotTrad));
    }
    if (moveRight) {
        cameraX -= float(cosf(yRotTrad));
        cameraZ -= float(sinf(yRotTrad));
    }

   // writeText();
    glLoadIdentity();
    initLight();

    glRotatef(rotateX, 1, 0, 0);
    glRotatef(rotateY, 0, 1, 0);

    //chase camera?
    glTranslatef(cameraX, 0, cameraZ);

    glClearColor(0, 0, 0, 1);
    
    glPushMatrix();
    boidsList->renderBoids();
    glPopMatrix();

    //draw boundary cube
    if(showCube){
        glColor3f(1, 1, 1);
        glutWireCube(boidsList->getBounds()*2);
    }

    //accumulation buffer, for fake motion blur
    if(pos == 0)
        glAccum(GL_LOAD, 1.0 / n);
    else
        glAccum(GL_ACCUM, 1.0 / n);
    pos++;
    if(pos >= n) {
        pos = 0;
        glAccum(GL_RETURN, 1.0);
        glutSwapBuffers();
        glClear(GL_COLOR_BUFFER_BIT| GL_DEPTH_BUFFER_BIT);
    }

}
Example #16
0
void display(void) {
    if (rptr==wptr) {
        glutSwapBuffers();
        glutPostRedisplay();
        return;
    }

    glDrawBuffer(GL_BACK);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    int n;
    double x, y;
    glBegin(GL_LINES);
    glColor4f(0,1,0,0.7);
    glVertex2f(last_x, last_y);

    n = 0;
again:
    while (rptr != wptr) {
        x = biquad_filt(&lpf_x, ringbuf[rptr*4] / 32768.0);
        y = biquad_filt(&lpf_y, ringbuf[rptr*4+1] / 32768.0);
        if (!fullbright)
            glColor4f(0, ringbuf[rptr*4+2]/32768.0, 0,0.7);
        rptr++;
        if (rptr>=RING_SIZE) {
            rptr = 0;
            fprintf(stderr, "r");
        }
        glVertex2f(x, y);
        glVertex2f(x, y);
        n++;
    }
    if (n < 1000) {
        glutSwapBuffers();
        goto again;
    }
    glVertex2f(x, y);
    last_x = x; last_y = y;
    glEnd();

#define SKIP_ACCUM  // accumulation buffer gives nice smooth decay effect, but is slow as tar on most machines
#ifndef SKIP_ACCUM
    glAccum(GL_MULT, 0.7);
    glAccum(GL_ACCUM, 1.0);

    glDrawBuffer(GL_FRONT);
    glAccum(GL_RETURN, 1.0);
    glFlush();
#else
    //glDrawBuffer(GL_BACK);
    glutSwapBuffers();
#endif

    glutPostRedisplay();
}
void aa_display(float *ep, float *vp) {
	int view_pass;
	glClear(GL_ACCUM_BUFFER_BIT);
	for( view_pass=0; view_pass<VPASSES; view_pass++ ){
		view_volume(ep, vp, 1);
		draw_array();
		glAccum(GL_ACCUM,1.0/(float)(VPASSES));
	}
	glAccum(GL_RETURN,1.0);
	glutSwapBuffers();
}
Example #18
0
void go()
{
int view_pass;
glClear(GL_ACCUM_BUFFER_BIT);
for(view_pass=0;view_pass<VPASSES;view_pass++){
	jitter_view();
	draw_stuff();
	glFlush();
	glAccum(GL_ACCUM,1.0/(float)(VPASSES));
	}
glAccum(GL_RETURN,1.0);
}
void tui::LayoutCanvas::OnpaintGL(wxPaintEvent& event) {
    wxPaintDC dc(this);
   #ifndef __WXMOTIF__
      if (!GetContext()) return;
   #endif
   SetCurrent();
   // invalid_window indicates zooming.
   // event.GetEventType() == event.GetId() should means that database is updated
   // In both cases - the entire window is redrawn
   if ((invalid_window) || (event.GetEventType() == event.GetId()))
   {
      glMatrixMode( GL_MODELVIEW );
      glShadeModel( GL_FLAT ); // Single color
      update_viewport();
      //@TODO !! Check somewhere that RGBA mode is available!?
      // CTM matrix stuff
      glLoadIdentity();
      glOrtho(lp_BL.x(),lp_TR.x(),lp_TR.y(),lp_BL.y(),-1.0,1.0);
      glClear(GL_COLOR_BUFFER_BIT);
      glEnable(GL_BLEND);
      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
      glClear(GL_ACCUM_BUFFER_BIT);
      DATC->openGL_draw(_LayCTM);    // draw data
      glAccum(GL_LOAD, 1.0);
      invalid_window = false;
      if (rubber_band) rubber_paint();
   }
   else
   {
      glAccum(GL_RETURN, 1.0);
      if       (tmp_wnd)         wnd_paint();
      else if  (rubber_band)     rubber_paint();
   }
   // deal with the long cursor
   if (reperX || reperY)
   {
      glColor4f(1, 1, 1, .5);
      glBegin(GL_LINES);
      if (reperX)
      {
         glVertex2i(lp_BL.x(), ScrMARK.y()) ;
         glVertex2i(lp_TR.x(), ScrMARK.y());
      }
      if (reperY)
      {
         glVertex2i(ScrMARK.x() , lp_BL.y()) ;
         glVertex2i(ScrMARK.x() , lp_TR.y());
      }
      glEnd();
   }

   SwapBuffers();
}
Example #20
0
void
balance(void)
{
  if (reset) {
    memset(null, luma, width * height * sizeof *null);
    reset = 0;
  }
  glDrawPixels(width, height, format, GL_UNSIGNED_BYTE, image);
  glAccum(GL_LOAD, alpha / 2.);
  glDrawPixels(width, height, format, GL_UNSIGNED_BYTE, null);
  glAccum(GL_ACCUM, (1 - alpha) / 2.);
  glAccum(GL_RETURN, 2.0);
}
Example #21
0
void Camera::renderingInstructions(VisualizationParameterSet& visParams)
{
  // set some values
  graphicsManager->getShaderUsage(visParams);
  // prepare shadow maps
  while(graphicsManager->prepareLightForShadowMapping(visParams))
    rootNode->quickDraw();
  // prepare cube map
  graphicsManager->getShaderUsage(visParams);
  renderCubeMap(visParams);
  // prepare rendering
  glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
  graphicsManager->prepareRendering(visParams, resolutionX, resolutionY,
    aspect, Functions::toDeg(angleY), minRange, maxRange, fbo_reg);
  // get motion blur values and clear view
  graphicsManager->setUpMotionBlurSettings(visParams);
  // do the motion blur render passes (if motion blur is off -> 1 pass)
  for(; visParams.mb_currentPass <= visParams.mb_renderPasses; visParams.mb_currentPass++)
  {
    // set the view
    graphicsManager->setPerspective();
    setCamera(visParams);
    glClear(default_clear);
    // update light positions
    graphicsManager->updateLights(true, visParams.renderPasses == 2, visParams.provideUniforms);
    // prepare surface properties
    graphicsManager->renderEnvironment(maxRange);
    glCallList(graphicsManager->enableStateDL[visParams.surfaceStyle]);
    // render
    rootNode->draw(visParams);
    if(visParams.renderPasses == 2)
    {
      graphicsManager->updateLights(true, false, visParams.provideUniforms);
      rootNode->draw(visParams);
    }
    // undo surface properties
    glCallList(graphicsManager->disableStateDL[visParams.surfaceStyle]);
    graphicsManager->revertLightTextureUnits(visParams.provideUniforms);
    // load to accumulation buffer, blend with accumulation buffer or just do nothing (default)
    if(visParams.mb_useAccum && visParams.mb_currentPass == 1)
      glAccum(GL_LOAD, 1.0f/visParams.mb_renderPasses);
    else if(visParams.mb_useAccum)
      glAccum(GL_ACCUM, 1.0f/visParams.mb_renderPasses);
    // render post production and swap render targets if multi pass rendering with fbo usage
    graphicsManager->finishRendering(visParams, false);
  }
  // write back result if accum was used
  if(visParams.mb_useAccum)
    glAccum(GL_RETURN, 1.0f);
  glFlush(); 
}
void tui::LayoutCanvas::OnpaintGL(wxPaintEvent& event) {
   #ifndef __WXMOTIF__
      if (!GetContext()) return;
   #endif
   // invalid_window indicates zooming or refreshing after a tell operation.
   if (invalid_window)
   {
      wxPaintDC dc(this);
      SetCurrent();
      glMatrixMode( GL_MODELVIEW );
      glShadeModel( GL_FLAT ); // Single color
      update_viewport();
      // CTM matrix stuff
      glLoadIdentity();
      glOrtho(lp_BL.x(),lp_TR.x(),lp_TR.y(),lp_BL.y(),-1.0,1.0);
      glClear(GL_COLOR_BUFFER_BIT);
      glEnable(GL_BLEND);
      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
      glClear(GL_ACCUM_BUFFER_BIT);
      DATC->openGL_draw(_LayCTM);    // draw data
      glAccum(GL_LOAD, 1.0);
      invalid_window = false;
      if (rubber_band) rubber_paint();
   }
   else
   {
      glAccum(GL_RETURN, 1.0);
      if       (tmp_wnd)         wnd_paint();
      else if  (rubber_band)     rubber_paint();
   }
   // deal with the long cursor
   if (reperX || reperY)
   {
      glColor4f(1, 1, 1, .5);
      glBegin(GL_LINES);
      if (reperX)
      {
         glVertex2i(lp_BL.x(), ScrMARK.y()) ;
         glVertex2i(lp_TR.x(), ScrMARK.y());
      }
      if (reperY)
      {
         glVertex2i(ScrMARK.x() , lp_BL.y()) ;
         glVertex2i(ScrMARK.x() , lp_TR.y());
      }
      glEnd();
   }

   SwapBuffers();
}
Example #23
0
void draw() {
  int current_time = glutGet(GLUT_ELAPSED_TIME);
  //cout << "fps: " << 1000.0 / (current_time - last_render_time) << endl;
  last_render_time = current_time;
  game->draw();
  if(ALLOW_BLUR) {
    glAccum(GL_MULT, blur_factor);
    glAccum(GL_ACCUM, 1.0-blur_factor);
    glAccum(GL_RETURN, 1.0);
  }
  glutSwapBuffers();
  //glutPostRedisplay();
  //glFlush();
}
Example #24
0
void acc_convolve(void)
{
    int x, y;

    for (y = 0; y < kern->h; y++) {
	for (x = 0; x < kern->w; x++) {
	    glRasterPos2i(0, 0); 
	    glBitmap(0, 0, 0, 0, -x, -y, 0);
	    glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, img);
	    glAccum(GL_ACCUM, kern->kern[y*kern->w + x]*kernScale);
	}
    }
    glAccum(GL_RETURN, 1./kernScale);
}
Example #25
0
void Projector::_show_buffer (char* output)
{   //effects using accumulation buffer
    //reverse colors
    if (reverse_colors) {
        glAccum(GL_MULT,    -1.0f);
        glAccum(GL_ADD,     1.0f);
    }

    //increase contrast & invert colors
    if (high_contrast) {
        glAccum(GL_ADD,     -0.25f);
        glAccum(GL_RETURN,  2.0f);
        glAccum(GL_ADD,     0.25f);
    } else {
        glAccum(GL_RETURN,  1.0f);
    }

    //draw image as soon as possible
#ifdef CAPTURE
    if (output) _capture_little(output);
#endif
    finish_buffer();

    //restore colors
    if (reverse_colors) {
        glAccum(GL_MULT,    -1.0f);
        glAccum(GL_ADD,     1.0f);
    }
}
Example #26
0
void reshape(int w, int h)
{
	float asp = float(w) / float(h); // aspect ratio (종횡비)
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	width = w;
	height = h;
	gluPerspective(45, asp, 0.1, 100);

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glAccum(GL_ACCUM, 1.0);
	glAccum(GL_RETURN, 1.0);
	glutPostRedisplay();
}
Example #27
0
void View::display_antialiased()
{
  glClear(GL_ACCUM_BUFFER_BIT);
  for (int i = 0; i < 16; i++)
  {
    jitter_x = jitter16[i][0];
    jitter_y = jitter16[i][1];
    set_ortho_projection();
    clear_background();
    on_display();
    glAccum(GL_ACCUM, 1.0 / 16);
  }
  glAccum(GL_RETURN, 1.0);
  jitter_x = jitter_y = 0.0;
}
void tui::LayoutCanvas::wnd_paint() {
   glAccum(GL_RETURN, 1.0);
   glColor4f(0.7, 0.7, 0.7, 0.4); // gray
   glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
   glRecti(presspoint.x(),presspoint.y(), n_ScrMARKold.x(), n_ScrMARKold.y());
   glRecti(presspoint.x(),presspoint.y(), n_ScrMARK.x(), n_ScrMARK.y());
}
void tui::LayoutCanvas::OnpaintGL(wxPaintEvent&) {
    wxPaintDC dc(this);
   #ifndef __WXMOTIF__
      if (!GetContext()) return;
   #endif
   SetCurrent();
   update_viewport();
   //@TODO !! Check somewhere that RGBA mode is available!?
   // CTM matrix stuff
   glLoadIdentity();
   glOrtho(lp_BL.x(),lp_TR.x(),lp_TR.y(),lp_BL.y(),-1.0,1.0);
   if (invalid_window || !(tmp_wnd || rubber_band)) {
      // invalid_window indicates zooming. If that is false and the rest two 
      // variables are not set, means that the system request repaint 
      // In both cases - the entire window is redrawn
      glClear(GL_COLOR_BUFFER_BIT);
      glEnable(GL_BLEND);
      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
      glClear(GL_ACCUM_BUFFER_BIT);
      Properties->drawGrid();
      DATC->openGL_draw(Properties->drawprop());    // draw data
      glAccum(GL_LOAD, 1.0);
      if (rubber_band) rubber_paint();
      invalid_window = false;
   }
   else if (tmp_wnd) 
      // zooming using the mouse
      wnd_paint();
   else if (n_ScrMARKold != n_ScrMARK) 
      // the only reason to get to this point remains rubber_band == true
      // so the paint will be invoked only if we have something new to show on 
      //the screen
      rubber_paint();
   SwapBuffers();
}
Example #30
0
void go() {
    if(lookAround) {
        drawStuff();
        return;
    }

    float xt;
    glClear(GL_ACCUM_BUFFER_BIT);
    for(xt = (float)-EYEDX; xt < EYEDX; xt += EYEDX / 10.0){
        vv(xt);
        drawStuff();
        glAccum(GL_ACCUM,0.05);
    }
    glAccum(GL_RETURN,1.0);
    glFlush();
}