# HG changeset patch # User Santeri Piippo # Date 1367020352 -10800 # Node ID b2b8b45f6f5f1493acc57169de50eeae73dbd047 # Parent e3c37b950a685fb93cd0eab036d582af5097f459 Fixed view going blank after resize diff -r e3c37b950a68 -r b2b8b45f6f5f gldraw.cpp --- a/gldraw.cpp Sat Apr 27 02:17:03 2013 +0300 +++ b/gldraw.cpp Sat Apr 27 02:52:32 2013 +0300 @@ -112,11 +112,8 @@ darkbg = luma (col) < 80; - glClearColor ( - ((double)col.red()) / 255.0f, - ((double)col.green()) / 255.0f, - ((double)col.blue()) / 255.0f, - 1.0f); + col.setAlpha (255); + qglClearColor (col); } // ============================================================================= @@ -246,9 +243,10 @@ height = h; glViewport (0, 0, w, h); + glMatrixMode (GL_PROJECTION); glLoadIdentity (); - glMatrixMode (GL_PROJECTION); gluPerspective (45.0f, (double)w / (double)h, 0.1f, 100.0f); + glMatrixMode (GL_MODELVIEW); } // ============================================================================= diff -r e3c37b950a68 -r b2b8b45f6f5f gui_actions.cpp --- a/gui_actions.cpp Sat Apr 27 02:17:03 2013 +0300 +++ b/gui_actions.cpp Sat Apr 27 02:52:32 2013 +0300 @@ -334,6 +334,8 @@ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= MAKE_ACTION (screencap, "Screencap Part", "screencap", "Save a picture of the model", (0)) { + setlocale (LC_ALL, "C"); + ushort w, h; uchar* imagedata = g_ForgeWindow->R->screencap (w, h); @@ -342,7 +344,7 @@ str fname = QFileDialog::getSaveFileName (); if (~fname > 0 && !img.save (fname)) - critical (format ("Couldn't open %s for saving screencap: %s", fname.chars(), strerror (errno))); + critical (format ("Couldn't open %s for writing to save screencap: %s", fname.chars(), strerror (errno))); delete[] imagedata; }