Next: Method of use
Up: DisplayDevice
Previous: Internal data structures
- virtual void queue_events(void) - Indicate to the event manager that windowing and mouse movement events need to be reported. The actual commands executed through this function will be different based on the window manager used, and the GUI library being used (basically, it depends on who is handling events, which is different when just using straight GL, when using the FORMS library, when using Tk, when using just Xlib, when using ... ack).
- virtual int test_events(void) - Check and see if there is an event pending, but do not get the event yet.
- virtual int read_event(long &, long &) - Check for an event; return true if one was found, and return the code and value for the event in the arguments.
- virtual int x() - The current X position of the mouse, measured in pixels from the lower-left corner of the screen.
- virtual int y() - The current Y position of the mouse, measured in pixels from the lower-left corner of the screen.
- virtual int button_down(int) - Check if the specified button is currently being pressed.
- virtual int menu_create(PopupMenu *) - Given a pointer to a PopupMenu instance, this creates the popup menu to be used when a request is made to make a selection from the menu. The popup menu contains selections, separators, and submenus.
- virtual int menu_activate(void) - After the popup menu is created, this routine will activate that menu and return the special selection code for the item selected, or -1 if nothing is selected.
- virtual void set_stereo_mode(int = 0) - Changes to a new stereo mode.
- virtual void abs_screen_loc_3D(float *, long *) - Given a point in 3D `world' coordinates (the first arg), this routine converts the point to absolute 2D `screen' coordinates, i.e. the location measured in pixels from the lower-left corner of the screen.
- virtual void rel_screen_loc_3D(float *, float *) - Given a point in 3D `world' coordinates (the first arg), this routine converts the point to `relative, scaled' 2D coordinates, which are 0 ... 1 inside the graphics display window in each X, Y dimension, and undefined outside this region.
- virtual void find_3D_from_2D(float *A, float *B, float *C) - Given a point A, and a 2D relative screen position point B, this computes the 3D point corresponding to the position of the 2D point. Since the 2D point is not sufficient to determine the 3D position in space for that point, the point A is given to serve as a `reference' point. Currently, the algorithm only supports the simple case where the eye is looking directly along the Z axis.
- virtual void push() - pushes the top matrix on the transformation matrix stack; the top matrix is unchanged, but is saved one level down on the stack.
- virtual void pop() - pops the matrix stack, restoring a previously pushed matrix state.
- virtual void loadmatrix(Matrix4 &) - copies the given 4 x 4 matrix into the top matrix on the stack, destroying the previous matrix value there.
- virtual void multmatrix(Matrix4 &) - premultiplies the top matrix on the stack by the given 4 x 4 matrix.
- virtual void prepare2D(int = true) - get the display ready to draw 2D objects, by setting the proper projection matrices and viewport. The argument indicates whether to clear the screen.
- virtual void prepare3D(int = true) - get the display ready to draw 3D objects, by setting the proper projection matrices and viewport. The argument indicates whether to clear the screen.
- virtual void clear(void) - erase the current display window, setting the background to the proper color.
- virtual void left(void) - prepare to draw the left eye image when in stereo. Note that when drawing in stereo, the left eye should always be drawn first.
- virtual void right(voivd) - prepare to draw the right eye image when in stereo. Note that when drawing in stereo, the right eye should always be drawn last.
- virtual void normal(void) - prepare to draw a non-stereo image.
- virtual void update(int = true) - after drawing is complete, this routine `cleans up', by doing any actions which only need to be done once at the end of drawing (for example, swapping buffers which drawing using double buffers). The argument indicates whether to actually perform a buffer swap.
- virtual void reshape(void) - refresh the display after it has been reshaped or exposed.
- virtual void render(void *) - the most important routine in DisplayDevice: this routine takes the given display list (created by some Displayable, and goes through the list executing the drawing commands as they are listed. Each DisplayDevice subclass must provide a version of render, to do the actions required to draw a scene.
- virtual int pick(int, float *, void *, float &) - pick objects based on given list of draw commands, and determine which (if any) item in the list of drawing command was under the given pointer position. The arguments are the dimension of picking (2 or 3), the position of the pointer, draw command list, and returned distance from object to eye position (this last argument is set to the distance from the object to the current eye position, which can be used to determine which item is closest when multiple objects are under the pointer). This function returns the ID code ('tag') for the item closest to the pointer, or (-1) if nothing was picked. If an object is picked, the eye distance argument is set to the distance from the display's eye position to the object (after its position has been found from the transformation matrix). If the value of the argument when pick is called is negative or zero, a pick will be generated if any item is near the pointer. If the value of the argument is positive, a pick will be generated only if an item is closer to the eye position than the value of the
argument. For 2D picking, the pointer coordinates are the relative position in the window from the lower-left corner (both in the range 0 ... 1). For 3D picking, the pointer coordinates are the world coordinates of the pointer. They are the coordinates of the pointer after its transformation matrix has been applied, and these coordinates are compared to the coordinates of the objects when their transformation matrices are applied.
Next: Method of use
Up: DisplayDevice
Previous: Internal data structures
Justin Gullingsrud
Tue Apr 6 09:26:48 CDT 1999