Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TX11GL.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/gl:$Id$
0002 // Author: Timur Pocheptsov 09/08/2004
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TX11GL
0013 #define ROOT_TX11GL
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TX11GL                                                               //
0019 //                                                                      //
0020 // The TX11GL is X11 implementation of TVirtualGLImp class.             //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TVirtualGL.h"
0025 
0026 #if !defined(__CLING__)
0027 #include <GL/glx.h>
0028 #else
0029 typedef struct _XDisplay Display;
0030 struct XVisualInfo;
0031 #endif
0032 
0033 
0034 class TX11GLManager : public TGLManager {
0035 private:
0036    class TX11GLImpl;
0037    TX11GLImpl *fPimpl;
0038 
0039 public:
0040    TX11GLManager();
0041    ~TX11GLManager() override;
0042 
0043    //All public functions are TGLManager's final-overriders
0044 
0045    //index returned can be used as a result of gVirtualX->InitWindow
0046    Int_t    InitGLWindow(Window_t winID) override;
0047    //winInd is the index, returned by InitGLWindow
0048    Int_t    CreateGLContext(Int_t winInd) override;
0049 
0050    //[            Off-screen rendering part
0051    //create pixmap to read GL buffer into it,
0052    //ctxInd is the index, returned by CreateGLContext
0053    Bool_t   AttachOffScreenDevice(Int_t ctxInd, Int_t x, Int_t y, UInt_t w, UInt_t h) override;
0054    Bool_t   ResizeOffScreenDevice(Int_t devInd, Int_t x, Int_t y, UInt_t w, UInt_t h) override;
0055    //analog of gVirtualX->SelectWindow(fPixmapID) => gVirtualGL->SelectOffScreenDevice(fPixmapID)
0056    void     SelectOffScreenDevice(Int_t devInd) override;
0057    //Index of pixmap, valid for gVirtualX
0058    Int_t    GetVirtualXInd(Int_t devInd) override;
0059    //copy pixmap into window directly/by pad
0060    void     MarkForDirectCopy(Int_t devInd, Bool_t) override;
0061    //Off-screen device holds sizes for glViewport
0062    void     ExtractViewport(Int_t devInd, Int_t *vp) override;
0063    //Read GL buffer into pixmap
0064    void     ReadGLBuffer(Int_t devInd) override;
0065    //]
0066 
0067    //Make the gl context current
0068    Bool_t   MakeCurrent(Int_t devInd) override;
0069    //Sswap buffers or copies pixmap (XCopyArea)
0070    void     Flush(Int_t ctxInd) override;
0071    //Generic function for gl context and off-screen device deletion
0072    void     DeleteGLContext(Int_t devInd) override;
0073 
0074    //used by viewer
0075    Bool_t   SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox) override;
0076    //
0077    Bool_t   PlotSelected(TVirtualGLPainter *plot, Int_t px, Int_t py) override;
0078    char    *GetPlotInfo(TVirtualGLPainter *plot, Int_t px, Int_t py) override;
0079    //
0080    void     PaintSingleObject(TVirtualGLPainter *) override;
0081    void     PanObject(TVirtualGLPainter *o, Int_t x, Int_t y) override;
0082    void     PrintViewer(TVirtualViewer3D *vv) override;
0083 
0084    Bool_t   HighColorFormat(Int_t /*ctxInd*/) override{return kFALSE;}
0085 
0086    struct TGLContext_t;
0087 
0088 private:
0089    Bool_t CreateGLPixmap(TGLContext_t &);
0090 
0091    //implicit copy-ctor/assignment generation
0092    // was already disabled by base class, but to be explicit ...
0093    TX11GLManager(const TX11GLManager &);
0094    TX11GLManager &operator = (const TX11GLManager &);
0095 
0096    ClassDefOverride(TX11GLManager, 0) //X11-specific version of TGLManager
0097 };
0098 
0099 
0100 
0101 #endif