2 * Copyright 2006, Philippe Houdoin. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * This header defines BGLRenderer, the base class making up
6 * the Haiku GL renderer add-ons (essentially selfcontained C++
7 * shared libraries that do the actual rendering such as
8 * libswpipe.so and libswrast.so)
19 class GLRendererRoster
;
21 typedef unsigned long renderer_id
;
25 // Private unimplemented copy constructors
26 BGLRenderer(const BGLRenderer
&);
27 BGLRenderer
& operator=(const BGLRenderer
&);
30 BGLRenderer(BGLView
*view
, ulong bgl_options
,
31 BGLDispatcher
*dispatcher
);
32 virtual ~BGLRenderer();
37 virtual void LockGL();
38 virtual void UnlockGL();
40 virtual void SwapBuffers(bool VSync
= false);
41 virtual void Draw(BRect updateRect
);
42 virtual status_t
CopyPixelsOut(BPoint source
, BBitmap
*dest
);
43 virtual status_t
CopyPixelsIn(BBitmap
*source
, BPoint dest
);
45 virtual void FrameResized(float width
, float height
);
47 virtual void DirectConnected(direct_buffer_info
*info
);
48 virtual void EnableDirectMode(bool enabled
);
50 inline int32
ReferenceCount() const { return fRefCount
; };
51 inline ulong
Options() const { return fOptions
; };
52 inline BGLView
* GLView() { return fView
; };
53 inline BGLDispatcher
* GLDispatcher() { return fDispatcher
; };
56 friend class GLRendererRoster
;
58 virtual status_t
_Reserved_Renderer_0(int32
, void *);
59 virtual status_t
_Reserved_Renderer_1(int32
, void *);
60 virtual status_t
_Reserved_Renderer_2(int32
, void *);
61 virtual status_t
_Reserved_Renderer_3(int32
, void *);
62 virtual status_t
_Reserved_Renderer_4(int32
, void *);
64 int32 fRefCount
; // How much we're still useful
65 BGLView
* fView
; // Never forget who is the boss!
66 ulong fOptions
; // Keep that tune in memory
67 BGLDispatcher
* fDispatcher
;// Our personal GL API call dispatcher
69 GLRendererRoster
* fOwningRoster
;
73 extern "C" _EXPORT BGLRenderer
* instantiate_gl_renderer(BGLView
*view
, ulong options
, BGLDispatcher
*dispatcher
);
76 #endif // GLRENDERER_H