Skip to content
Snippets Groups Projects
Select Git revision
  • 5216d1980f0c8b9795b044c1bf8e0c8f6a39aaea
  • master default protected
  • 72-improve-docs-for_optimal_setup
  • os-path-join
  • develop-GA
  • add-higher-spindown-components
  • v1.3
  • v1.2
  • v1.1.2
  • v1.1.0
  • v1.0.1
11 results

twoF_cumulative.py

Blame
  • 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
    	 */