blob: e95f73cb536e9f242a72d1688b7cb19f827dd152 (
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();
shared_ptr<graphics::RenderContext> createShared();
/// Leave previous logic, but fix thread widget deletion error.
void endThreadDrawing(unsigned threadSlot);
shared_ptr<QGLContext> context() const;
};
}
}
|