//  // // # # ### # # -= Nuclex Library =-  // // ## # # # ## ## VideoDriver.cpp - Graphics output device  // // ### # # ###  // // # ### # ### Manages a graphical output device like a software renderer  // // # ## # # ## ## or a graphics adapter accessed through a system API  // // # # ### # # R1 (C)2002-2004 Markus Ewald -> License.txt  // //  // #include "Nuclex/Video/VideoDriver.h" using namespace Nuclex; using namespace Nuclex::Video; using namespace Nuclex::Storage; // ############################################################################################# // // # VideoDriver::DisplayMode::load() # // // ############################################################################################# // /// Load display mode /** Loads a stored display mode from the serializer scope @param spScope Scope to load the display mode from */ void VideoDriver::DisplayMode::load(const shared_ptr &spScope) { Video::VideoDriver::DisplayMode DM; shared_ptr spResolution = spScope->openScope("Resolution"); Resolution.X = spResolution->get("_Width"); Resolution.Y = spResolution->get("_Height"); bFullscreen = spScope->get("Fullscreen"); nRefreshRate = spScope->get("RefreshRate"); eFormat = Surface::pixelFormatFromString(spScope->get("Format")); } // ############################################################################################# // // # saveDisplayMode() # // // ############################################################################################# // /// Save display mode /** Saves a display mode into a serializer scope @param spScope Scope to save the display mode into */ void Video::VideoDriver::DisplayMode::save(const shared_ptr &spScope) const { shared_ptr spResolution = spScope->createScope("Resolution"); spResolution->set("_Width", Resolution.X); spResolution->set("_Height", Resolution.Y); spScope->set("Fullscreen", bFullscreen); spScope->set("RefreshRate", nRefreshRate); spScope->set("Format", Surface::stringFromPixelFormat(eFormat)); }