ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

GLView.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 /
00003 /   File:       GLView.h
00004 /
00005 /   Copyright 1993-98, Be Incorporated, All Rights Reserved.
00006 /
00007 *******************************************************************************/
00008 
00009 #ifndef BGLVIEW_H
00010 #define BGLVIEW_H
00011 
00012 #include <GL/gl.h>
00013 
00014 #define BGL_RGB         0
00015 #define BGL_INDEX       1 
00016 #define BGL_SINGLE      0
00017 #define BGL_DOUBLE      2
00018 #define BGL_DIRECT      0
00019 #define BGL_INDIRECT    4
00020 #define BGL_ACCUM       8
00021 #define BGL_ALPHA       16
00022 #define BGL_DEPTH       32
00023 #define BGL_OVERLAY     64
00024 #define BGL_UNDERLAY    128
00025 #define BGL_STENCIL     512
00026 
00027 #ifdef __cplusplus
00028 
00029 
00030 #include <AppKit.h>
00031 #include <interface/Window.h>
00032 #include <interface/View.h>
00033 #include <interface/Bitmap.h>
00034 #include <game/WindowScreen.h>
00035 #include <game/DirectWindow.h>
00036 
00037 class BGLView : public BView {
00038 public:
00039 
00040                     BGLView(BRect rect, char *name,
00041                         ulong resizingMode, ulong mode,
00042                         ulong options);
00043 virtual             ~BGLView();
00044 
00045         void        LockGL();
00046         void        UnlockGL();
00047         void        SwapBuffers();
00048         void        SwapBuffers( bool vSync );
00049         BView *     EmbeddedView();
00050         status_t    CopyPixelsOut(BPoint source, BBitmap *dest);
00051         status_t    CopyPixelsIn(BBitmap *source, BPoint dest);
00052 virtual void        ErrorCallback(unsigned long errorCode);     // Mesa's GLenum is uint where Be's ones was ulong!
00053         
00054 virtual void        Draw(BRect updateRect);
00055 
00056 virtual void        AttachedToWindow();
00057 virtual void        AllAttached();
00058 virtual void        DetachedFromWindow();
00059 virtual void        AllDetached();
00060  
00061 virtual void        FrameResized(float width, float height);
00062 virtual status_t    Perform(perform_code d, void *arg);
00063 
00064     /* The public methods below, for the moment,
00065        are just pass-throughs to BView */
00066 
00067 virtual status_t    Archive(BMessage *data, bool deep = true) const;
00068 
00069 virtual void        MessageReceived(BMessage *msg);
00070 virtual void        SetResizingMode(uint32 mode);
00071 
00072 virtual void        Show();
00073 virtual void        Hide();
00074 
00075 virtual BHandler   *ResolveSpecifier(BMessage *msg, int32 index,
00076                             BMessage *specifier, int32 form,
00077                             const char *property);
00078 virtual status_t    GetSupportedSuites(BMessage *data);
00079 
00080 /* New public functions */
00081         void        DirectConnected( direct_buffer_info *info );
00082         void        EnableDirectMode( bool enabled );
00083 
00084         void *      getGC() { return m_gc; }
00085         
00086 private:
00087 
00088 virtual void        _ReservedGLView1();
00089 virtual void        _ReservedGLView2(); 
00090 virtual void        _ReservedGLView3(); 
00091 virtual void        _ReservedGLView4(); 
00092 virtual void        _ReservedGLView5(); 
00093 virtual void        _ReservedGLView6(); 
00094 virtual void        _ReservedGLView7(); 
00095 virtual void        _ReservedGLView8(); 
00096 
00097                     BGLView(const BGLView &);
00098                     BGLView     &operator=(const BGLView &);
00099 
00100         void        dither_front();
00101         bool        confirm_dither();
00102         void        draw(BRect r);
00103         
00104         void *      m_gc;
00105         uint32      m_options;
00106         uint32      m_ditherCount;
00107         BLocker     m_drawLock;
00108         BLocker     m_displayLock;
00109         void *      m_clip_info;
00110         void *      _Unused1;
00111 
00112         BBitmap *   m_ditherMap;
00113         BRect       m_bounds;
00114         int16 *     m_errorBuffer[2];
00115         uint64      _reserved[8];
00116 
00117     /* Direct Window stuff */
00118 private:    
00119         void        drawScanline( int x1, int x2, int y, void *data );
00120 static  void        scanlineHandler(struct rasStateRec *state, GLint x1, GLint x2);
00121 
00122         void        lock_draw();
00123         void        unlock_draw();
00124         bool        validateView();
00125 };
00126 
00127 
00128 
00129 class BGLScreen : public BWindowScreen {
00130 public:
00131     BGLScreen(char *name,
00132             ulong screenMode, ulong options,
00133             status_t *error, bool debug=false);
00134     ~BGLScreen();
00135 
00136     void        LockGL();
00137     void        UnlockGL();
00138     void        SwapBuffers();
00139     virtual void        ErrorCallback(GLenum errorCode);
00140 
00141     virtual void        ScreenConnected(bool connected);
00142     virtual void        FrameResized(float width, float height);
00143     virtual status_t    Perform(perform_code d, void *arg);
00144 
00145     /* The public methods below, for the moment,
00146        are just pass-throughs to BWindowScreen */
00147 
00148     virtual status_t    Archive(BMessage *data, bool deep = true) const;
00149     virtual void        MessageReceived(BMessage *msg);
00150 
00151     virtual void        Show();
00152     virtual void        Hide();
00153 
00154     virtual BHandler   *ResolveSpecifier(BMessage *msg,
00155                         int32 index,
00156                         BMessage *specifier,
00157                         int32 form,
00158                         const char *property);
00159     virtual status_t    GetSupportedSuites(BMessage *data);
00160 
00161 private:
00162 
00163     virtual void        _ReservedGLScreen1();
00164     virtual void        _ReservedGLScreen2();
00165     virtual void        _ReservedGLScreen3();
00166     virtual void        _ReservedGLScreen4();
00167     virtual void        _ReservedGLScreen5();
00168     virtual void        _ReservedGLScreen6();
00169     virtual void        _ReservedGLScreen7();
00170     virtual void        _ReservedGLScreen8(); 
00171 
00172     BGLScreen(const BGLScreen &);
00173     BGLScreen   &operator=(const BGLScreen &);
00174 
00175     void *      m_gc;
00176     long        m_options;
00177     BLocker     m_drawLock;
00178         
00179     int32       m_colorSpace;
00180     uint32      m_screen_mode;
00181         
00182     uint64      _reserved[7];
00183 };
00184 
00185 #endif  // __cplusplus
00186 
00187 #endif  // BGLVIEW_H
00188 
00189 
00190 
00191 
00192 

Generated on Thu May 24 2012 04:20:10 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.