Exemplo n.º 1
0
void CLapPainter::OGL_Paint()
{
  if (m_pLapSupplier->GetDisplayOptions().fColorScheme)
  {
		glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );  //  Background color is black.
  }
  else
  {
		glClearColor( 0.95f, 0.95f, 0.95f, 0.95f );  //  Background color is grey.
  }
  glClear( GL_COLOR_BUFFER_BIT );
  
  RECT rcClient;
  GetClientRect(OGL_GetHWnd(), &rcClient);
  
  LAPDISPLAYSTYLE eDisplayStyle = m_pLapSupplier->GetLapDisplayStyle(m_iSupplierId);
  const LAPSUPPLIEROPTIONS& sfLapOpts = m_pLapSupplier->GetDisplayOptions();
  switch(eDisplayStyle)
  {
  case LAPDISPLAYSTYLE_MAP:
    glViewport(0,0,RECT_WIDTH(&rcClient), RECT_HEIGHT(&rcClient));
    DrawLapLines(sfLapOpts);	//	Draws the lap as a map on primary display
    break;
  case LAPDISPLAYSTYLE_PLOT:
    DrawGeneralGraph(sfLapOpts, true);	//	Draws the data graphs on the primary display
    break;
  case LAPDISPLAYSTYLE_RECEPTION:
    DrawReceptionMap(sfLapOpts);	//	Draws the reception map on the primary display
    break;
  case LAPDISPLAYSTYLE_NOLAPS:
    // user doesn't have any laps selected, so we should tell them to select some
    DrawSelectLapsPrompt();
    break;
  }
  
	SwapBuffers( OGL_GetDC() );
}
Exemplo n.º 2
0
void CGraphCanvas::Render()
{

	int w = m_size.x, h = m_size.y;

	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();

	glViewport(0, 0, w, h);

	CDataManager *dm =  GetDataManager();
	
	//m_Ortho[0] =m_Ortho[2] =0- dm->m_LayoutParameter.range;
	//m_Ortho[1] =m_Ortho[3] =dm->m_LayoutParameter.range;
 
	glOrtho( m_Ortho[0], m_Ortho[1], m_Ortho[2], m_Ortho[3], m_Ortho[4], m_Ortho[5] );

	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	
	if(dm->m_ifGraphReady)
	{
		DrawExtraInfo();
			
		DrawGeneralGraph();

		CalculateFrameRate();
		DrawRenderingStatus();

		glFlush();
		SwapBuffers();
	}
	 
}