Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TX11GL.cxx
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Timur Pocheptsov (TX11GLManager) / Valeriy Onuchin (TX11GL)
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#include <deque>
13#include <map>
14#include <cstdlib>
15#include <cstring>
16
17#include "TVirtualViewer3D.h"
18#include "TVirtualX.h"
19#include "TGLViewer.h"
20#include "TGLManip.h"
21#include "TX11GL.h"
22#include "TError.h"
23#include "TROOT.h"
24
25/** \class TX11GLManager
26\ingroup opengl
27The TX11GLManager is X11 implementation of TGLManager.
28*/
29
31 //these are numbers returned by gVirtualX->AddWindow and gVirtualX->AddPixmap
33 fH(0), fX(0), fY(0), fGLXContext(nullptr), fDirect(kFALSE),
34 fXImage(nullptr), fNextFreeContext(nullptr), fDirectGC(nullptr), fPixmapGC(nullptr)
35 {
36 }//FIXME
39 //X11 pixmap
40 Pixmap fX11Pixmap;
41 //
44 //
47 //
48 GLXContext fGLXContext;
50 //GL buffer is read into XImage
52 std::vector<UChar_t> fBUBuffer;//gl buffer is read from bottom to top.
53 //
57};
58
59namespace {
60
61 typedef std::deque<TX11GLManager::TGLContext_t> DeviceTable_t;
62 typedef DeviceTable_t::size_type SizeType_t;
63 typedef std::map<Int_t, XVisualInfo *> WinTable_t;
64 XSetWindowAttributes dummyAttr;
65
66 //RAII class for Pixmap
67 class TX11PixGuard {
68 private:
69 Display *fDpy;
70 Pixmap fPix;
71
72 public:
73 TX11PixGuard(Display *dpy, Pixmap pix) : fDpy(dpy), fPix(pix) {}
74 ~TX11PixGuard(){if (fPix) XFreePixmap(fDpy, fPix);}
75 void Stop(){fPix = 0;}
76
77 private:
78 TX11PixGuard(const TX11PixGuard &) = delete;
79 TX11PixGuard &operator = (const TX11PixGuard &) = delete;
80 };
81
82 //RAII class for GLXContext
83 class TGLXCtxGuard {
84 private:
85 Display *fDpy;
86 GLXContext fCtx;
87
88 public:
89 TGLXCtxGuard(Display *dpy, GLXContext ctx) : fDpy(dpy), fCtx(ctx) {}
90 ~TGLXCtxGuard(){if (fCtx) glXDestroyContext(fDpy, fCtx);}
91 void Stop(){fCtx = nullptr;}
92
93 private:
94 TGLXCtxGuard(const TGLXCtxGuard &) = delete;
95 TGLXCtxGuard &operator = (const TGLXCtxGuard &) = delete;
96 };
97
98 // RAII class for XImage.
99 class TXImageGuard {
100 private:
101 XImage *fImage;
102
103 TXImageGuard(const TXImageGuard &) = delete;
104 TXImageGuard &operator = (const TXImageGuard &) = delete;
105
106 public:
107 explicit TXImageGuard(XImage *im) : fImage(im) {}
108 ~TXImageGuard(){if (fImage) XDestroyImage(fImage);}
109 void Stop(){fImage = nullptr;}
110 };
111
112}
113
114// Attriblist for glXChooseVisual (double-buffered visual).
115const Int_t dblBuff[] =
116 {
117 GLX_DOUBLEBUFFER,
118 GLX_RGBA,
119 GLX_DEPTH_SIZE, 16,
120 GLX_STENCIL_SIZE, 8,
121 GLX_RED_SIZE, 1,
122 GLX_GREEN_SIZE, 1,
123 GLX_BLUE_SIZE, 1,
124 None
125 };
126
127// Attriblist for glxChooseVisual (single-buffered visual).
128const Int_t *snglBuff = dblBuff + 1;
129
131public:
132 TX11GLImpl();
133 ~TX11GLImpl();
134
135 WinTable_t fGLWindows;
136 DeviceTable_t fGLContexts;
137 Display *fDpy;
139
140private:
141 TX11GLImpl(const TX11GLImpl &) = delete;
143};
144
146
147////////////////////////////////////////////////////////////////////////////////
148/// Constructor.
149
150TX11GLManager::TX11GLImpl::TX11GLImpl() : fDpy(nullptr), fNextFreeContext(nullptr)
151{
152 fDpy = reinterpret_cast<Display *>(gVirtualX->GetDisplay());
153}
154
155
156////////////////////////////////////////////////////////////////////////////////
157/// Destructor.
158/// Destroys only GL contexts and XImages pixmaps and windows must be
159/// closed through gVirtualX
160
162{
163 for (SizeType_t i = 0, e = fGLContexts.size(); i < e; ++i) {
164 TGLContext_t &ctx = fGLContexts[i];
165
166 if (ctx.fGLXContext) {
167 ::Warning("TX11GLManager::~TX11GLManager", "opengl device with index %ld was not destroyed", (Long_t)i);
168 glXDestroyContext(fDpy, ctx.fGLXContext);
169
170 if (ctx.fPixmapIndex != -1) {
171 gVirtualX->SelectWindow(ctx.fPixmapIndex);
172 gVirtualX->ClosePixmap();
173 if (ctx.fXImage)
174 XDestroyImage(ctx.fXImage);
175 }
176 }
177 }
178}
179
180
181////////////////////////////////////////////////////////////////////////////////
182/// Constructor.
183
185{
186 gGLManager = this;
187 gROOT->GetListOfSpecials()->Add(this);
188}
189
190
191////////////////////////////////////////////////////////////////////////////////
192/// Destructor.
193
195{
196 delete fPimpl;
197}
198
199
200////////////////////////////////////////////////////////////////////////////////
201/// Try to find correct visual.
202
204{
205 XVisualInfo *visInfo = glXChooseVisual(
206 fPimpl->fDpy, DefaultScreen(fPimpl->fDpy),
207 const_cast<Int_t *>(dblBuff)
208 );
209
210 if (!visInfo) {
211 Error("InitGLWindow", "No good visual found!\n");
212 return -1;
213 }
214
215 Int_t x = 0, y = 0;
216 UInt_t w = 0, h = 0, b = 0, d = 0;
217 Window root = 0;
218 XGetGeometry(fPimpl->fDpy, winID, &root, &x, &y, &w, &h, &b, &d);
219
220 XSetWindowAttributes attr(dummyAttr);
221 attr.colormap = XCreateColormap(fPimpl->fDpy, root, visInfo->visual, AllocNone); // ???
222 attr.event_mask = NoEventMask;
223 attr.backing_store = Always;
224 attr.bit_gravity = NorthWestGravity;
225
226 ULong_t mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWBackingStore | CWBitGravity;
227
228 // Create window with specific visual.
229 Window glWin = XCreateWindow(
230 fPimpl->fDpy, winID,
231 x, y, w, h,
232 0, visInfo->depth, InputOutput,
233 visInfo->visual, mask, &attr
234 );
235
236 // Check results.
237 XMapWindow(fPimpl->fDpy, glWin);
238
239 // Register window for gVirtualX.
240 Int_t x11Ind = gVirtualX->AddWindow(glWin, w, h);
241
242 // Register this window for GL manager.
243 fPimpl->fGLWindows[x11Ind] = visInfo;
244
245 return x11Ind;
246}
247
248
249////////////////////////////////////////////////////////////////////////////////
250/// Context creation requires Display * and XVisualInfo
251/// (was saved for such winInd).
252
254{
255 GLXContext glxCtx = glXCreateContext(fPimpl->fDpy, fPimpl->fGLWindows[winInd], None, True);
256
257 if (!glxCtx) {
258 Error("CreateContext", "glXCreateContext failed\n");
259 return -1;
260 }
261
262 // Register new context now.
264 Int_t ind = ctx->fWindowIndex;
265 ctx->fWindowIndex = winInd;
266 ctx->fGLXContext = glxCtx;
268 return ind;
269 } else {
270 TGLXCtxGuard glxCtxGuard(fPimpl->fDpy, glxCtx);
271 TGLContext_t newDev;
272 newDev.fWindowIndex = winInd;
273 newDev.fGLXContext = glxCtx;
274
275 fPimpl->fGLContexts.push_back(newDev);
276 glxCtxGuard.Stop();
277
278 return Int_t(fPimpl->fGLContexts.size()) - 1;
279 }
280}
281
282
283////////////////////////////////////////////////////////////////////////////////
284/// Make GL context current.
285
287{
288 TGLContext_t &ctx = fPimpl->fGLContexts[ctxInd];
289 return glXMakeCurrent(fPimpl->fDpy, gVirtualX->GetWindowID(ctx.fWindowIndex), ctx.fGLXContext);
290}
291
292
293////////////////////////////////////////////////////////////////////////////////
294/// Swaps buffers or copy pixmap.
295
297{
298 TGLContext_t &ctx = fPimpl->fGLContexts[ctxInd];
299 Window winID = gVirtualX->GetWindowID(ctx.fWindowIndex);
300
301 if (ctx.fPixmapIndex == -1)
302 glXSwapBuffers(fPimpl->fDpy, winID);
303 else if (ctx.fXImage && ctx.fDirect) {
304 if (!ctx.fDirectGC)
305 ctx.fDirectGC = XCreateGC(fPimpl->fDpy, winID, 0, nullptr);
306
307 if (!ctx.fDirectGC) {
308 Error("Flush", "XCreateGC failed while copying pixmap\n");
309 ctx.fDirect = kFALSE;
310 return;
311 }
312
313 XCopyArea(fPimpl->fDpy, ctx.fX11Pixmap, winID, ctx.fDirectGC, 0, 0, ctx.fW, ctx.fH, ctx.fX, ctx.fY);
314 }
315}
316
317
318////////////////////////////////////////////////////////////////////////////////
319/// Create GL pixmap.
320
322{
323 // Create new x11 pixmap and XImage.
324 Pixmap x11Pix = XCreatePixmap(fPimpl->fDpy, gVirtualX->GetWindowID(ctx.fWindowIndex), ctx.fW,
325 ctx.fH, fPimpl->fGLWindows[ctx.fWindowIndex]->depth);
326
327 if (!x11Pix) {
328 Error("CreateGLPixmap", "XCreatePixmap failed\n");
329 return kFALSE;
330 }
331
332 TX11PixGuard pixGuard(fPimpl->fDpy, x11Pix);
333
334 // XImage part here.
335 XVisualInfo *visInfo = fPimpl->fGLWindows[ctx.fWindowIndex];
336 XImage *testIm = XCreateImage(fPimpl->fDpy, visInfo->visual, visInfo->depth, ZPixmap,
337 0, nullptr, ctx.fW, ctx.fH,
338 visInfo->depth <= 8 ? 8 : (visInfo->depth <= 16 ? 16 : 32), 0);
339
340 if (testIm) {
341 TXImageGuard imGuard(testIm);
342 testIm->data = static_cast<Char_t *>(malloc(testIm->bytes_per_line * testIm->height));
343
344 if (!testIm->data) {
345 Error("CreateGLPixmap", "Cannot malloc XImage data\n");
346 return kFALSE;
347 }
348
349 if (XInitImage(testIm)) {
350 ctx.fPixmapIndex = gVirtualX->AddPixmap(x11Pix, ctx.fW, ctx.fH);
351 ctx.fBUBuffer.resize(testIm->bytes_per_line * testIm->height);
352 ctx.fX11Pixmap = x11Pix;
353 ctx.fXImage = testIm;
354 pixGuard.Stop();
355 imGuard.Stop();
356 return kTRUE;
357 } else
358 Error("CreateGLPixmap", "XInitImage error!\n");
359 } else
360 Error("CreateGLPixmap", "XCreateImage error!\n");
361
362 return kFALSE;
363}
364
365
366////////////////////////////////////////////////////////////////////////////////
367/// Attach off screen device.
368
370{
371 // Create pixmap and XImage for GL context ctxInd.
372 TGLContext_t &ctx = fPimpl->fGLContexts[ctxInd];
373 TGLContext_t newCtx;
374 newCtx.fWindowIndex = ctx.fWindowIndex;
375 newCtx.fW = w, newCtx.fH = h, newCtx.fX = x, newCtx.fY = y;
376 newCtx.fGLXContext = ctx.fGLXContext;
377
378 if (CreateGLPixmap(newCtx)) {
379 ctx.fPixmapIndex = newCtx.fPixmapIndex;
380 ctx.fX11Pixmap = newCtx.fX11Pixmap;
381 ctx.fW = w, ctx.fH = h, ctx.fX = x, ctx.fY = y;
382 ctx.fDirect = kFALSE;
383 ctx.fXImage = newCtx.fXImage;
384 ctx.fBUBuffer.swap(newCtx.fBUBuffer);
385 return kTRUE;
386 }
387
388 return kFALSE;
389}
390
391
392////////////////////////////////////////////////////////////////////////////////
393/// Resize off screen device.
394
396{
397 // Create a new pixmap and a new XImage if needed.
398 TGLContext_t &ctx = fPimpl->fGLContexts[ctxInd];
399
400 if (ctx.fPixmapIndex != -1) {
401 if (TMath::Abs(Int_t(w) - Int_t(ctx.fW)) > 1 || TMath::Abs(Int_t(h) - Int_t(ctx.fH)) > 1) {
402 TGLContext_t newCtx;
403 newCtx.fWindowIndex = ctx.fWindowIndex;
404 newCtx.fW = w, newCtx.fH = h, newCtx.fX = x, newCtx.fY = y;
405 newCtx.fGLXContext = ctx.fGLXContext;
406
407 if (CreateGLPixmap(newCtx)) {
408 gVirtualX->SelectWindow(ctx.fPixmapIndex);
409 gVirtualX->ClosePixmap();
410 ctx.fPixmapIndex = newCtx.fPixmapIndex;
411 ctx.fX11Pixmap = newCtx.fX11Pixmap;
412 ctx.fW = w, ctx.fH = h, ctx.fX = x, ctx.fY = y;
413 ctx.fDirect = kFALSE;
414 if (ctx.fXImage) XDestroyImage(ctx.fXImage);
415 ctx.fXImage = newCtx.fXImage;
416 ctx.fBUBuffer.swap(newCtx.fBUBuffer);
417 return kTRUE;
418 } else
419 Error("ResizeOffScreenDevice", "Resize failed\n");
420 } else {
421 ctx.fX = x;
422 ctx.fY = y;
423 }
424 }
425
426 return kFALSE;
427}
428
429
430////////////////////////////////////////////////////////////////////////////////
431/// Selects off-screen device to make it accessible by gVirtualX.
432
434{
435 gVirtualX->SelectWindow(fPimpl->fGLContexts[ctxInd].fPixmapIndex);
436}
437
438
439////////////////////////////////////////////////////////////////////////////////
440/// Selection-rotation support for TPad/TCanvas.
441
443{
444 if (fPimpl->fGLContexts[ctxInd].fPixmapIndex != -1)
445 fPimpl->fGLContexts[ctxInd].fDirect = dir;
446}
447
448
449////////////////////////////////////////////////////////////////////////////////
450/// GL buffer is read info buffer, after that lines are reordered
451/// into XImage, XImage copied into pixmap.
452
454{
455 TGLContext_t &ctx = fPimpl->fGLContexts[ctxInd];
456
457 if (ctx.fPixmapIndex != -1 && ctx.fXImage) {
458 // Read GL buffer.
459 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
460 glReadBuffer(GL_BACK);
461 glReadPixels(0, 0, ctx.fW, ctx.fH, GL_BGRA, GL_UNSIGNED_BYTE, &ctx.fBUBuffer[0]);
462
463 if (!ctx.fPixmapGC)
464 ctx.fPixmapGC = XCreateGC(fPimpl->fDpy, ctx.fX11Pixmap, 0, nullptr);
465 if (ctx.fPixmapGC) {
466 // GL buffer read operation gives bottom-up order of pixels, but XImage
467 // require top-down. So, change RGB lines first.
468 char *dest = ctx.fXImage->data;
469 const UChar_t *src = &ctx.fBUBuffer[ctx.fW * 4 * (ctx.fH - 1)];
470 for (UInt_t i = 0, e = ctx.fH; i < e; ++i) {
471 memcpy(dest, src, ctx.fW * 4);
472 dest += ctx.fW * 4;
473 src -= ctx.fW * 4;
474 }
475 XPutImage(fPimpl->fDpy, ctx.fX11Pixmap, ctx.fPixmapGC, ctx.fXImage, 0, 0, 0, 0, ctx.fW, ctx.fH);
476 } else
477 Error("ReadGLBuffer", "XCreateGC error while attempt to copy XImage\n");
478 }
479}
480
481
482////////////////////////////////////////////////////////////////////////////////
483/// Deletes GLX context and frees pixmap and image (if any).
484
486{
487 TGLContext_t &ctx = fPimpl->fGLContexts[ctxInd];
488
489 // Free GL context.
490 glXDestroyContext(fPimpl->fDpy, ctx.fGLXContext);
491 ctx.fGLXContext = nullptr;
492
493 // If the pixmap exists it is destroyed.
494 if (ctx.fPixmapIndex != -1) {
495 gVirtualX->SelectWindow(ctx.fPixmapIndex);
496 gVirtualX->ClosePixmap();
497 ctx.fPixmapIndex = -1;
498 if(ctx.fXImage) {
499 XDestroyImage(ctx.fXImage);
500 ctx.fXImage = nullptr;
501 }
502 if (ctx.fDirectGC)
503 XFreeGC(fPimpl->fDpy, ctx.fDirectGC), ctx.fDirectGC = nullptr;
504 if (ctx.fPixmapGC)
505 XFreeGC(fPimpl->fDpy, ctx.fPixmapGC), ctx.fPixmapGC = nullptr;
506 }
507
509 fPimpl->fNextFreeContext = &ctx;
510 ctx.fWindowIndex = ctxInd;
511}
512
513
514////////////////////////////////////////////////////////////////////////////////
515/// Returns an index suitable for gVirtualX.
516
518{
519 return fPimpl->fGLContexts[ctxInd].fPixmapIndex;
520}
521
522
523////////////////////////////////////////////////////////////////////////////////
524/// Returns the current dimensions of a GL pixmap.
525
527{
528 TGLContext_t &ctx = fPimpl->fGLContexts[ctxInd];
529
530 if (ctx.fPixmapIndex != -1) {
531 viewport[0] = 0;
532 viewport[1] = 0;
533 viewport[2] = ctx.fW;
534 viewport[3] = ctx.fH;
535 }
536}
537
538
539////////////////////////////////////////////////////////////////////////////////
540/// Paint a single object.
541
543{
544 p->Paint();
545}
546
547
548////////////////////////////////////////////////////////////////////////////////
549/// Print viewer.
550
552{
553 vv->PrintObjects();
554}
555
556////////////////////////////////////////////////////////////////////////////////
557/// Select manipulator.
558
559Bool_t TX11GLManager::SelectManip(TVirtualGLManip *manip, const TGLCamera * camera, const TGLRect * rect, const TGLBoundingBox * sceneBox)
560{
561 return manip->Select(*camera, *rect, *sceneBox);
562}
563
564
565////////////////////////////////////////////////////////////////////////////////
566/// Pan objects.
567
569{
570 return o->Pan(x, y);
571}
572
573////////////////////////////////////////////////////////////////////////////////
574///Analog of TObject::DistancetoPrimitive
575
577{
578 return plot->PlotSelected(px, py);
579}
580
581////////////////////////////////////////////////////////////////////////////////
582///Analog of TObject::GetObjectInfo
583
585{
586 return plot->GetPlotInfo(px, py);
587}
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
#define d(i)
Definition RSha256.hxx:102
#define b(i)
Definition RSha256.hxx:100
#define h(i)
Definition RSha256.hxx:106
#define e(i)
Definition RSha256.hxx:103
int Int_t
Definition RtypesCore.h:45
unsigned char UChar_t
Definition RtypesCore.h:38
char Char_t
Definition RtypesCore.h:37
unsigned long ULong_t
Definition RtypesCore.h:55
long Long_t
Definition RtypesCore.h:54
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassImp(name)
Definition Rtypes.h:377
#define GL_BGRA
Definition TGLViewer.cxx:61
winID winInd
winID h TVirtualViewer3D TVirtualGLPainter p
winID h TVirtualViewer3D vv
winID h TVirtualViewer3D TVirtualGLPainter char TVirtualGLPainter plot
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t rect
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
XID Window
Definition TGX11.h:36
Binding & operator=(OUT(*fun)(void))
#define gROOT
Definition TROOT.h:406
#define gGLManager
Definition TVirtualGL.h:159
#define gVirtualX
Definition TVirtualX.h:337
const Int_t dblBuff[]
Definition TX11GL.cxx:115
const Int_t * snglBuff
Definition TX11GL.cxx:128
#define malloc
Definition civetweb.c:1536
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
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:962
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:976
virtual void Paint(Option_t *option="")
This method must be overridden if a class wants to paint itself.
Definition TObject.cxx:607
virtual Bool_t Select(const TGLCamera &camera, const TGLRect &rect, const TGLBoundingBox &sceneBox)=0
virtual void Pan(Int_t px, Int_t py)=0
Abstract 3D shapes viewer.
virtual void PrintObjects()
DeviceTable_t fGLContexts
Definition TX11GL.cxx:136
TX11GLImpl(const TX11GLImpl &)=delete
TX11GLImpl()
Constructor.
Definition TX11GL.cxx:150
~TX11GLImpl()
Destructor.
Definition TX11GL.cxx:161
TGLContext_t * fNextFreeContext
Definition TX11GL.cxx:138
TX11GLImpl & operator=(const TX11GLImpl &)=delete
The TX11GLManager is X11 implementation of TGLManager.
Definition TX11GL.h:34
void PanObject(TVirtualGLPainter *o, Int_t x, Int_t y) override
Pan objects.
Definition TX11GL.cxx:568
Int_t InitGLWindow(Window_t winID) override
Try to find correct visual.
Definition TX11GL.cxx:203
~TX11GLManager() override
Destructor.
Definition TX11GL.cxx:194
char * GetPlotInfo(TVirtualGLPainter *plot, Int_t px, Int_t py) override
Analog of TObject::GetObjectInfo.
Definition TX11GL.cxx:584
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:453
void SelectOffScreenDevice(Int_t devInd) override
Selects off-screen device to make it accessible by gVirtualX.
Definition TX11GL.cxx:433
void Flush(Int_t ctxInd) override
Swaps buffers or copy pixmap.
Definition TX11GL.cxx:296
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:369
void DeleteGLContext(Int_t devInd) override
Deletes GLX context and frees pixmap and image (if any).
Definition TX11GL.cxx:485
void MarkForDirectCopy(Int_t devInd, Bool_t) override
Selection-rotation support for TPad/TCanvas.
Definition TX11GL.cxx:442
Bool_t MakeCurrent(Int_t devInd) override
Make GL context current.
Definition TX11GL.cxx:286
Int_t GetVirtualXInd(Int_t devInd) override
Returns an index suitable for gVirtualX.
Definition TX11GL.cxx:517
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:395
Int_t CreateGLContext(Int_t winInd) override
Context creation requires Display * and XVisualInfo (was saved for such winInd).
Definition TX11GL.cxx:253
Bool_t CreateGLPixmap(TGLContext_t &)
Create GL pixmap.
Definition TX11GL.cxx:321
void PrintViewer(TVirtualViewer3D *vv) override
Print viewer.
Definition TX11GL.cxx:551
void PaintSingleObject(TVirtualGLPainter *) override
Paint a single object.
Definition TX11GL.cxx:542
Bool_t PlotSelected(TVirtualGLPainter *plot, Int_t px, Int_t py) override
Analog of TObject::DistancetoPrimitive.
Definition TX11GL.cxx:576
TX11GLManager()
Constructor.
Definition TX11GL.cxx:184
Bool_t SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox) override
Select manipulator.
Definition TX11GL.cxx:559
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:526
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:123
TGLContext_t * fNextFreeContext
Definition TX11GL.cxx:54
std::vector< UChar_t > fBUBuffer
Definition TX11GL.cxx:52