+void XYWnd::RenderActive( void ){
+ if ( glwidget_make_current( m_gl_widget ) != FALSE ) {
+ if ( Map_Valid( g_map ) && ScreenUpdates_Enabled() ) {
+ GlobalOpenGL_debugAssertNoErrors();
+ glDrawBuffer( GL_FRONT );
+
+ if ( g_xywindow_globals_private.show_outline ) {
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho( 0, m_nWidth, 0, m_nHeight, 0, 1 );
+
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+
+ if( !Active() ){ //sorta erase
+ glColor3fv( vector3_to_array( g_xywindow_globals.color_gridmajor ) );
+ }
+ // four view mode doesn't colorize
+ else if ( g_pParentWnd->CurrentStyle() == MainFrame::eSplit ) {
+ glColor3fv( vector3_to_array( g_xywindow_globals.color_viewname ) );
+ }
+ else
+ {
+ switch ( m_viewType )
+ {
+ case YZ:
+ glColor3fv( vector3_to_array( g_xywindow_globals.AxisColorX ) );
+ break;
+ case XZ:
+ glColor3fv( vector3_to_array( g_xywindow_globals.AxisColorY ) );
+ break;
+ case XY:
+ glColor3fv( vector3_to_array( g_xywindow_globals.AxisColorZ ) );
+ break;
+ }
+ }
+ glBegin( GL_LINE_LOOP );
+ glVertex2f( 0.5, 0.5 );
+ glVertex2f( m_nWidth - 0.5, 1 );
+ glVertex2f( m_nWidth - 0.5, m_nHeight - 0.5 );
+ glVertex2f( 0.5, m_nHeight - 0.5 );
+ glEnd();
+ }
+ // we do this part (the old way) only if show_axis is disabled
+ if ( !g_xywindow_globals_private.show_axis ) {
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho( 0, m_nWidth, 0, m_nHeight, 0, 1 );
+
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+
+ if ( Active() ) {
+ glColor3fv( vector3_to_array( g_xywindow_globals.color_viewname ) );
+ }
+ else{
+ glColor4fv( vector4_to_array( Vector4( g_xywindow_globals.color_gridtext, 1.0f ) ) );
+ }
+
+ glDisable( GL_BLEND );
+ glRasterPos2f( 35, m_nHeight - 20 );
+
+ GlobalOpenGL().drawString( ViewType_getTitle( m_viewType ) );
+ }
+ else{
+ // clear
+ glViewport( 0, 0, m_nWidth, m_nHeight );
+ // set up viewpoint
+ glMatrixMode( GL_PROJECTION );
+ glLoadMatrixf( reinterpret_cast<const float*>( &m_projection ) );
+
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+ glScalef( m_fScale, m_fScale, 1 );
+ int nDim1 = ( m_viewType == YZ ) ? 1 : 0;
+ int nDim2 = ( m_viewType == XY ) ? 1 : 2;
+ glTranslatef( -m_vOrigin[nDim1], -m_vOrigin[nDim2], 0 );
+
+ glDisable( GL_LINE_STIPPLE );
+ glDisableClientState( GL_TEXTURE_COORD_ARRAY );
+ glDisableClientState( GL_NORMAL_ARRAY );
+ glDisableClientState( GL_COLOR_ARRAY );
+ glDisable( GL_TEXTURE_2D );
+ glDisable( GL_LIGHTING );
+ glDisable( GL_COLOR_MATERIAL );
+ glDisable( GL_DEPTH_TEST );
+ glDisable( GL_TEXTURE_1D );
+ glDisable( GL_BLEND );
+
+ XYWnd::XY_DrawAxis();
+ }
+
+ glDrawBuffer( GL_BACK );
+ GlobalOpenGL_debugAssertNoErrors();
+ glwidget_make_current( m_gl_widget );
+ }
+ }
+}
+