Logo ROOT   6.08/07
Reference Guide
ROOTOpenGLView.h
Go to the documentation of this file.
1 // @(#)root/graf2d:$Id$
2 // Author: Timur Pocheptsov 26/04/2012
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2012, 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_ROOTOpenGLView
13 #define ROOT_ROOTOpenGLView
14 
15 #ifndef ROOT_QuartzWindow
16 #include "QuartzWindow.h"
17 #endif
18 
19 ///////////////////////////////////////////
20 // //
21 // OpenGL view's class. //
22 // //
23 ///////////////////////////////////////////
24 
25 @interface ROOTOpenGLView : QuartzView {
26 @private
27  // Explicit i-vars are required for 32-bit build.
28  NSOpenGLContext *fOpenGLContext;
30  //
31  NSOpenGLPixelFormat *fPixelFormat;
32 }
33 
34 - (id) initWithFrame : (NSRect) frameRect pixelFormat : (NSOpenGLPixelFormat *) format;
35 - (void) dealloc;
36 
37 //GL-view does not own GL-context, different GL contexts can be attached to the same view
38 //(though ROOT never does this). View has to know about GL-context only to notify it about
39 //geometry changes (calls -update method) and to clear drawable in a -dealloc method.
40 
41 @property (nonatomic, retain) NSOpenGLContext *fOpenGLContext;
42 
43 //ROOT's GL uses pixel format (TGLFormat class) when TGLWidget is
44 //created, after that, pixel format never changed (though I can do
45 //this with ROOTOpenGLView, there is no interface in ROOT's GL code for this).
46 //So, pixel format is a property of ROOTOpenGLView. GL-view owns pixel format,
47 //it can also be reset externally (again, GL module never does this).
48 //Later, when creating GL-context, this pixel format is used (and
49 //ROOT creates GL-context per GL-widget, thus using pixel format from a widget.
50 
51 - (NSOpenGLPixelFormat *) pixelFormat;
52 - (void) setPixelFormat : (NSOpenGLPixelFormat *) pixelFormat;
53 
54 //View's geometry is updated by ROOT's GUI, but view
55 //can be hidden at the moment (for example, tab with GL-view is not active
56 //at the moment). If so, when view is visible again, context must
57 //be notified about changes in a drawable's geometry.
58 @property (nonatomic, assign) BOOL fUpdateContext;
59 
60 - (BOOL) fIsOpenGLWidget;
61 
62 //X11Window protocol.
63 
64 @property (nonatomic, retain) QuartzPixmap *fBackBuffer;//nil.
65 
66 - (void) mapWindow;
69 - (BOOL) fIsOverlapped;
70 - (void) setOverlapped : (BOOL) overlap;
71 
72 @end
73 
74 namespace ROOT {
75 namespace MacOSX {
76 namespace OpenGL {
77 
79 
80 }
81 }
82 }
83 
84 #endif
QuartzPixmap * fBackBuffer
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
Definition: StringConv.hxx:21
bool GLViewIsValidDrawable(ROOTOpenGLView *glView)
NSOpenGLPixelFormat * fPixelFormat
NSOpenGLPixelFormat * pixelFormat()
XFontStruct * id
Definition: TGX11.cxx:108
NSOpenGLContext * fOpenGLContext
typedef void((*Func_t)())