klampt.vis.glutbackend module¶
-
class
klampt.vis.backends.glutbackend.
GLUTBackend
[source]¶ Bases:
object
A basic OpenGL program using GLUT. Set up your GLProgramInterface class, call addPlugin(plugin), then call run() to start the GLUT main loop.
NOTE: the run() call may not return depending on your GLUT system.
For more control over windowing, you can use the createWindow function to construct new windows and addPlugin to add plugins to those windows.
IMPORTANT NOTE: only one window may be created for a given world. If you want to use multiple windows, then a new world should be loaded for each world.
-
class
klampt.vis.backends.glutbackend.
GLUTWindow
(name)[source]¶ Bases:
object
A GLUT window. Should not be used directly.
-
name
¶ title of the window (only has an effect before calling run())
- Type
str
-
index
¶ the GLUT index
- Type
int
-
width, height
width/height of the window (only has an effect before calling run(), and these are updated when the user resizes the window.
- Type
int
-
glutInitialized
¶ true if GLUT has been initialized
- Type
bool
Note: must be called after GLUT is initialized.
-
draw_text
(point, text, size=12, color=None)[source]¶ Renders text at the given point (may be 2d or 3d). Frontend should call this to draw text in either the display or display_screen method.
- Parameters
point (list of floats) – either a 2d or 3d point at which to draw the text
text (str) – the text to draw
size (int, optional) – if given, it renders a font in the given size.
color (list of 3 or 4 floats) –
-