Stupid me. I don't know why I moved the GLView.h here at first, but now I know why
authorPhilippe Houdoin <phoudoin@freedesktop.org>
Mon, 16 Aug 2004 08:39:36 +0000 (08:39 +0000)
committerPhilippe Houdoin <phoudoin@freedesktop.org>
Mon, 16 Aug 2004 08:39:36 +0000 (08:39 +0000)
I shouldn't:
Official BeOS GLView.h defines a virtual ErrorCallback(GLenum) method, assuming
a unsigned long GLenum.
But under Mesa, GLenum is unsigned int.
To keep binary compatibility, BeOS apps including Mesa GL/gl.h MUST include *our*
GLView.h, or linker will report a missing ErrorCallback(unsigned int) symbol. Glup.

include/GLView.h [new file with mode: 0644]
src/mesa/drivers/beos/GLView.cpp
src/mesa/drivers/beos/GLView.h [deleted file]

diff --git a/include/GLView.h b/include/GLView.h
new file mode 100644 (file)
index 0000000..8d9d25b
--- /dev/null
@@ -0,0 +1,192 @@
+/*******************************************************************************
+/
+/      File:           GLView.h
+/
+/      Copyright 1993-98, Be Incorporated, All Rights Reserved.
+/
+*******************************************************************************/
+
+#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 <interface/Window.h>
+#include <interface/View.h>
+#include <interface/Bitmap.h>
+#include <game/WindowScreen.h>
+#include <game/DirectWindow.h>
+
+class BGLView : public BView {
+public:
+
+                                       BGLView(BRect rect, char *name,
+                                               ulong resizingMode, ulong mode,
+                                               ulong options);
+virtual                        ~BGLView();
+
+               void            LockGL();
+               void            UnlockGL();
+               void            SwapBuffers();
+               void            SwapBuffers( bool vSync );
+               BView *     EmbeddedView();
+               status_t    CopyPixelsOut(BPoint source, BBitmap *dest);
+               status_t    CopyPixelsIn(BBitmap *source, BPoint dest);
+virtual        void        ErrorCallback(unsigned long errorCode);     // Mesa's GLenum is uint where Be's ones was ulong!
+               
+virtual        void            Draw(BRect updateRect);
+
+virtual void           AttachedToWindow();
+virtual void        AllAttached();
+virtual void        DetachedFromWindow();
+virtual void        AllDetached();
+virtual void           FrameResized(float width, float height);
+virtual status_t    Perform(perform_code d, void *arg);
+
+       /* The public methods below, for the moment,
+          are just pass-throughs to BView */
+
+virtual status_t    Archive(BMessage *data, bool deep = true) const;
+
+virtual void        MessageReceived(BMessage *msg);
+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);
+
+/* New public functions */
+               void            DirectConnected( direct_buffer_info *info );
+               void            EnableDirectMode( bool enabled );
+
+               void *          getGC() { return m_gc; }
+               
+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        dither_front();
+               bool        confirm_dither();
+               void        draw(BRect r);
+               
+               void *          m_gc;
+               uint32          m_options;
+               uint32      m_ditherCount;
+               BLocker         m_drawLock;
+               BLocker     m_displayLock;
+               void *          m_clip_info;
+               void *          _Unused1;
+
+               BBitmap *   m_ditherMap;
+               BRect       m_bounds;
+               int16 *     m_errorBuffer[2];
+               uint64      _reserved[8];
+
+       /* Direct Window stuff */
+private:       
+               void            drawScanline( int x1, int x2, int y, void *data );
+static         void            scanlineHandler(struct rasStateRec *state, GLint x1, GLint x2);
+
+               void            lock_draw();
+               void            unlock_draw();
+               bool            validateView();
+};
+
+
+
+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();
+       virtual void        ErrorCallback(GLenum errorCode);
+
+       virtual void            ScreenConnected(bool connected);
+       virtual void            FrameResized(float width, float height);
+       virtual status_t    Perform(perform_code d, void *arg);
+
+       /* The public methods below, for the moment,
+          are just pass-throughs to BWindowScreen */
+
+       virtual status_t    Archive(BMessage *data, bool deep = true) const;
+       virtual void        MessageReceived(BMessage *msg);
+
+       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);
+
+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 *          m_gc;
+       long            m_options;
+       BLocker         m_drawLock;
+               
+       int32           m_colorSpace;
+       uint32          m_screen_mode;
+               
+       uint64      _reserved[7];
+};
+
+#endif // __cplusplus
+
+#endif // BGLVIEW_H
+
+
+
+
+
index 80af9bd4168dbc965074b6046557323ebcb002f3..69f4cf90747ee7388e7522b63cdd781e833ca1fb 100644 (file)
@@ -59,7 +59,7 @@ extern "C" {
 }      // extern "C"
 
 #include <interface/Screen.h>
