summaryrefslogtreecommitdiff
path: root/layoutgl/widget.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/widget.h
parentebcc95da4c26369511caa90d89c5ed06e1e4853a (diff)
downloadLayoutStudio-7a183cfa367db01413c001306741d06e1826d077.tar.gz
LayoutStudio-7a183cfa367db01413c001306741d06e1826d077.zip
might as well push all this. a massive amount of changes
Diffstat (limited to '')
-rw-r--r--layoutgl/widget.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/layoutgl/widget.h b/layoutgl/widget.h
new file mode 100644
index 0000000..e6abdfc
--- /dev/null
+++ b/layoutgl/widget.h
@@ -0,0 +1,53 @@
+#ifndef WIDGET_H
+#define WIDGET_H
+
+#include <QGLWidget>
+
+#include "lyt/layout.h"
+#include "layoutgl/texturemanager.h"
+
+class LGLWidget : public QGLWidget
+{
+ Q_OBJECT
+public:
+ explicit LGLWidget(QWidget *parent = 0);
+
+ void setLayout(LYTLayout *layout);
+
+protected:
+ void initializeGL();
+ void resizeGL(int w, int h);
+ void paintGL();
+
+ LYTLayout *m_layout;
+
+ void renderPane(const LYTPane *pane);
+
+ void drawPicture(const LYTPicture *pic);
+ void drawWindow(const LYTWindow *wnd);
+
+ const LYTMaterial &getMaterial(const QString &materialName) {
+ return *m_layout->materials.getMaterialByName(materialName);
+ }
+
+ void useMaterial(const QString &materialName);
+ void useMaterial(const LYTMaterial &material);
+
+ void drawQuad(float x, float y, float w, float h, const QVector<LYTTexCoords> &texCoords, const QColor *colours, uchar alpha);
+ void drawQuad(float x, float y, float w, float h, int texCoordCount, const LYTTexCoords *texCoords, const QColor *colours, uchar alpha);
+
+ void getTextureSize(const QString &materialName, float *w, float *h);
+
+ void dealWithWindowFrame(LYTTexCoords &coords, const QString &materialName, int flipType,
+ float pieceWidth, float pieceHeight,
+ int rep1, int rep2, int rep3, int rep4);
+
+ LGLTextureManager m_texMgr;
+
+signals:
+
+public slots:
+
+};
+
+#endif // WIDGET_H