summaryrefslogtreecommitdiff
path: root/layoutgl/texturemanager.h
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-08-03 05:16:52 +0200
committerTreeki <treeki@gmail.com>2012-08-03 05:16:52 +0200
commit7a183cfa367db01413c001306741d06e1826d077 (patch)
treee50e2e222ddf924e4d868e79ed87a0ced85d01e1 /layoutgl/texturemanager.h
parentebcc95da4c26369511caa90d89c5ed06e1e4853a (diff)
downloadLayoutStudio-7a183cfa367db01413c001306741d06e1826d077.tar.gz
LayoutStudio-7a183cfa367db01413c001306741d06e1826d077.zip
might as well push all this. a massive amount of changes
Diffstat (limited to 'layoutgl/texturemanager.h')
-rw-r--r--layoutgl/texturemanager.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/layoutgl/texturemanager.h b/layoutgl/texturemanager.h
new file mode 100644
index 0000000..07b7739
--- /dev/null
+++ b/layoutgl/texturemanager.h
@@ -0,0 +1,33 @@
+#ifndef TEXTUREMANAGER_H
+#define TEXTUREMANAGER_H
+
+#include "wii/texpalette.h"
+#include "lyt/layout.h"
+#include <QGLContext>
+#include <QHash>
+
+class LGLTextureManager {
+public:
+ LGLTextureManager();
+
+ void setup(QGLWidget *gl, const LYTLayout *layout);
+
+private:
+ const QGLContext *m_gl;
+ const LYTLayout *m_layout;
+ const LYTPackageBase *m_package;
+
+ QHash<QString, GLuint> m_textures;
+ QHash<QString, QImage> m_images;
+
+public:
+ GLuint glTextureForName(const QString name) const {
+ return m_textures.value(name);
+ }
+
+ QImage imageForName(const QString name) const {
+ return m_images.value(name);
+ }
+};
+
+#endif // TEXTUREMANAGER_H