-#include "GLView.h"
+#include <GLView.h>
 
 // BeOS component ordering for B_RGBA32 bitmap format
 #if B_HOST_IS_LENDIAN
diff --git a/src/mesa/drivers/beos/GLView.h b/src/mesa/drivers/beos/GLView.h
deleted file mode 100644 (file)
index 8d9d25b..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
-/
-/      File:           GLView.h
-/
-/      Copyright 1993-98, Be Incorporated, All Rights Reserved.
-/
-*******************************************************************************/
-
-#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 <interface/Window.h>
-#include <interface/View.h>
-#include <interface/Bitmap.h>
-#include <game/WindowScreen.h>
-#include <game/DirectWindow.h>
-
-class BGLView : public BView {
-public:
-
-                                       BGLView(BRect rect, char *name,
-                                               ulong resizingMode, ulong mode,
-                                               ulong options);
-virtual                        ~BGLView();
-
-               void            LockGL();
-               void            UnlockGL();
-               void            SwapBuffers();
-               void            SwapBuffers( bool vSync );
-               BView *     EmbeddedView();
-               status_t    CopyPixelsOut(BPoint source, BBitmap *dest);
-               status_t    CopyPixelsIn(BBitmap *source, BPoint dest);
-virtual        void        ErrorCallback(unsigned long errorCode);     // Mesa's GLenum is uint where Be's ones was ulong!
-               
-virtual        void            Draw(BRect updateRect);
-
-virtual void           AttachedToWindow();
-virtual void        AllAttached();
-virtual void        DetachedFromWindow();
-virtual void        AllDetached();
-virtual void           FrameResized(float width, float height);
-virtual status_t    Perform(perform_code d, void *arg);
-
-       /* The public methods below, for the moment,
-          are just pass-throughs to BView */
-
-virtual status_t    Archive(BMessage *data, bool deep = true) const;
-
-virtual void        MessageReceived(BMessage *msg);
-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);
-
-/* New public functions */
-               void            DirectConnected( direct_buffer_info *info );
-               void            EnableDirectMode( bool enabled );
-
-               void *          getGC() { return m_gc; }
-               
-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        dither_front();
-               bool        confirm_dither();
-               void        draw(BRect r);
-               
-               void *          m_gc;
-               uint32          m_options;
-               uint32      m_ditherCount;
-               BLocker         m_drawLock;
-               BLocker     m_displayLock;
-               void *          m_clip_info;
-               void *          _Unused1;
-
-               BBitmap *   m_ditherMap;
-               BRect       m_bounds;
-               int16 *     m_errorBuffer[2];
-               uint64      _reserved[8];
-
-       /* Direct Window stuff */
-private:       
-               void            drawScanline( int x1, int x2, int y, void *data );
-static         void            scanlineHandler(struct rasStateRec *state, GLint x1, GLint x2);
-
-               void            lock_draw();
-               void            unlock_draw();
-               bool            validateView();
-};
-
-
-
-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();
-       virtual void        ErrorCallback(GLenum errorCode);
-
-       virtual void            ScreenConnected(bool connected);
-       virtual void            FrameResized(float width, float height);
-       virtual status_t    Perform(perform_code d, void *arg);
-
-       /* The public methods below, for the moment,
-          are just pass-throughs to BWindowScreen */
-
-       virtual status_t    Archive(BMessage *data, bool deep = true) const;
-       virtual void        MessageReceived(BMessage *msg);
-
-       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);
-
-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 *          m_gc;
-       long            m_options;
-       BLocker         m_drawLock;
-               
-       int32           m_colorSpace;
-       uint32          m_screen_mode;
-               
-       uint64      _reserved[7];
-};
-
-#endif // __cplusplus
-
-#endif // BGLVIEW_H
-
-
-
-
-