Files
haiku-beta6/src/kits/opengl/GLRenderer.h
T

64 lines
1.6 KiB
C++
Raw Normal View History

2005-06-26 20:21:09 +00:00
#ifndef GLRENDERER_H
#define GLRENDERER_H
#include <BeBuild.h>
#include <GLView.h>
2005-06-26 20:21:09 +00:00
class BGLDispatcher;
2005-06-26 20:21:09 +00:00
class BGLRenderer
2005-06-26 20:21:09 +00:00
{
2005-06-26 20:21:09 +00:00
// Private unimplemented copy constructors
BGLRenderer(const BGLRenderer &);
BGLRenderer & operator=(const BGLRenderer &);
2005-06-26 20:21:09 +00:00
public:
BGLRenderer(BGLView *view, ulong bgl_options, BGLDispatcher *dispatcher);
virtual ~BGLRenderer();
2005-06-26 20:21:09 +00:00
void Acquire();
void Release();
2005-06-26 20:21:09 +00:00
void LockGL();
void UnlockGL();
virtual void SwapBuffers(bool VSync = false) const;
virtual void Draw(BRect updateRect);
virtual status_t CopyPixelsOut(BPoint source, BBitmap *dest);
virtual status_t CopyPixelsIn(BBitmap *source, BPoint dest);
2005-06-26 20:21:09 +00:00
virtual void AttachedToWindow();
virtual void AllAttached();
virtual void DetachedFromWindow();
virtual void AllDetached();
2005-06-26 20:21:09 +00:00
virtual void FrameResized(float width, float height);
2005-06-26 20:21:09 +00:00
void DirectConnected( direct_buffer_info *info );
void EnableDirectMode( bool enabled );
2005-06-26 20:21:09 +00:00
inline int32 ReferenceCount() { return fRefCount; };
inline ulong Options() { return fOptions; };
inline BGLView * GLView() { return fView; };
inline BGLDispatcher * GLDispatcher() { return fDispatcher; };
private:
volatile int32 fRefCount; // How much we're still usefull?
BGLView * fView; // Never forget who is the boss!
ulong fOptions; // Keep that tune in memory
BGLDispatcher * fDispatcher; // Our personal OpenGL API call dispatcher
2005-06-26 20:21:09 +00:00
};
extern "C" _EXPORT BGLRenderer * instanciate_gl_renderer(BGLView *view, BGLDispatcher *dispatcher);
2005-06-26 20:21:09 +00:00
#endif // GLRENDERER_H