Welcome to mirror list, hosted at ThFree Co, Russian Federation.

qgl_render_context.hpp « map - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bb628e1c4a7ed44e319d74c6d8345d2c1797b133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once

#include "graphics/opengl/gl_render_context.hpp"

#include "std/shared_ptr.hpp"

class QWidget;
class QGLContext;
class QGLWidget;

namespace qt
{
  namespace gl
  {
    class RenderContext : public graphics::gl::RenderContext
    {
    private:
      shared_ptr<QGLContext> m_context;
      shared_ptr<QWidget> m_parent;

      /// Creates a rendering context, which shares
      /// data(textures, display lists e.t.c) with renderContext.
      /// Used in rendering thread.
      RenderContext(RenderContext * renderContext);

    public:
      RenderContext(QGLWidget * widget);
      ~RenderContext();

      /// Make this rendering context current
      void makeCurrent();

      graphics::RenderContext * createShared();

      /// Leave previous logic, but fix thread widget deletion error.
      void endThreadDrawing(unsigned threadSlot);

      shared_ptr<QGLContext> context() const;
    };
  }
}