TinyGL 0.4.1 for MinGW
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
GLView.h
Go to the documentation of this file.
1#ifndef _glview_h_
2#define _glview_h_
3
4#define BGL_RGB 0
5#define BGL_INDEX 1
6#define BGL_SINGLE 0
7#define BGL_DOUBLE 2
8#define BGL_DIRECT 0
9#define BGL_INDIRECT 4
10#define BGL_ACCUM 8
11#define BGL_ALPHA 16
12#define BGL_DEPTH 32
13#define BGL_OVERLAY 64
14#define BGL_UNDERLAY 128
15#define BGL_STENCIL 512
16
17#include <interface/View.h>
18#include <support/Locker.h>
19#include <GL/gl.h>
20#include <GL/oscontext.h>
21#include <game/WindowScreen.h>
22#include <game/DirectWindow.h>
23
24class BGLView : public BView {
25public:
26 BGLView(BRect rect, char *name,
27 ulong resizingMode, ulong mode,
28 ulong options);
29 virtual ~BGLView();
30
31 void LockGL();
32 void UnlockGL();
34// BView *EmbeddedView();
35// status_t CopyPixelsOut(BPoint source, BBitmap *dest);
36// status_t CopyPixelsIn(BBitmap *source, BPoint dest);
37
38 virtual void ErrorCallback(GLenum errorCode);
39 virtual void Draw(BRect updateRect);
40 virtual void AttachedToWindow();
41 virtual void AllAttached();
42 virtual void DetachedFromWindow();
43 virtual void AllDetached();
44 virtual void FrameResized(float width, float height);
45// virtual status_t Perform(perform_code d, void *arg);
46
47 //
48 // Methods below are pass-throughs to BView for the moment.
49 //
50
51 virtual status_t Archive(BMessage *data, bool deep = true) const;
52 virtual void MessageReceived(BMessage *msg);
53 virtual void SetResizingMode(uint32 mode);
54
55 virtual void Show();
56 virtual void Hide();
57
58 virtual BHandler *ResolveSpecifier(BMessage *msg, int32 index,
59 BMessage *specifier, int32 form,
60 const char *property);
61 virtual status_t GetSupportedSuites(BMessage *data);
62 //void DirectConnected( direct_buffer_info *info );
63 //void EnableDirectMode( bool enabled );
64
65private:
66 ostgl_context *context;
67 BBitmap *bitmaps[2];
68 int currBitmap;
69 static BLocker locker;
70};
71
72#endif // _glview_h_
Definition: GLView.h:24
virtual status_t GetSupportedSuites(BMessage *data)
virtual void AllDetached()
BGLView(BRect rect, char *name, ulong resizingMode, ulong mode, ulong options)
virtual void FrameResized(float width, float height)
virtual void DetachedFromWindow()
virtual void Draw(BRect updateRect)
virtual void SetResizingMode(uint32 mode)
void SwapBuffers()
void UnlockGL()
void LockGL()
virtual void ErrorCallback(GLenum errorCode)
virtual BHandler * ResolveSpecifier(BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property)
virtual void Hide()
virtual void AttachedToWindow()
virtual void Show()
virtual status_t Archive(BMessage *data, bool deep=true) const
virtual ~BGLView()
virtual void MessageReceived(BMessage *msg)
virtual void AllAttached()
int GLenum
Definition: gl.h:662