How to make a embedded canvas with the GL dis

Hello,
I wrote a simple GUI with a canvas to display some 3D objects. Of cause the objects are displayed in “pad” style when I use Draw(); and in “GL” style when I use Draw(“ogl”).
My question is that the objects will be displayed in the external viewer when I choose Draw(“ogl”), can I make a embedded canvas in my GUI with the GL displaying style?

We just make recent developments to allow to use OpenGL for all graphics in ROOT.
It is in 5.34 patches and in roottrunk.
It $ROOTSYS/etc/syetme.rootrc is enough to do:

# Flag to set CanvasPreferGL via gStyle
OpenGL.CanvasPreferGL:                      1

[quote=“couet”]We just make recent developments to allow to use OpenGL for all graphics in ROOT.
It is in 5.34 patches and in roottrunk.
It $ROOTSYS/etc/syetme.rootrc is enough to do:

[code]

Flag to set CanvasPreferGL via gStyle

OpenGL.CanvasPreferGL: 1
[/code][/quote]

dear couet,
i tried to add the following to my program but there is still something wrong:
gStyle->CanvasPreferGL;
maybe the command is not right…
thanks!

gStyle->CanvasPreferGL(1);

dear couet,
maybe it’s necessary to add the syetme.rootrc to the program? the ROOT says Error: can’t call TStyle::canvasprefergl(1)
but the command “#include <syetme.rootrc>” is wrong.
thanks!

sorry it is:

gStyle->SetCanvasPreferGL(1);

[quote=“couet”]sorry it is:

gStyle->SetCanvasPreferGL(1); [/quote]

dear couet,
thanks a lot. the “gStyle->SetCanvasPreferGL(0);” will work but the ROOT breaks down when the parameter changes into 1. I’m now checking the program.

On which machine ? which ROOT version ? do you have OpenGL installed ?

dear couet,
it works! your advertisement is really helpful.
thank you very much! =D> =D>