TGWin32GL.h

Go to the documentation of this file.
00001 // @(#)root/win32gdk:$Id: TGWin32GL.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Valeriy Onuchin  05/08/04
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGWin32GL
00013 #define ROOT_TGWin32GL
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TGWin32GL                                                            //
00019 //                                                                      //
00020 // The TGWin32GL is win32gdk implementation of TVirtualGLImp class.     //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TVirtualGL
00025 #include "TVirtualGL.h"
00026 #endif
00027 #ifndef ROOT_TVirtualViewer3D
00028 #include "TVirtualViewer3D.h"
00029 #endif
00030 
00031 
00032 class TGWin32GLManager : public TGLManager {
00033 private:
00034    class TGWin32GLImpl;
00035    TGWin32GLImpl *fPimpl;
00036 
00037 public:
00038    TGWin32GLManager();
00039    ~TGWin32GLManager();
00040 
00041    //All public functions are TGLManager's final-overriders
00042 
00043    //index returned can be used as a result of gVirtualX->InitWindow
00044    Int_t    InitGLWindow(Window_t winID);
00045    //winInd is the index, returned by InitGLWindow
00046    Int_t    CreateGLContext(Int_t winInd);
00047 
00048    //[            Off-screen rendering part
00049    //create DIB section to read GL buffer into it, 
00050    //ctxInd is the index, returned by CreateGLContext
00051    Bool_t   AttachOffScreenDevice(Int_t ctxInd, Int_t x, Int_t y, UInt_t w, UInt_t h);
00052    Bool_t   ResizeOffScreenDevice(Int_t devInd, Int_t x, Int_t y, UInt_t w, UInt_t h);
00053    //analog of gVirtualX->SelectWindow(fPixmapID) => gVirtualGL->SelectOffScreenDevice(fPixmapID)
00054    void     SelectOffScreenDevice(Int_t devInd);
00055    //Index of DIB, valid for gVirtualX
00056    Int_t    GetVirtualXInd(Int_t devInd);
00057    //copy DIB into window directly/by pad
00058    void     MarkForDirectCopy(Int_t devInd, Bool_t);
00059    //Off-screen device holds sizes for glViewport
00060    void     ExtractViewport(Int_t devInd, Int_t *vp);
00061    //Read GL buffer into DIB
00062    void     ReadGLBuffer(Int_t devInd);
00063    //]            
00064 
00065    //Make the gl context current
00066    Bool_t   MakeCurrent(Int_t devInd);
00067    //Swap buffers or "blits" DIB
00068    void     Flush(Int_t ctxInd);
00069    //Generic function for gl context and off-screen device deletion
00070    void     DeleteGLContext(Int_t devInd);
00071 
00072    //functions to switch between threads in win32
00073    //used by viewer
00074    Bool_t   SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox);
00075 
00076    Bool_t   PlotSelected(TVirtualGLPainter *plot, Int_t px, Int_t py);
00077    char    *GetPlotInfo(TVirtualGLPainter *plot, Int_t px, Int_t py);
00078 
00079    void     PaintSingleObject(TVirtualGLPainter *);
00080    void     PanObject(TVirtualGLPainter *o, Int_t x, Int_t y);
00081    void     PrintViewer(TVirtualViewer3D *vv);
00082 
00083    Bool_t   HighColorFormat(Int_t ctx);
00084 
00085 private:
00086    struct TGLContext;
00087    Bool_t   CreateDIB(TGLContext &ctx)const;
00088 
00089    TGWin32GLManager(const TGWin32GLManager &);
00090    TGWin32GLManager &operator = (const TGWin32GLManager &);
00091 
00092    ClassDef(TGWin32GLManager, 0)
00093 };
00094 
00095 #endif

Generated on Tue Jul 5 14:14:43 2011 for ROOT_528-00b_version by  doxygen 1.5.1