Merge branch 'ct' of git.pipapo.org:cinelerra-ct into ct
[cinelerra_cv/ct.git] / guicast / bcpbuffer.h
blob7027052f79d61aa32ec389d7e44666db72f8a72f
1 #ifndef BCPBUFFER_H
2 #define BCPBUFFER_H
4 #if defined(HAVE_CONFIG_H)
5 #include "config.h"
6 #endif
8 #ifdef HAVE_GL
9 #include <GL/glx.h>
10 #endif
12 #include "vframe.inc"
15 // This is created by the user to create custom PBuffers and by VFrame.
16 // Uses the window currently bound by BC_WindowBase::enable_opengl to
17 // create pbuffer.
18 // Must be called synchronously.
19 class BC_PBuffer
21 public:
22 BC_PBuffer(int w, int h);
23 ~BC_PBuffer();
25 friend class VFrame;
27 void reset();
28 // Must be called after BC_WindowBase::enable_opengl to make the PBuffer
29 // the current drawing surface. Call BC_WindowBase::enable_opengl
30 // after this to switch back to the window.
31 void enable_opengl();
32 #ifdef HAVE_GL
33 GLXPbuffer get_pbuffer();
34 #endif
36 private:
37 // Called by constructor
38 void new_pbuffer(int w, int h);
40 #ifdef HAVE_GL
41 GLXPbuffer pbuffer;
42 GLXContext gl_context;
43 #endif
44 int w;
45 int h;
46 int window_id;
53 #endif
55 // Local Variables:
56 // mode: C++
57 // c-file-style: "linux"
58 // End: