Select Git revision
twoF_cumulative.py
WindowManager.cpp 12.11 KiB
/***************************************************************************
* Copyright (C) 2008 by Oliver Bock *
* oliver.bock[AT]aei.mpg.de *
* *
* This file is part of Einstein@Home. *
* *
* Einstein@Home is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, version 2 of the License. *
* *
* Einstein@Home is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with Einstein@Home. If not, see <http://www.gnu.org/licenses/>. *
* *
***************************************************************************/
#include "WindowManager.h"
WindowManager::WindowManager()
{
}
WindowManager::~WindowManager()
{
}
bool WindowManager::initialize(const int width, const int height)
{
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0) {
cerr << "Window system could not be initalized: " << SDL_GetError() << endl;
return false;
}
atexit(SDL_Quit);
// retrieve current video settings
const SDL_VideoInfo *videoInfo = SDL_GetVideoInfo();
if (videoInfo->current_w != 0) {
m_DesktopWidth = videoInfo->current_w;
}
if (videoInfo->current_h != 0) {
m_DesktopHeight = videoInfo->current_h;
}
if (videoInfo->vfmt->BitsPerPixel != 0) {
m_DesktopBitsPerPixel = videoInfo->vfmt->BitsPerPixel;
}
// set initial non-fullscreen resolution
m_WindowedWidth = width;
m_WindowedHeight = height;
/*
* SDL_ASYNCBLIT - Surface benutzt asynchrone Blits, wenn möglich
* SDL_ANYFORMAT - Erlaubt jedes Pixel-Format (nur beim display-surface)
* SDL_FULLSCREEN - Surface im Full-Screen-Mode initialisieren (nur display-surface)
* SDL_OPENGL - Surface nutzt OpenGL (nur display-surface)
* SDL_RESIZABLE - Surfacefenster ist veränderbar (nur display-Surface)
* SDL_HWACCEL- Surface blit nutzt Hardwarebeschleunigung
* SDL_SRCCOLORKEY - Surface nutzt colorkey blitting
* SDL_RLEACCEL - Colorkey blitting ist durch RLE beschleunigt
* SDL_SRCALPHA - Surface blit nutzt alpha blending
* SDL_PREALLOC - Surface nutzt vorher allokierten Speicher
*/