diff options
author | marha <marha@users.sourceforge.net> | 2013-12-22 12:51:45 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-12-22 12:51:45 +0100 |
commit | c81020559f329a516191927222b3698ba7370aca (patch) | |
tree | 6f004f5723ca41881b2ba703ed619a92faebfe16 /mesalib/include/HaikuGL/GLView.h | |
parent | c043f97a8572e1f509251288d8bcd70d0fb96770 (diff) | |
download | vcxsrv-c81020559f329a516191927222b3698ba7370aca.tar.gz vcxsrv-c81020559f329a516191927222b3698ba7370aca.tar.bz2 vcxsrv-c81020559f329a516191927222b3698ba7370aca.zip |
libxtrans fontconfig glproto libX11 libxcb xcbproto mesa xserver pixman xkeyboard-config git update 22 Dec 2013
xserver commit a68df147421da21528b5be2d34678383922fa352
libxcb commit f653464554469b5767f1c99abced25a76bace047
libxcb/xcb-proto commit 4087fc682c5ceb849b74442e17a6b73176e5eecb
xkeyboard-config commit a224a636139d22e1dc7ca7d23782cd656e87bcf5
libX11 commit 3d69b0a83e62f8f6fbdd952fc49cdbdf8825e1e6
libXdmcp commit 089081dca4ba3598c6f9bf401c029378943b5854
libXext commit bb24f2970f2e425f4df90c9b73d078ad15a73fbb
libfontenc commit 3acba630d8b57084f7e92c15732408711ed5137a
libXinerama commit edd95182b26eb5d576d4878c559e0f17dddaa909
libXau commit 304a11be4727c5a7feeb2501e8e001466f8ce84e
xkbcomp commit e3e6e938535532bfad175c1635256ab7fb3ac943
pixman commit 945ab7a6f3eb6241f07e8f094dc0e647d1f10d9d
xextproto commit 3f355f138d6df57e067458a20f47307883048adb
randrproto commit e7526e6b5fe0966929cda10b2ded0258413744db
glproto commit f84853d97d5749308992412a215fa518b6536eb3
mkfontscale commit 880a0c4733e62e54e6a0f1238c7430727d23657b
xwininfo commit ba0d1b0da21d2dbdd81098ed5778f3792b472e13
libXft commit 4acfdaf95adb0a05c2a25550bdde036c865902f4
libXmu commit 22d9c590901e121936f50dee97dc60c4f7defb63
libxtrans commit 2c0a7840a28ae696e80e73157856d7a049fdf6c7
fontconfig commit 5c725f2f5829238d16116f782d00d8bb0defaf08
mesa commit 2efe7927d38983029784825fc4897e9b77aa237e
Diffstat (limited to 'mesalib/include/HaikuGL/GLView.h')
-rw-r--r-- | mesalib/include/HaikuGL/GLView.h | 193 |
1 files changed, 193 insertions, 0 deletions
diff --git a/mesalib/include/HaikuGL/GLView.h b/mesalib/include/HaikuGL/GLView.h new file mode 100644 index 000000000..b848578f6 --- /dev/null +++ b/mesalib/include/HaikuGL/GLView.h @@ -0,0 +1,193 @@ +/* + * Copyright 2008-2013, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * This header defines BGLView, the base class making up + * the Haiku GL Kit. + * + */ +#ifndef BGLVIEW_H +#define BGLVIEW_H + + +#include <GL/gl.h> + +#define BGL_RGB 0 +#define BGL_INDEX 1 +#define BGL_SINGLE 0 +#define BGL_DOUBLE 2 +#define BGL_DIRECT 0 +#define BGL_INDIRECT 4 +#define BGL_ACCUM 8 +#define BGL_ALPHA 16 +#define BGL_DEPTH 32 +#define BGL_OVERLAY 64 +#define BGL_UNDERLAY 128 +#define BGL_STENCIL 512 + +#ifdef __cplusplus + +#include <AppKit.h> +#include <Bitmap.h> +#include <DirectWindow.h> +#include <View.h> +#include <Window.h> +#include <WindowScreen.h> + + +struct glview_direct_info; +class BGLRenderer; +class GLRendererRoster; + +class BGLView : public BView { +public: + BGLView(BRect rect, const char* name, + ulong resizingMode, ulong mode, + ulong options); + virtual ~BGLView(); + + void LockGL(); + void UnlockGL(); + void SwapBuffers(); + void SwapBuffers(bool vSync); + + BView* EmbeddedView(); // deprecated, returns NULL + void* GetGLProcAddress(const char* procName); + + status_t CopyPixelsOut(BPoint source, BBitmap *dest); + status_t CopyPixelsIn(BBitmap *source, BPoint dest); + + // Mesa's GLenum is uint where Be's ones was ulong! + virtual void ErrorCallback(unsigned long errorCode); + + virtual void Draw(BRect updateRect); + virtual void AttachedToWindow(); + virtual void AllAttached(); + virtual void DetachedFromWindow(); + virtual void AllDetached(); + + virtual void FrameResized(float newWidth, float newHeight); + virtual status_t Perform(perform_code d, void *arg); + + virtual status_t Archive(BMessage *data, bool deep = true) const; + + virtual void MessageReceived(BMessage *message); + virtual void SetResizingMode(uint32 mode); + + virtual void Show(); + virtual void Hide(); + + virtual BHandler* ResolveSpecifier(BMessage *msg, int32 index, + BMessage *specifier, int32 form, + const char *property); + virtual status_t GetSupportedSuites(BMessage *data); + + void DirectConnected(direct_buffer_info *info); + void EnableDirectMode(bool enabled); + + void* getGC() { return fGc; } // ??? + + virtual void GetPreferredSize(float* width, float* height); + +private: + + virtual void _ReservedGLView1(); + virtual void _ReservedGLView2(); + virtual void _ReservedGLView3(); + virtual void _ReservedGLView4(); + virtual void _ReservedGLView5(); + virtual void _ReservedGLView6(); + virtual void _ReservedGLView7(); + virtual void _ReservedGLView8(); + + BGLView(const BGLView &); + BGLView &operator=(const BGLView &); + + void _DitherFront(); + bool _ConfirmDither(); + void _Draw(BRect rect); + void _CallDirectConnected(); + + void* fGc; + uint32 fOptions; + uint32 fDitherCount; + BLocker fDrawLock; + BLocker fDisplayLock; + glview_direct_info* fClipInfo; + + BGLRenderer* fRenderer; + GLRendererRoster* fRoster; + + BBitmap* fDitherMap; + BRect fBounds; + int16* fErrorBuffer[2]; + uint64 _reserved[8]; + + void _LockDraw(); + void _UnlockDraw(); + +// BeOS compatibility +private: + BGLView(BRect rect, char* name, + ulong resizingMode, ulong mode, + ulong options); +}; + + +class BGLScreen : public BWindowScreen { +public: + BGLScreen(char* name, + ulong screenMode, ulong options, + status_t *error, bool debug=false); + ~BGLScreen(); + + void LockGL(); + void UnlockGL(); + void SwapBuffers(); + // Mesa's GLenum is uint where Be's ones was ulong! + virtual void ErrorCallback(unsigned long errorCode); + + virtual void ScreenConnected(bool connected); + virtual void FrameResized(float width, float height); + virtual status_t Perform(perform_code code, void *arg); + + virtual status_t Archive(BMessage *data, bool deep = true) const; + virtual void MessageReceived(BMessage *message); + + virtual void Show(); + virtual void Hide(); + + virtual BHandler* ResolveSpecifier(BMessage *message, + int32 index, + BMessage *specifier, + int32 form, + const char *property); + virtual status_t GetSupportedSuites(BMessage *data); + +private: + + virtual void _ReservedGLScreen1(); + virtual void _ReservedGLScreen2(); + virtual void _ReservedGLScreen3(); + virtual void _ReservedGLScreen4(); + virtual void _ReservedGLScreen5(); + virtual void _ReservedGLScreen6(); + virtual void _ReservedGLScreen7(); + virtual void _ReservedGLScreen8(); + + BGLScreen(const BGLScreen &); + BGLScreen &operator=(const BGLScreen &); + + void* fGc; + long fOptions; + BLocker fDrawLock; + + int32 fColorSpace; + uint32 fScreenMode; + + uint64 _reserved[7]; +}; + +#endif // __cplusplus + +#endif // BGLVIEW_H |