예제 #1
0
void 
RenderTask::Visit(const OrderedTask& task) 
{
  tpv.set_bounding_box(task.get_bounding_box(screen_bounds));
  tpv.set_active_index(task.getActiveIndex());
  draw_layers(task);
}
예제 #2
0
void GLWidget::paintGL(){
	glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	gluPerspective(60.0f,(GLfloat)width/(GLfloat)height,0.01f,650.0f);

	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	gluLookAt(
		0.0, cam_radius, cam_radius,
		0.0, 0.0, 0.0,
		0.0, 0.0, 1.0);
	glViewport(0, 0, width, height);
	glRotatef( rotate_x, 1.0, 0.0, 0.0 );
	glRotatef( rotate_y, 0.0, 0.0, 1.0 );

	draw_layers();
	if (show_grid)
		draw_grid(-0.5,-0.5,0.1,0.1,11,11,&guide_z,&guide_col);
	if (show_axis)
		draw_axis();

	glFlush();
}
예제 #3
0
void
vl_compositor_render(struct vl_compositor_state *s,
                     struct vl_compositor       *c,
                     struct pipe_surface        *dst_surface,
                     struct u_rect              *dirty_area,
                     bool                        clear_dirty)
{
   assert(c);
   assert(dst_surface);

   c->fb_state.width = dst_surface->width;
   c->fb_state.height = dst_surface->height;
   c->fb_state.cbufs[0] = dst_surface;
   
   if (!s->scissor_valid) {
      s->scissor.minx = 0;
      s->scissor.miny = 0;
      s->scissor.maxx = dst_surface->width;
      s->scissor.maxy = dst_surface->height;
   }

   gen_vertex_data(c, s, dirty_area);

   if (clear_dirty && dirty_area &&
       (dirty_area->x0 < dirty_area->x1 || dirty_area->y0 < dirty_area->y1)) {

      c->pipe->clear_render_target(c->pipe, dst_surface, &s->clear_color,
                                   0, 0, dst_surface->width, dst_surface->height);
      dirty_area->x0 = dirty_area->y0 = MAX_DIRTY;
      dirty_area->x1 = dirty_area->y1 = MIN_DIRTY;
   }

   c->pipe->set_scissor_states(c->pipe, 0, 1, &s->scissor);
   c->pipe->set_framebuffer_state(c->pipe, &c->fb_state);
   c->pipe->bind_vs_state(c->pipe, c->vs);
   c->pipe->set_vertex_buffers(c->pipe, 0, 1, &c->vertex_buf);
   c->pipe->bind_vertex_elements_state(c->pipe, c->vertex_elems_state);
   pipe_set_constant_buffer(c->pipe, PIPE_SHADER_FRAGMENT, 0, s->csc_matrix);
   c->pipe->bind_rasterizer_state(c->pipe, c->rast);

   draw_layers(c, s, dirty_area);
}
예제 #4
0
void 
RenderTask::Visit(const GotoTask& task) 
{
  tpv.set_active_index(0);
  draw_layers(task);
}
예제 #5
0
void 
RenderTask::Visit(const AbortTask& task) 
{
  tpv.set_active_index(task.getActiveIndex());
  draw_layers(task);
}