BetterScreenShoting

This commit is contained in:
2018-06-30 01:16:05 -04:00
parent 36359ecb33
commit 269cbf8604
2 changed files with 11 additions and 3 deletions
+1
View File
@@ -259,3 +259,4 @@ paket-files/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
/TrooperEngineTest/test.bmp
@@ -112,7 +112,14 @@ void cRenderer::RenderDrawRect( const SDL_Rect& rect, SDL_Texture* dst /*= nullp
void cRenderer::ScreenShot( const cString& filename, const cString& dir /*= ""*/ )
{
SDL_Surface* infoSurface = SDL_GetWindowSurface(VideoEngine::cVideo::Inst().getWindow());
SDL_Surface* saveSurface = NewSurface();
if (infoSurface == nullptr)
cUtility::Inst().Message("Failed to create info surface from window.\n", __AT__, cUtility::eTypeSDL::SDL);
else {
SaveSurface(infoSurface, filename, dir);
SDL_FreeSurface(infoSurface);
infoSurface = NULL;
}
/*SDL_Surface* saveSurface = NewSurface();
if (infoSurface == NULL) {
cUtility::Inst().Message("Failed to create info surface from window.\n", __AT__, cUtility::eTypeSDL::SDL);
@@ -125,7 +132,7 @@ void cRenderer::ScreenShot( const cString& filename, const cString& dir /*= ""*/
infoSurface = NULL;
}
SDL_FreeSurface(saveSurface);
saveSurface = NULL;
saveSurface = NULL;*/
}