# include <windows.h>
#endif
-#include <GL/gl.h>
+#include SG_GL_H
#if defined(FX) && defined(XMESA)
# include <GL/xmesa.h>
#include <Main/fg_io.hxx>
#include <Main/globals.hxx>
#include <Main/fg_props.hxx>
+#include <Main/renderer.hxx>
#include <Main/viewmgr.hxx>
#if defined( WIN32 ) && !defined( __CYGWIN__ ) && !defined(__MINGW32__)
{"loadFlight", loadFlight},
{"reInit", reInit},
#ifdef TR_HIRES_SNAP
- {"dumpHiResSnapShot", dumpHiResSnapShot},
+ {"dumpHiResSnapShot", fgHiResDumpWrapper},
#endif
- {"dumpSnapShot", dumpSnapShot},
+ {"dumpSnapShot", fgDumpSnapShotWrapper},
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
{"printScreen", printScreen},
#endif
// "Program exiting normally at user request." );
cout << "Program exiting normally at user request." << endl;
- // close all external I/O connections
- globals->get_io()->shutdown_all();
-
exit(0);
}
fgSetBool("/sim/freeze/master", true);
}
+ TurnCursorOff();
if ( !puCursorIsHidden() ) {
- show_pu_cursor = true;
- puHideCursor();
+ show_pu_cursor = true;
+ puHideCursor();
}
FGRenderer *renderer = globals->get_renderer();
// we need two render frames here to clear the menu and cursor
// ... not sure why but doing an extra fgRenderFrame() shouldn't
// hurt anything
- renderer->update();
- renderer->update();
-
- // Make sure we have SSG projection primed for current view
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- ssgSetCamera( (sgVec4 *)globals->get_current_view()->get_VIEW() );
- ssgSetFOV( globals->get_current_view()->get_h_fov(),
- globals->get_current_view()->get_v_fov() );
- cout << "FOV = " << globals->get_current_view()->get_h_fov()
- << ", " << globals->get_current_view()->get_v_fov() << endl;
-
- // ssgSetNearFar( 10.0f, 120000.0f );
- ssgSetNearFar( 0.5f, 1200000.0f );
+ renderer->update( true );
+ renderer->update( true );
-
// This ImageSize stuff is a temporary hack
// should probably use 128x128 tile size and
// support any image size
trBeginTile(tr);
int curColumn = trGet(tr, TR_CURRENT_COLUMN);
int curRow = trGet(tr, TR_CURRENT_ROW);
- renderer->screendump();
+ renderer->update( false );
if ( do_hud )
fgUpdateHUD( curColumn*hud_col_step, curRow*hud_row_step,
(curColumn+1)*hud_col_step, (curRow+1)*hud_row_step );
puShowCursor();
}
+ TurnCursorOn();
+
if ( !freeze ) {
fgSetBool("/sim/freeze/master", false);
}
globals->get_renderer()->init();
int cur_width = fgGetInt("/sim/startup/xsize");
int cur_height = fgGetInt("/sim/startup/ysize");
- if (b1) delete( b1 );
+ delete( b1 );
// New empty (mostly) bitmap
b1 = new GlBitmap( GL_RGB, 1, 1, (unsigned char *)"123" );
int x,y;
globals->get_renderer()->resize( cur_width, cur_height );
// pan to tile
rotateView( 0, (y*fov)-((multiplier-1)*fov/2), (x*fov)-((multiplier-1)*fov/2) );
- globals->get_renderer()->update();
+ globals->get_renderer()->update( false );
// restore view
GlBitmap b2;
b1->copyBitmap( &b2, cur_width*x, cur_height*y );
int cur_width = fgGetInt("/sim/startup/xsize");
int cur_height = fgGetInt("/sim/startup/ysize");
p.Begin( "FlightGear", cur_width*3, cur_height*3 );
- p.End( hiResScreenCapture(3) );
+ p.End( hiResScreenCapture(3) );
// BusyCursor(1);
if ( show_pu_cursor ) {
#endif // #ifdef WIN32
-void dumpSnapShot ( puObject *obj ) {
+void fgDumpSnapShotWrapper ( puObject *obj ) {
fgDumpSnapShot();
}
-void dumpHiResSnapShot ( puObject *obj ) {
+void fgHiResDumpWrapper ( puObject *obj ) {
fgHiResDump();
}
// we need two render frames here to clear the menu and cursor
// ... not sure why but doing an extra fgRenderFrame() shouldn't
// hurt anything
- renderer->update();
- renderer->update();
+ renderer->update( true );
+ renderer->update( true );
while (count < 1000) {
FILE *fp;