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

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
texturemanager.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 Henry de Valence <hdevalence@gmail.com>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 
18 */
19 
20 #ifndef TEXTUREMANAGER_H
21 #define TEXTUREMANAGER_H
22 
23 #include <QObject>
24 #include <QHash>
25 
26 #include <config-kstars.h>
27 
28 class QGLWidget;
29 class QImage;
30 
33 class TextureManager : public QObject
34 {
35  Q_OBJECT
36 public:
38  static TextureManager* Create();
39 
43  static const QImage& getImage(const QString& name);
44 
45 #ifdef HAVE_OPENGL
46 
48  static void bindTexture(const QString& name, QGLWidget* cxt);
49 
51  static void bindFromImage(const QImage& image, QGLWidget* cxt);
52 #endif
53 
54 private:
56  typedef QHash<QString,QImage>::const_iterator CacheIter;
57 
59  explicit TextureManager(QObject* parent = 0);
62  static CacheIter findTexture(const QString& name);
63 
64 
65  // Pointer to singleton instance
66  static TextureManager* m_p;
67  // List of named textures
68  QHash<QString,QImage> m_textures;
69 
70  // Prohibit copying
71  TextureManager(const TextureManager&);
72  TextureManager& operator = (const TextureManager&);
73 };
74 
75 #endif // TEXTUREMANAGER_H
TextureManager
a singleton class to manage texture loading/retrieval
Definition: texturemanager.h:33
QObject
TextureManager::getImage
static const QImage & getImage(const QString &name)
Return texture image.
Definition: texturemanager.cpp:44
TextureManager::Create
static TextureManager * Create()
Create the instance of TextureManager.
Definition: texturemanager.cpp:38
QGLWidget
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

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