Sat, 27 Apr 2013 02:52:32 +0300
Fixed view going blank after resize
gldraw.cpp | file | annotate | diff | comparison | revisions | |
gui_actions.cpp | file | annotate | diff | comparison | revisions |
--- 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); } // =============================================================================
--- 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; }