BALL 1.5.0
Loading...
Searching...
No Matches
glOffscreenTarget.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4
5#ifndef BALL_VIEW_RENDERING_GLOFFSCREENTARGET_H
6#define BALL_VIEW_RENDERING_GLOFFSCREENTARGET_H
7
8#ifndef BALL_COMMON_GLOBAL_H
9# include <BALL/COMMON/global.h>
10#endif
11
12#ifndef BALL_VIEW_RENDERING_RENDERWINDOW_H
14#endif
15
16#ifndef BALL_VIEW_RENDERING_GLRENDERWINDOW_H
18#endif
19
20
21#include <QtGui/QPaintDevice>
22
23#include <boost/shared_ptr.hpp>
24
25class QGLPixelBuffer;
26
27namespace BALL
28{
29 namespace VIEW
30 {
37 : public RenderWindow,
38 public QPaintDevice
39 {
40 public:
43 GLOffscreenTarget(GLRenderWindow* share_from, const String& filename);
44
45 virtual void prepareRendering();
46 virtual void prepareUpscaling(Size final_width, Size final_height);
47
48 virtual bool resize(const unsigned int width, const unsigned int height);
49 virtual void refresh();
50
51 void tryUsePixelBuffer(bool use_pbo = true);
52
53 QImage getImage();
54 void updateImageTile(Size x_lower, Size y_lower, Size x_upper, Size y_upper);
55
56 virtual QPaintEngine* paintEngine() const;
57 virtual int metric(PaintDeviceMetric metric) const;
58
59 protected:
61
63
64 boost::shared_ptr<QGLPixelBuffer> pixel_buffer_;
65
67
69 };
70
71 }
72}
73#endif // BALL_VIEW_RENDERING_GLOFFSCREENTARGET_H
void tryUsePixelBuffer(bool use_pbo=true)
virtual bool resize(const unsigned int width, const unsigned int height)
boost::shared_ptr< QGLPixelBuffer > pixel_buffer_
virtual void prepareUpscaling(Size final_width, Size final_height)
void updateImageTile(Size x_lower, Size y_lower, Size x_upper, Size y_upper)
virtual QPaintEngine * paintEngine() const
virtual int metric(PaintDeviceMetric metric) const
GLOffscreenTarget(GLRenderWindow *share_from, const String &filename)
#define BALL_VIEW_EXPORT