Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

openglrenderdevice.h 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef OPENGLRENDERDEVICE_H
  2. #define OPENGLRENDERDEVICE_H
  3. #include "engine/abstractrenderdevice.h"
  4. struct OpenGLTextureData
  5. {
  6. unsigned id;
  7. QImage image;
  8. char* rawData;
  9. };
  10. class OpenGLRenderDevice : public AbstractRenderDevice
  11. {
  12. Q_OBJECT
  13. public:
  14. explicit OpenGLRenderDevice(QObject *parent = 0);
  15. virtual Vector3D get2DFrom3D(const Vector3D& pos);
  16. virtual Vector3D get3DFrom2D(int x, int y);
  17. signals:
  18. public slots:
  19. virtual void loadTexture(const QVariant& id, const QImage& texture);
  20. virtual void initialize(int fov, int width, int height);
  21. virtual void resize(int width, int height);
  22. virtual void preDraw();
  23. virtual void postDraw();
  24. virtual void drawVertex(const ColorVector3D& point);
  25. virtual void drawPoint(const ColorVector3D& point);
  26. virtual void drawLine(const ColorVector3D& begin, const ColorVector3D& end, double width = 1.0);
  27. virtual void drawPolygon(const QList<ColorVector3D>& points);
  28. virtual void drawPolygonTexture(const QList<TextureVector3D>& points, const QVariant& textureId);
  29. private:
  30. int _width;
  31. int _height;
  32. int _fov;
  33. QMap<QVariant, OpenGLTextureData> _textures;
  34. };
  35. #endif // OPENGLRENDERDEVICE_H