Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TX11GL.h
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Timur Pocheptsov 09/08/2004
3
4/*************************************************************************
5 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TX11GL
13#define ROOT_TX11GL
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TX11GL //
19// //
20// The TX11GL is X11 implementation of TVirtualGLImp class. //
21// //
22//////////////////////////////////////////////////////////////////////////
23
24#include "TVirtualGL.h"
25
26#if !defined(__CLING__)
27#include <GL/glx.h>
28#else
29typedef struct _XDisplay Display;
30struct XVisualInfo;
31#endif
32
33
34class TX11GLManager : public TGLManager {
35private:
36 class TX11GLImpl;
38
39public:
41 ~TX11GLManager() override;
42
43 //All public functions are TGLManager's final-overriders
44
45 //index returned can be used as a result of gVirtualX->InitWindow
46 Int_t InitGLWindow(Window_t winID) override;
47 //winInd is the index, returned by InitGLWindow
48 Int_t CreateGLContext(Int_t winInd) override;
49
50 //[ Off-screen rendering part
51 //create pixmap to read GL buffer into it,
52 //ctxInd is the index, returned by CreateGLContext
55 //analog of gVirtualX->SelectWindow(fPixmapID) => gVirtualGL->SelectOffScreenDevice(fPixmapID)
56 void SelectOffScreenDevice(Int_t devInd) override;
57 //Index of pixmap, valid for gVirtualX
58 Int_t GetVirtualXInd(Int_t devInd) override;
59 //copy pixmap into window directly/by pad
60 void MarkForDirectCopy(Int_t devInd, Bool_t) override;
61 //Off-screen device holds sizes for glViewport
62 void ExtractViewport(Int_t devInd, Int_t *vp) override;
63 //Read GL buffer into pixmap
64 void ReadGLBuffer(Int_t devInd) override;
65 //]
66
67 //Make the gl context current
68 Bool_t MakeCurrent(Int_t devInd) override;
69 //Sswap buffers or copies pixmap (XCopyArea)
70 void Flush(Int_t ctxInd) override;
71 //Generic function for gl context and off-screen device deletion
72 void DeleteGLContext(Int_t devInd) override;
73
74 //used by viewer
75 Bool_t SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox) override;
76 //
77 Bool_t PlotSelected(TVirtualGLPainter *plot, Int_t px, Int_t py) override;
78 char *GetPlotInfo(TVirtualGLPainter *plot, Int_t px, Int_t py) override;
79 //
80 void PaintSingleObject(TVirtualGLPainter *) override;
81 void PanObject(TVirtualGLPainter *o, Int_t x, Int_t y) override;
82 void PrintViewer(TVirtualViewer3D *vv) override;
83
84 Bool_t HighColorFormat(Int_t /*ctxInd*/) override{return kFALSE;}
85
86 struct TGLContext_t;
87
88private:
89 Bool_t CreateGLPixmap(TGLContext_t &);
90
91 //implicit copy-ctor/assignment generation
92 // was already disabled by base class, but to be explicit ...
95
96 ClassDefOverride(TX11GLManager, 0) //X11-specific version of TGLManager
97};
98
99
100
101#endif
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
#define h(i)
Definition RSha256.hxx:106
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
Definition RtypesCore.h:60
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
Definition TGLCamera.h:44
Viewport (pixel base) 2D rectangle class.
Definition TGLUtil.h:422
Abstract 3D shapes viewer.
void PanObject(TVirtualGLPainter *o, Int_t x, Int_t y) override
Pan objects.
Definition TX11GL.cxx:567
TX11GLManager & operator=(const TX11GLManager &)
Int_t InitGLWindow(Window_t winID) override
Try to find correct visual.
Definition TX11GL.cxx:202
~TX11GLManager() override
Destructor.
Definition TX11GL.cxx:193
char * GetPlotInfo(TVirtualGLPainter *plot, Int_t px, Int_t py) override
Analog of TObject::GetObjectInfo.
Definition TX11GL.cxx:583
void ReadGLBuffer(Int_t devInd) override
GL buffer is read info buffer, after that lines are reordered into XImage, XImage copied into pixmap.
Definition TX11GL.cxx:452
void SelectOffScreenDevice(Int_t devInd) override
Selects off-screen device to make it accessible by gVirtualX.
Definition TX11GL.cxx:432
void Flush(Int_t ctxInd) override
Swaps buffers or copy pixmap.
Definition TX11GL.cxx:295
Bool_t HighColorFormat(Int_t) override
Definition TX11GL.h:84
Bool_t AttachOffScreenDevice(Int_t ctxInd, Int_t x, Int_t y, UInt_t w, UInt_t h) override
Attach off screen device.
Definition TX11GL.cxx:368
void DeleteGLContext(Int_t devInd) override
Deletes GLX context and frees pixmap and image (if any).
Definition TX11GL.cxx:484
void MarkForDirectCopy(Int_t devInd, Bool_t) override
Selection-rotation support for TPad/TCanvas.
Definition TX11GL.cxx:441
Bool_t MakeCurrent(Int_t devInd) override
Make GL context current.
Definition TX11GL.cxx:285
Int_t GetVirtualXInd(Int_t devInd) override
Returns an index suitable for gVirtualX.
Definition TX11GL.cxx:516
Bool_t ResizeOffScreenDevice(Int_t devInd, Int_t x, Int_t y, UInt_t w, UInt_t h) override
Resize off screen device.
Definition TX11GL.cxx:394
Int_t CreateGLContext(Int_t winInd) override
Context creation requires Display * and XVisualInfo (was saved for such winInd).
Definition TX11GL.cxx:252
Bool_t CreateGLPixmap(TGLContext_t &)
Create GL pixmap.
Definition TX11GL.cxx:320
void PrintViewer(TVirtualViewer3D *vv) override
Print viewer.
Definition TX11GL.cxx:550
void PaintSingleObject(TVirtualGLPainter *) override
Paint a single object.
Definition TX11GL.cxx:541
Bool_t PlotSelected(TVirtualGLPainter *plot, Int_t px, Int_t py) override
Analog of TObject::DistancetoPrimitive.
Definition TX11GL.cxx:575
TX11GLManager()
Constructor.
Definition TX11GL.cxx:183
Bool_t SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox) override
Select manipulator.
Definition TX11GL.cxx:558
TX11GLManager(const TX11GLManager &)
TX11GLImpl * fPimpl
Definition TX11GL.h:37
void ExtractViewport(Int_t devInd, Int_t *vp) override
Returns the current dimensions of a GL pixmap.
Definition TX11GL.cxx:525
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17