• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

libkdegames

  • sources
  • kde-4.14
  • kdegames
  • libkdegames
chooserastergraphicssystem.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright 2011 Stefan Majewsky <majewsky@gmx.net> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU Library General Public License *
6  * version 2 as published by the Free Software Foundation *
7  * *
8  * This program is distributed in the hope that it will be useful, *
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
11  * GNU Library General Public License for more details. *
12  * *
13  * You should have received a copy of the GNU Library General Public *
14  * License along with this program; if not, write to the *
15  * Free Software Foundation, Inc., *
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
17  ***************************************************************************/
18 
19 #include <QtGui/QApplication>
20 
21 /*
22  * This file is only compiled on Q_WS_X11 (see CMakeLists.txt). It chooses the
23  * raster graphicssystem in anything linking against libkdegames.
24  *
25  * The raster graphicssystem has a much better performance in graphics-intense
26  * apps like games, compared to the X11 graphicssystem which is still the
27  * default in Qt 4.7. (Rumor has it that raster will become the default as of Qt
28  * 4.8.)
29  *
30  * This header ensures that raster is always used instead of X11 to enable a
31  * more fluent graphics experience. The relevant API call
32  * (QApplication::setGraphicsSystem) needs to be issued *before* the
33  * application object (QApplication or KApplication) is constructed, so we do it
34  * in a constructor of an anonymous global object.
35  *
36  * Constructors of global objects are called before main() by the C++ runtime.
37  */
38 
39 namespace { //don't export this struct and instance, it's internal affairs
40  struct ConfigureDefaultGraphicsSystem
41  {
42  ConfigureDefaultGraphicsSystem() {
43  QApplication::setGraphicsSystem(QLatin1String("raster"));
44  }
45  };
46  ConfigureDefaultGraphicsSystem staticObject;
47 }
QLatin1String
QApplication::setGraphicsSystem
void setGraphicsSystem(const QString &system)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdegames

Skip menu "libkdegames"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal