[Panel-devel] OpenGL applets

Zack Rusin zack at kde.org
Fri Jul 6 23:06:50 CEST 2007


On Friday 06 July 2007 01:50:00 pm Matias Valdenegro T. wrote:
> El Vie 06 Jul 2007, Aaron J. Seigo escribió:
> > On Thursday 05 July 2007, Matias Valdenegro T. wrote:
> > > El Jue 05 Jul 2007, Zack Rusin escribió:
> > > > this code allows you to write fully OpenGL based plasma applets.
> > > > simply inherit Plasma::GLApplet instead of Plasma::Applet and
> > > > reimplement GLApplet::paintGLInterface instead of
> > > > Applet::paintInterface
> > >
> > > Nice, but what are the differences between this and using a QGLWidget
> > > as the viewport of a QGraphicsView?
> >
> > just about everything. when using a qglwidget for a qgraphicview vieport
> > you are still using the qgrahpicsscene api to paint and whatnot; this
> > lets you use actual opengl programming in a given item and regardless of
> > what the viewport is
>
> I see, just thought that as there's a QOpenGLPainter, QGVItem's are painted

There's a QOpenGLPaintEngine not QOpenGLPainter, but that's not related to 
this discussion :)

> using OpenGL calls, and not in software mode.

These are different things. This is not about painting but composing. I never 
implemented QWindowSurface that worked on top of OpenGL (well i did but it's 
not in Qt) which implies that normal backing store composition that Qt uses 
doesn't work with OpenGL. If you don't understand what I'm talking about try 
this: in CoronaView (coronaview.cpp) constructor put setViewport(new 
QGLWidget()); compile, install, run plasma, put the clock applet on the 
desktop and then move any window on top of the plasma desktop - it will flash 
(due to full screen updates of the gl widget). now remove that call, install 
plasma and the applets i've attached, run plasma and add the applets. it'll 
be silky smooth. the reason for that is that glapplet handles composition of 
itself in a way that makes use of qt's backin store.

z


More information about the Panel-devel mailing list