amino  1.0-beta2
Lightweight Robot Utility Library
scene_sdl.h File Reference

SDL (Simple DirectMedia Layer) support. More...

#include <SDL.h>

Go to the source code of this file.

Typedefs

typedef int(* aa_sdl_handler_function) (void *cx, struct aa_sdl_display_params *params)
 An event handler. More...
 

Functions

AA_API void aa_sdl_init (void)
 Initialize SDL library and options. More...
 
AA_API void aa_sdl_display_loop (SDL_Window *window, struct aa_gl_globals *globals, aa_sdl_display_fun display, void *context)
 Run the display loop function.
 
AA_API void aa_sdl_gl_window (const char *title, int x_pos, int y_pos, int width, int height, Uint32 flags, SDL_Window **pwindow, SDL_GLContext *p_glcontext)
 Create an SDL window with an OpenGL context.
 
AA_API const struct timespec * aa_sdl_display_params_get_time_now (struct aa_sdl_display_params *params)
 Return the current time step.
 
AA_API const struct timespec * aa_sdl_display_params_get_time_last (struct aa_sdl_display_params *params)
 Return the previous time step.
 
AA_API const struct timespec * aa_sdl_display_params_get_time_initial (struct aa_sdl_display_params *params)
 Return the initial time step.
 
AA_API int aa_sdl_display_params_get_update (struct aa_sdl_display_params *params)
 Return whether to update the display.
 
AA_API void aa_sdl_display_params_set_quit (struct aa_sdl_display_params *params)
 Indicate a quit (window close) request.
 
AA_API void aa_sdl_display_params_set_update (struct aa_sdl_display_params *params)
 Indicate a display update is needed.
 
AA_API int aa_sdl_display_params_is_first (struct aa_sdl_display_params *params)
 Check if this is the fist display call.
 
const SDL_Event * aa_sdl_display_params_get_event (struct aa_sdl_display_params *params)
 Retrieve the most recent SDL event.
 
AA_API void aa_sdl_bind_event (SDL_EventType event_type, aa_sdl_handler_function handler, void *cx)
 Bind a handler function for an SDL event.
 
AA_API void aa_sdl_bind_key (SDL_Keycode key, aa_sdl_handler_function handler, void *cx)
 Bind a handler function for an SDL key press.
 

Detailed Description

SDL (Simple DirectMedia Layer) support.

Definition in file scene_sdl.h.

Typedef Documentation

◆ aa_sdl_handler_function

typedef int(* aa_sdl_handler_function) (void *cx, struct aa_sdl_display_params *params)

An event handler.

Returns
0 when event is handled, non-zero otherwise.

Definition at line 150 of file scene_sdl.h.

Function Documentation

◆ aa_sdl_init()

AA_API void aa_sdl_init ( void  )

Initialize SDL library and options.

The following environement variables may be used to set the corresponding SDL attributes:

  • SDL_GL_DOUBLEBUFFER
  • SDL_GL_MULTISAMPLEBUFFERS
  • SDL_GL_MULTISAMPLESAMPLES
  • SDL_GL_DEPTH_SIZE

The following environement variables may be used to set the corresponding SDL hints:

  • SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS
  • SDL_HINT_RENDER_DRIVER
  • SDL_HINT_VIDEO_X11_XRANDR
  • SDL_HINT_VIDEO_X11_XVIDMODE
  • SDL_HINT_VIDEO_X11_XINERAMA
  • SDL_HINT_VIDEO_ALLOW_SCREENSAVER
  • SDL_HINT_RENDER_SCALE_QUALITY