BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 t_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