Files
haiku-beta6/headers/os/opengl/GLRenderer.h
T

75 lines
2.0 KiB
C++
Raw Normal View History

2006-09-05 16:00:15 +00:00
/*
* Copyright 2006, Philippe Houdoin. All rights reserved.
* Distributed under the terms of the MIT License.
*/
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;
2006-09-07 07:47:22 +00:00
class GLRendererRoster;
typedef unsigned long renderer_id;
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
2006-09-07 21:13:53 +00:00
virtual void LockGL();
virtual void UnlockGL();
2006-09-05 16:00:15 +00:00
virtual void SwapBuffers(bool VSync = false);
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 FrameResized(float width, float height);
2005-06-26 20:21:09 +00:00
virtual void DirectConnected(direct_buffer_info *info);
virtual 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:
2006-09-07 07:47:22 +00:00
friend class GLRendererRoster;
virtual status_t _Reserved_Renderer_0(int32, void *);
virtual status_t _Reserved_Renderer_1(int32, void *);
virtual status_t _Reserved_Renderer_2(int32, void *);
virtual status_t _Reserved_Renderer_3(int32, void *);
virtual status_t _Reserved_Renderer_4(int32, void *);
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
2006-09-07 07:47:22 +00:00
GLRendererRoster *fOwningRoster;
renderer_id fID;
2005-06-26 20:21:09 +00:00
};
extern "C" _EXPORT BGLRenderer * instantiate_gl_renderer(BGLView *view, ulong options, BGLDispatcher *dispatcher);
2005-06-26 20:21:09 +00:00
#endif // GLRENDERER_H