67 lines
3.6 KiB
HTML
67 lines
3.6 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>PyGUI - GL.DisplayList</title></head>
|
|
<body>
|
|
<h1>class <span style="font-family: monospace;">GL.DisplayList</span></h1>
|
|
|
|
The DisplayList class in the GL submodule provides a context-independent
|
|
representation of an OpenGL display list. You can use a single DisplayList
|
|
object with multiple <a href="GLView.html">GLViews</a> and/or <a href="GLPixmap.html">GLPixmaps</a> without being concerned
|
|
whether they are sharing display list spaces or not, and without having to
|
|
keep track of OpenGL display list numbers.<br>
|
|
<br>
|
|
To use a DisplayList, you provide it with a <span style="font-style: italic;">setup function</span>
|
|
that makes the necessary OpenGL calls to define the display list. Then,
|
|
whenever you want to draw the display list, you call its <span style="font-family: monospace;">call</span>
|
|
method. Whenever the display list is used in a context where it has not
|
|
been used before, the setup function will be called to compile a
|
|
representation of it for that context.<br>
|
|
<br>
|
|
As an alternative to plugging in a setup function, you can also subclass DisplayList and override the <span style="font-family: monospace;">do_setup</span> method.<br>
|
|
<br>
|
|
Inside your setup function or method, you can freely make calls to draw other DisplayList and <a href="Texture.html">Texture</a>
|
|
objects, and PyGUI will make sure that everything is done in the right
|
|
order. To make this work, calls to the setup methods of those other
|
|
objects are deferred until definition of the first display list has
|
|
completed.<br>
|
|
<br>
|
|
<span style="font-style: italic;">Note:</span> If you make your own
|
|
calls to glNewList and glEndList, you must not attempt to use any
|
|
DisplayList or Texture objects between these calls, because PyGUI will
|
|
not know that a display list is being defined, and will try to do
|
|
things that don't work in that situation. Therefore it is recommended
|
|
that if you use these objects, you use them for <span style="font-style: italic;">all</span> of your display list and texure management.<br>
|
|
<h2>Constructor</h2>
|
|
<dl style="margin-left: 40px;">
|
|
<dt style="font-family: monospace;">DisplayList(setup = None)</dt>
|
|
<dd>Constructs a new DisplayList with the given setup function. See the <span style="font-family: monospace;">setup</span> property.<br>
|
|
</dd>
|
|
</dl>
|
|
<h2>Properties</h2>
|
|
<dl style="margin-left: 40px;">
|
|
<dt style="font-family: monospace;">setup</dt>
|
|
<dd>Function to define the contents of the display list. It should be
|
|
a callable object of no arguments. A call to glNewList will have been
|
|
made before the setup function is called, and glEndList will be called
|
|
after it returns.</dd>
|
|
</dl>
|
|
<h2>Methods</h2>
|
|
<dl style="margin-left: 40px;">
|
|
<dt style="font-family: monospace;">call()</dt>
|
|
<dd>Call the display list, using glCallList. If the display list has
|
|
not previously been used with the current context (or one with which it
|
|
is sharing display lists), an OpenGL display list number is allocated
|
|
and the <span style="font-family: monospace;">setup</span> function is called to compile a representation of the display list.</dd>
|
|
</dl>
|
|
<dl style="margin-left: 40px;">
|
|
<dt style="font-family: monospace;">deallocate()</dt><dd>Deallocates any OpenGL resources currently allocated to the DisplayList. If it is used again, new resources will be allocated.<br>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
<h2>Abstract Methods</h2>
|
|
<dl style="margin-left: 40px;">
|
|
<dt style="font-family: monospace;">do_setup()</dt>
|
|
<dd>As an alternative to supplying a setup function, a subclass can override this method to define the display list.</dd>
|
|
</dl>
|
|
--<br>
|
|
</body></html> |