mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-19 09:55:40 +00:00
Initial commit of current work on Prime World Editor
This commit is contained in:
39
UI/WTextureGLWidget.h
Normal file
39
UI/WTextureGLWidget.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef WTEXTUREGLWIDGET_H
|
||||
#define WTEXTUREGLWIDGET_H
|
||||
|
||||
#include <gl/glew.h>
|
||||
#include <QOpenGLWidget>
|
||||
|
||||
#include <Common/CTransform4f.h>
|
||||
#include <Common/CVector2f.h>
|
||||
#include <Core/CToken.h>
|
||||
#include <Resource/CTexture.h>
|
||||
#include <QTimer>
|
||||
|
||||
class WTextureGLWidget : public QOpenGLWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
float mAspectRatio;
|
||||
CTexture *mpTexture;
|
||||
CToken mTexToken;
|
||||
float mTexAspectRatio;
|
||||
CTransform4f mTexTransform;
|
||||
CVector2f mCheckerCoords[4];
|
||||
u32 mContextID;
|
||||
bool mInitialized;
|
||||
|
||||
public:
|
||||
explicit WTextureGLWidget(QWidget *parent = 0, CTexture *pTex = 0);
|
||||
~WTextureGLWidget();
|
||||
void initializeGL();
|
||||
void paintGL();
|
||||
void resizeGL(int w, int h);
|
||||
void SetTexture(CTexture *pTex);
|
||||
|
||||
private:
|
||||
void CalcTexTransform();
|
||||
void CalcCheckerCoords();
|
||||
};
|
||||
|
||||
#endif // WTEXTUREGLWIDGET_H
|
||||
Reference in New Issue
Block a user