c++ - Handle Alt Tab in fullscreen OpenGL application properly -
when trying implement simple opengl application, surprised while easy find plenty of examples , documentation on advanced rendering stuff, win32 framework poorly documented , samples , tutorials not implement basic cases, not mentioning advanced stuff multiple monitors. despite of several hours of searching unable find way handle alt-tab reliably.
how should opengl fullscreen application respond alt-tab? messages should app react (wm_activate, wm_activateapp)? should reaction be? (change display resolution, destroy / create rendering context, or destroy / create opengl resources?)
if application uses animation loop, suspend loop, minimize window. if changed display resolution , gamma revert settings before changing them.
there's no need destroy opengl context or resources; opengl uses abstract resource model: if program requires ram of gpu or other resources, programs resources swapped out transparently.
edit:
changing window visibility status may require reset opengl viewport, it's idea either call glviewport apropriately in display/rendering function, or @ least set in resize handler, followed complete redraw.
Comments
Post a Comment