Skip to content
Snippets Groups Projects
Commit df6f911b authored by Timur Pocheptsov's avatar Timur Pocheptsov
Browse files

TGLWidget and TGLContext classes were designed to isolate gl-context/gl-window...

TGLWidget and TGLContext classes were designed to isolate gl-context/gl-window specific code inside gl module.
Unfortunately, this isolation is bad as soon as we have to work with Obj-C, OpenGL, classes from Cocoa module.
TGLFormat can not go to core/base (because of multi-sampling part of code), I have to convert format into something,
I can pass to gVirtualX - array of pairs (enumerator-value).


git-svn-id: http://root.cern.ch/svn/root/trunk@44263 27541ba8-7e3a-0410-8455-c3a389f83636
parent e33fdefb
No related branches found
No related tags found
No related merge requests found
......@@ -384,15 +384,33 @@ void TGLWidget::SetFormat()
//==============================================================================
//______________________________________________________________________________
Window_t TGLWidget::CreateWindow(const TGWindow* /*parent*/, const TGLFormat &/*format*/,
Window_t TGLWidget::CreateWindow(const TGWindow* /*parent*/, const TGLFormat &format,
UInt_t /*width*/, UInt_t /*height*/,
std::pair<void *, void *>& /*innerData*/)
std::pair<void *, void *>& /*internalData*/)
{
// CreateWidget - MacOSX/Cocoa version.
// Static function called prior to construction.
// Can throw std::bad_alloc and std::runtime_error.
// This version is bad - I do not check the results of
// X11 calls.
typedef std::pair<UInt_t, Int_t> component_type;
std::vector<component_type>formatComponents;
if (format.HasDepth())
formatComponents.push_back(component_type(TGLFormat::kDepth, format.GetDepthSize()));
if (format.HasStencil())
formatComponents.push_back(component_type(TGLFormat::kStencil, format.GetStencilSize()));
if (format.HasAccumBuffer())
formatComponents.push_back(component_type(TGLFormat::kAccum, format.GetAccumSize()));
if (format.IsDoubleBuffered())
formatComponents.push_back(component_type(TGLFormat::kDoubleBuffer, 0));
if (format.IsStereo())
formatComponents.push_back(component_type(TGLFormat::kStereo, 0));
if (format.HasMultiSampling())
formatComponents.push_back(component_type(TGLFormat::kMultiSample, format.GetSamples()));
//return gVirtualX->CreateOpenGLWindow(parent->GetId(), width, height, formatComponents);
return Window_t();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment