amino
1.0-beta2
Lightweight Robot Utility Library
|
SDL/OpenGL window management. More...
#include <SDL.h>
Go to the source code of this file.
Functions | |
AA_API struct aa_rx_win * | aa_rx_win_create (const char *title, int x_pos, int y_pos, int width, int height, Uint32 flags) |
Create a new SDL / OpenGL window. More... | |
AA_API struct aa_rx_win * | aa_rx_win_default_create (const char *title, int width, int height) |
Create a new SDL / OpenGL window with default parameters. More... | |
AA_API void | aa_rx_win_destroy (struct aa_rx_win *win) |
Destroy SDL / OpenGL window. | |
AA_API struct aa_gl_globals * | aa_rx_win_gl_globals (struct aa_rx_win *win) |
Return a pointer to the window's GL globals struct. More... | |
AA_API void | aa_rx_win_set_sg (struct aa_rx_win *win, const struct aa_rx_sg *sg) |
Set a scenegraph for the window. More... | |
AA_API void | aa_rx_win_set_sg_sub (struct aa_rx_win *win, const struct aa_rx_sg_sub *sg_sub) |
Set a sub-scenegraph for the window. More... | |
AA_API const struct aa_rx_sg * | aa_rx_win_get_sg (struct aa_rx_win *win) |
Retreive the scene graph for the window. | |
AA_API void | aa_rx_win_display_sg_config (struct aa_rx_win *win, struct aa_sdl_display_params *params, const struct aa_rx_sg *scenegraph, size_t n_q, const double *q) |
Render a scenegraph at the given configuration in the window. | |
AA_API void | aa_rx_win_display_sg_tf (struct aa_rx_win *win, struct aa_sdl_display_params *params, const struct aa_rx_sg *scenegraph, size_t n_tf, const double *tf_abs, size_t ld_tf) |
Display a scene graph in the window with the given transforms. | |
AA_API void | aa_rx_win_display_fk (struct aa_rx_win *win, struct aa_sdl_display_params *params, const struct aa_rx_fk *fk) |
Display a scene graph in the window with the forward kinematics. | |
AA_API void | aa_rx_win_set_config (struct aa_rx_win *win, size_t n, const double *q) |
Set the configuration vector for the window. More... | |
AA_API void | aa_rx_win_set_bconfig (struct aa_rx_win *win, const struct aa_dvec *q) |
Set the configuration vector (block-vector version) for the window. More... | |
AA_API void | aa_rx_win_set_display (struct aa_rx_win *win, aa_sdl_win_display_fun display, void *context, void(*destructor)(void *)) |
Set the window's display function. More... | |
AA_API void | aa_rx_win_set_display_plan (struct aa_rx_win *win, struct aa_rx_sg *sg, size_t n_plan_elements, const double *plan) |
Display a motion plan in the window. | |
AA_API void | aa_rx_win_set_display_seq (struct aa_rx_win *win, struct aa_rx_mp_seq *mp_seq) |
Display a sequence of motion plans. | |
AA_API void | aa_rx_win_run (void) |
Synchronous display using current thread. More... | |
AA_API void | aa_rx_win_run_async (void) |
Asynchronous run the display in a new current thread. More... | |
AA_API void | aa_rx_win_stop (struct aa_rx_win *win) |
Instruct the rendering thread to stop. More... | |
AA_API int | aa_rx_win_is_running (struct aa_rx_win *win) |
Return true if the window is still running. | |
AA_API void | aa_rx_win_stop_on_quit (struct aa_rx_win *win, int value) |
Instruct the rendering thread to stop when the user closes the window. | |
AA_API void | aa_rx_win_lock (struct aa_rx_win *win) |
Lock the window. More... | |
AA_API void | aa_rx_win_unlock (struct aa_rx_win *win) |
Unlock the window. | |
AA_API void | aa_rx_win_sg_gl_init (struct aa_rx_win *win, struct aa_rx_sg *sg) |
Initialize scenegraph GL values for the given window. More... | |
AA_API void | aa_rx_win_get_tf_cam (struct aa_rx_win *win, double *E) |
Return the current camera pose. More... | |
AA_API void | aa_rx_win_set_tf_cam (struct aa_rx_win *win, const double *E) |
Set the camera pose. More... | |
SDL/OpenGL window management.
Definition in file scene_win.h.
AA_API struct aa_rx_win* aa_rx_win_create | ( | const char * | title, |
int | x_pos, | ||
int | y_pos, | ||
int | width, | ||
int | height, | ||
Uint32 | flags | ||
) |
Create a new SDL / OpenGL window.
title | The window title |
x_pos | Initial X position of the window |
y_pos | Initial Y position of the window |
width | Initial width of the window |
height | Initial height of the window |
flags | Flags for SDL_CreateWindow() |
Create a new SDL / OpenGL window with default parameters.
On Mac OS X, this function may only be called from the main thread.
title | The window title |
width | Initial width of the window |
height | Initial height of the window |
Return the current camera pose.
win | The window |
E | The camera pose in quaternion-vector format |
Return a pointer to the window's GL globals struct.
Note that the window's rendering thread may asynchronously access the GL globals. If you need to modify any parameters, synchronize access by locking the window.
Lock the window.
The rendering thread also takes this lock before calling the display function.
AA_API void aa_rx_win_run | ( | void | ) |
Synchronous display using current thread.
This function is thread-safe. The window will be locked while each window's display() function is called.
On Mac OS X under the Cocoa/Quartz GUI, this function may only be called from the main thread.
AA_API void aa_rx_win_run_async | ( | void | ) |
Asynchronous run the display in a new current thread.
This function is thread-safe. The window will be locked while each window's display() function is called.
This function will not work on Mac OS X under the Cocoa GUI because Cocoa limits GUI interaction to the main program thread. Instead, you must call aa_rx_win_run() from your program's main thread.
Set the configuration vector (block-vector version) for the window.
This configuration is used by the default rendering function. Custom rendering functions may not need to set the configuration with this function.
Set the configuration vector for the window.
This configuration is used by the default rendering function. Custom rendering functions may not need to set the configuration with this function.
AA_API void aa_rx_win_set_display | ( | struct aa_rx_win * | win, |
aa_sdl_win_display_fun | display, | ||
void * | context, | ||
void(*)(void *) | destructor | ||
) |
Set the window's display function.
win | The window |
display | The display function |
context | The context argument for the display function |
destructor | A cleanup function that is called on context when either another display function is set for the window or the window is destroyed. |
Set a scenegraph for the window.
The scenegraph is used by the default rendering function. Custom rendering functions may not need to set the window scene graph first.
Set a sub-scenegraph for the window.
The scenegraph is used by the default rendering function. Custom rendering functions may not need to set the window scene graph first.
The end-effector of the sub-scenegraph can be interactively controlled in workspace.
Set the camera pose.
win | The window |
E | The camera pose in quaternion-vector format |
Initialize scenegraph GL values for the given window.
This function is threadsafe.