Logo ROOT   6.18/05
Reference Guide
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 <stdlib.h>
15#include <string.h>
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
30struct TX11GLManager::TGLContext_t {
31 //these are numbers returned by gVirtualX->AddWindow and gVirtualX->AddPixmap
32 TGLContext_t() : fWindowIndex(-1), fPixmapIndex(-1), fX11Pixmap(0), fW(0),
33 fH(0), fX(0), fY(0), fGLXContext(0), fDirect(kFALSE),
34 fXImage(0), fNextFreeContext(0), fDirectGC(0), fPixmapGC(0)
35 {
36 }//FIXME
37 Int_t fWindowIndex;
38 Int_t fPixmapIndex;
39 //X11 pixmap
40 Pixmap fX11Pixmap;
41 //
42 UInt_t fW;
43 UInt_t fH;
44 //
45 Int_t fX;
46 Int_t fY;
47 //
48 GLXContext fGLXContext;
49 Bool_t fDirect;
50 //GL buffer is read into XImage
51 XImage *fXImage;
52 std::vector<UChar_t> fBUBuffer;//gl buffer is read from bottom to top.
53 //
54 TGLContext_t *fNextFreeContext;
55 GC fDirectGC;
56 GC fPixmapGC;
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 &);
79 TX11PixGuard &operator = (const TX11PixGuard &);
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 = 0;}
92
93 private:
94 TGLXCtxGuard(const TGLXCtxGuard &);
95 TGLXCtxGuard &operator = (const TGLXCtxGuard &);
96 };
97
98 // RAII class for XImage.
99 class TXImageGuard {
100 private:
101 XImage *fImage;
102
103 TXImageGuard(const TXImageGuard &);
104 TXImageGuard &operator = (const TXImageGuard &);
105
106 public:
107 explicit TXImageGuard(XImage *im) : fImage(im) {}
108 ~TXImageGuard(){if (fImage) XDestroyImage(fImage);}
109 void Stop(){fImage = 0;}
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
130class TX11GLManager::TX11GLImpl {
131public:
132 TX11GLImpl();
133 ~TX11GLImpl();
134
135 WinTable_t fGLWindows;
136 DeviceTable_t fGLContexts;
137 Display *fDpy;
138 TGLContext_t *fNextFreeContext;
139
140private:
141 TX11GLImpl(const TX11GLImpl &);
142 TX11GLImpl &operator = (const TX11GLImpl &);
143};
144
146
147////////////////////////////////////////////////////////////////////////////////
148/// Constructor.
149
150TX11GLManager::TX11GLImpl::TX11GLImpl() : fDpy(0), fNextFreeContext(0)
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
161TX11GLManager::TX11GLImpl::~TX11GLImpl()
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
184TX11GLManager::TX11GLManager() : fPimpl(new TX11GLImpl)
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.
263 if (TGLContext_t *ctx = fPimpl->fNextFreeContext) {
264 Int_t ind = ctx->fWindowIndex;
265 ctx->fWindowIndex = winInd;
266 ctx->fGLXContext = glxCtx;
267 fPimpl->fNextFreeContext = fPimpl->fNextFreeContext->fNextFreeContext;
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, 0);
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, 0, 0, ctx.fW, ctx.fH, 32, 0);
337
338 if (testIm) {
339 TXImageGuard imGuard(testIm);
340 testIm->data = static_cast<Char_t *>(malloc(testIm->bytes_per_line * testIm->height));
341
342 if (!testIm->data) {
343 Error("CreateGLPixmap", "Cannot malloc XImage data\n");
344 return kFALSE;
345 }
346
347 if (XInitImage(testIm)) {
348 ctx.fPixmapIndex = gVirtualX->AddPixmap(x11Pix, ctx.fW, ctx.fH);
349 ctx.fBUBuffer.resize(testIm->bytes_per_line * testIm->height);
350 ctx.fX11Pixmap = x11Pix;
351 ctx.fXImage = testIm;
352 pixGuard.Stop();
353 imGuard.Stop();
354 return kTRUE;
355 } else
356 Error("CreateGLPixmap", "XInitImage error!\n");
357 } else
358 Error("CreateGLPixmap", "XCreateImage error!\n");
359
360 return kFALSE;
361}
362
363
364////////////////////////////////////////////////////////////////////////////////
365/// Attach off screen device.
366
368{
369 // Create pixmap and XImage for GL context ctxInd.
370 TGLContext_t &ctx = fPimpl->fGLContexts[ctxInd];
371 TGLContext_t newCtx;
372 newCtx.fWindowIndex = ctx.fWindowIndex;
373 newCtx.fW = w, newCtx.fH = h, newCtx.fX = x, newCtx.fY = y;
374 newCtx.fGLXContext = ctx.fGLXContext;
375
376 if (CreateGLPixmap(newCtx)) {
377 ctx.fPixmapIndex = newCtx.fPixmapIndex;
378 ctx.fX11Pixmap = newCtx.fX11Pixmap;
379 ctx.fW = w, ctx.fH = h, ctx.fX = x, ctx.fY = y;
380 ctx.fDirect = kFALSE;
381 ctx.fXImage = newCtx.fXImage;
382 ctx.fBUBuffer.swap(newCtx.fBUBuffer);
383 return kTRUE;
384 }
385
386 return kFALSE;
387}
388
389
390////////////////////////////////////////////////////////////////////////////////
391/// Resize off screen device.
392
394{
395 // Create a new pixmap and a new XImage if needed.
396 TGLContext_t &ctx = fPimpl->fGLContexts[ctxInd];
397
398 if (ctx.fPixmapIndex != -1) {
399 if (TMath::Abs(Int_t(w) - Int_t(ctx.fW)) > 1 || TMath::Abs(Int_t(h) - Int_t(ctx.fH)) > 1) {
400 TGLContext_t newCtx;
401 newCtx.fWindowIndex = ctx.fWindowIndex;
402 newCtx.fW = w, newCtx.fH = h, newCtx.fX = x, newCtx.fY = y;
403 newCtx.fGLXContext = ctx.fGLXContext;
404
405 if (CreateGLPixmap(newCtx)) {
406 gVirtualX->SelectWindow(ctx.fPixmapIndex);
407 gVirtualX->ClosePixmap();
408 ctx.fPixmapIndex = newCtx.fPixmapIndex;
409 ctx.fX11Pixmap = newCtx.fX11Pixmap;
410 ctx.fW = w, ctx.fH = h, ctx.fX = x, ctx.fY = y;
411 ctx.fDirect = kFALSE;
412 if (ctx.fXImage) XDestroyImage(ctx.fXImage);
413 ctx.fXImage = newCtx.fXImage;
414 ctx.fBUBuffer.swap(newCtx.fBUBuffer);
415 return kTRUE;
416 } else
417 Error("ResizeOffScreenDevice", "Resize failed\n");
418 } else {
419 ctx.fX = x;
420 ctx.fY = y;
421 }
422 }
423
424 return kFALSE;
425}
426
427
428////////////////////////////////////////////////////////////////////////////////
429/// Selects off-screen device to make it accessible by gVirtualX.
430
432{
433 gVirtualX->SelectWindow(fPimpl->fGLContexts[ctxInd].fPixmapIndex);
434}
435
436
437////////////////////////////////////////////////////////////////////////////////
438/// Selection-rotation support for TPad/TCanvas.
439
441{
442 if (fPimpl->fGLContexts[ctxInd].fPixmapIndex != -1)
443 fPimpl->fGLContexts[ctxInd].fDirect = dir;
444}
445
446
447////////////////////////////////////////////////////////////////////////////////
448/// GL buffer is read info buffer, after that lines are reordered
449/// into XImage, XImage copied into pixmap.
450
452{
453 TGLContext_t &ctx = fPimpl->fGLContexts[ctxInd];
454
455 if (ctx.fPixmapIndex != -1 && ctx.fXImage) {
456 // Read GL buffer.
457 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
458 glReadBuffer(GL_BACK);
459 glReadPixels(0, 0, ctx.fW, ctx.fH, GL_BGRA, GL_UNSIGNED_BYTE, &ctx.fBUBuffer[0]);
460
461 if (!ctx.fPixmapGC)
462 ctx.fPixmapGC = XCreateGC(fPimpl->fDpy, ctx.fX11Pixmap, 0, 0);
463 if (ctx.fPixmapGC) {
464 // GL buffer read operation gives bottom-up order of pixels, but XImage
465 // require top-down. So, change RGB lines first.
466 char *dest = ctx.fXImage->data;
467 const UChar_t *src = &ctx.fBUBuffer[ctx.fW * 4 * (ctx.fH - 1)];
468 for (UInt_t i = 0, e = ctx.fH; i < e; ++i) {
469 memcpy(dest, src, ctx.fW * 4);
470 dest += ctx.fW * 4;
471 src -= ctx.fW * 4;
472 }
473 XPutImage(fPimpl->fDpy, ctx.fX11Pixmap, ctx.fPixmapGC, ctx.fXImage, 0, 0, 0, 0, ctx.fW, ctx.fH);
474 } else
475 Error("ReadGLBuffer", "XCreateGC error while attempt to copy XImage\n");
476 }
477}
478
479
480////////////////////////////////////////////////////////////////////////////////
481/// Deletes GLX context and frees pixmap and image (if any).
482
484{
485 TGLContext_t &ctx = fPimpl->fGLContexts[ctxInd];
486
487 // Free GL context.
488 glXDestroyContext(fPimpl->fDpy, ctx.fGLXContext);
489 ctx.fGLXContext = 0;
490
491 // If the pixmap exists it is destroyed.
492 if (ctx.fPixmapIndex != -1) {
493 gVirtualX->SelectWindow(ctx.fPixmapIndex);
494 gVirtualX->ClosePixmap();
495 ctx.fPixmapIndex = -1;
496 if(ctx.fXImage) {
497 XDestroyImage(ctx.fXImage);
498 ctx.fXImage = 0;
499 }
500 if (ctx.fDirectGC)
501 XFreeGC(fPimpl->fDpy, ctx.fDirectGC), ctx.fDirectGC = 0;
502 if (ctx.fPixmapGC)
503 XFreeGC(fPimpl->fDpy, ctx.fPixmapGC), ctx.fPixmapGC = 0;
504 }
505
506 ctx.fNextFreeContext = fPimpl->fNextFreeContext;
507 fPimpl->fNextFreeContext = &ctx;
508 ctx.fWindowIndex = ctxInd;
509}
510
511
512////////////////////////////////////////////////////////////////////////////////
513/// Returns an index suitable for gVirtualX.
514
516{
517 return fPimpl->fGLContexts[ctxInd].fPixmapIndex;
518}
519
520
521////////////////////////////////////////////////////////////////////////////////
522/// Returns the current dimensions of a GL pixmap.
523
525{
526 TGLContext_t &ctx = fPimpl->fGLContexts[ctxInd];
527
528 if (ctx.fPixmapIndex != -1) {
529 viewport[0] = 0;
530 viewport[1] = 0;
531 viewport[2] = ctx.fW;
532 viewport[3] = ctx.fH;
533 }
534}
535
536
537////////////////////////////////////////////////////////////////////////////////
538/// Paint a single object.
539
541{
542 p->Paint();
543}
544
545
546////////////////////////////////////////////////////////////////////////////////
547/// Print viewer.
548
550{
551 vv->PrintObjects();
552}
553
554////////////////////////////////////////////////////////////////////////////////
555/// Select manipulator.
556
557Bool_t TX11GLManager::SelectManip(TVirtualGLManip *manip, const TGLCamera * camera, const TGLRect * rect, const TGLBoundingBox * sceneBox)
558{
559 return manip->Select(*camera, *rect, *sceneBox);
560}
561
562
563////////////////////////////////////////////////////////////////////////////////
564/// Pan objects.
565
567{
568 return o->Pan(x, y);
569}
570
571////////////////////////////////////////////////////////////////////////////////
572///Analog of TObject::DistancetoPrimitive
573
575{
576 return plot->PlotSelected(px, py);
577}
578
579////////////////////////////////////////////////////////////////////////////////
580///Analog of TObject::GetObjectInfo
581
583{
584 return plot->GetPlotInfo(px, py);
585}
Handle_t Window_t
Definition: GuiTypes.h:28
#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:41
unsigned char UChar_t
Definition: RtypesCore.h:34
char Char_t
Definition: RtypesCore.h:29
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
unsigned long ULong_t
Definition: RtypesCore.h:51
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassImp(name)
Definition: Rtypes.h:365
void Warning(const char *location, const char *msgfmt,...)
#define GL_BGRA
Definition: TGLViewer.cxx:64
XID Window
Definition: TGX11.h:39
Binding & operator=(OUT(*fun)(void))
#define gROOT
Definition: TROOT.h:414
#define gGLManager
Definition: TVirtualGL.h:162
#define gVirtualX
Definition: TVirtualX.h:345
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:421
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
virtual Bool_t Select(const TGLCamera &camera, const TGLRect &rect, const TGLBoundingBox &sceneBox)=0
virtual Bool_t PlotSelected(Int_t px, Int_t py)=0
virtual char * GetPlotInfo(Int_t px, Int_t py)=0
virtual void Pan(Int_t px, Int_t py)=0
virtual void Paint()=0
Abstract 3D shapes viewer.
virtual void PrintObjects()
The TX11GLManager is X11 implementation of TGLManager.
Definition: TX11GL.h:34
Int_t CreateGLContext(Int_t winInd)
Context creation requires Display * and XVisualInfo (was saved for such winInd).
Definition: TX11GL.cxx:253
~TX11GLManager()
Destructor.
Definition: TX11GL.cxx:194
void PaintSingleObject(TVirtualGLPainter *)
Paint a single object.
Definition: TX11GL.cxx:540
TX11GLManager & operator=(const TX11GLManager &)
Int_t GetVirtualXInd(Int_t devInd)
Returns an index suitable for gVirtualX.
Definition: TX11GL.cxx:515
void DeleteGLContext(Int_t devInd)
Deletes GLX context and frees pixmap and image (if any).
Definition: TX11GL.cxx:483
void MarkForDirectCopy(Int_t devInd, Bool_t)
Selection-rotation support for TPad/TCanvas.
Definition: TX11GL.cxx:440
Bool_t MakeCurrent(Int_t devInd)
Make GL context current.
Definition: TX11GL.cxx:286
void SelectOffScreenDevice(Int_t devInd)
Selects off-screen device to make it accessible by gVirtualX.
Definition: TX11GL.cxx:431
Bool_t ResizeOffScreenDevice(Int_t devInd, Int_t x, Int_t y, UInt_t w, UInt_t h)
Resize off screen device.
Definition: TX11GL.cxx:393
void PanObject(TVirtualGLPainter *o, Int_t x, Int_t y)
Pan objects.
Definition: TX11GL.cxx:566
Bool_t SelectManip(TVirtualGLManip *manip, const TGLCamera *camera, const TGLRect *rect, const TGLBoundingBox *sceneBox)
Select manipulator.
Definition: TX11GL.cxx:557
void PrintViewer(TVirtualViewer3D *vv)
Print viewer.
Definition: TX11GL.cxx:549
void Flush(Int_t ctxInd)
Swaps buffers or copy pixmap.
Definition: TX11GL.cxx:296
char * GetPlotInfo(TVirtualGLPainter *plot, Int_t px, Int_t py)
Analog of TObject::GetObjectInfo.
Definition: TX11GL.cxx:582
Bool_t PlotSelected(TVirtualGLPainter *plot, Int_t px, Int_t py)
Analog of TObject::DistancetoPrimitive.
Definition: TX11GL.cxx:574
Bool_t CreateGLPixmap(TGLContext_t &)
Create GL pixmap.
Definition: TX11GL.cxx:321
void ReadGLBuffer(Int_t devInd)
GL buffer is read info buffer, after that lines are reordered into XImage, XImage copied into pixmap.
Definition: TX11GL.cxx:451
TX11GLManager()
Constructor.
Definition: TX11GL.cxx:184
TX11GLImpl * fPimpl
Definition: TX11GL.h:36
void ExtractViewport(Int_t devInd, Int_t *vp)
Returns the current dimensions of a GL pixmap.
Definition: TX11GL.cxx:524
Bool_t AttachOffScreenDevice(Int_t ctxInd, Int_t x, Int_t y, UInt_t w, UInt_t h)
Attach off screen device.
Definition: TX11GL.cxx:367
Int_t InitGLWindow(Window_t winID)
Try to find correct visual.
Definition: TX11GL.cxx:203
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
Short_t Abs(Short_t d)
Definition: TMathBase.h:120
const char * True
#define dest(otri, vertexptr)
Definition: triangle.c:1040