BALL  1.5.0
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 
25 class QGLPixelBuffer;
26 
27 namespace 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
BALL::VIEW::GLOffscreenTarget::pixel_buffer_
boost::shared_ptr< QGLPixelBuffer > pixel_buffer_
Definition: glOffscreenTarget.h:64
BALL::VIEW::GLOffscreenTarget
Definition: glOffscreenTarget.h:36
renderWindow.h
BALL::VIEW::GLOffscreenTarget::filename_
String filename_
Definition: glOffscreenTarget.h:60
BALL::String
Definition: string.h:56
BALL
Definition: constants.h:12
BALL::VIEW::GLOffscreenTarget::use_pixel_buffer_
bool use_pixel_buffer_
Definition: glOffscreenTarget.h:66
BALL::VIEW::GLOffscreenTarget::current_image_
QImage current_image_
Definition: glOffscreenTarget.h:68
glRenderWindow.h
BALL_SIZE_TYPE
global.h
BALL::VIEW::GLOffscreenTarget::share_from_
GLRenderWindow * share_from_
Definition: glOffscreenTarget.h:62
QPaintDevice
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
BALL::VIEW::GLRenderWindow
Definition: glRenderWindow.h:37
BALL::VIEW::TRenderWindow
Definition: renderWindow.h:33