OpenCOVER
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CudaTextureRectangle.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5 
6 * License: LGPL 2+ */
7 
8 #ifdef HAVE_CUDA
9 
10 #ifndef CUDATEXTURERECTANGLE_H
11 #define CUDATEXTURERECTANGLE_H
12 
13 #include <osg/State>
14 #include <osg/TextureRectangle>
15 
16 #include "CudaGraphicsResource.h"
17 
18 
19 namespace opencover
20 {
21 
22 class CudaTextureRectangle : public osg::TextureRectangle
23 {
24 public:
25 
26  CudaTextureRectangle();
27  ~CudaTextureRectangle();
28 
29  virtual void apply(osg::State& state) const;
30 
31  void resize(osg::State* state, int w, int h, int dataTypeSize);
32  void* resourceData();
33  void clear();
34 
35 protected:
36 
37  osg::ref_ptr<osg::PixelDataBufferObject> pbo_;
38  CudaGraphicsResource resource_;
39  int resourceDataSize_;
40 };
41 
42 }
43 
44 #endif
45 
46 #endif