![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include <sdl_window.hpp>

Public Member Functions | |
| Sdl_window (bool double_buffer=false) | |
| Sdl_window (const char *title, int x, int y, int w, int h, Uint32 flags, bool double_buffer=false) | |
| Sdl_window (const Sdl_window &)=delete | |
| Sdl_window (Sdl_window &&o) | |
| ~Sdl_window () | |
| SDL_GLContext | get_worker_context () |
| void | make_render_context_current () |
| void | make_worker_context_current () |
| Sdl_window & | operator= (const Sdl_window &)=delete |
| Sdl_window & | operator= (Sdl_window &&o) |
| void | set_title (const std::string &title) |
| void | swap (Sdl_window &o) |
Public Attributes | |
| int | height |
| SDL_GLContext | sdl_gl_context |
| SDL_GLContext | sdl_gl_worker_context = nullptr |
| SDL_Window * | sdl_window |
| int | width |
RAII wrapper for Sdl window
Definition at line 64 of file sdl_window.hpp.
| Sdl_window::Sdl_window | ( | bool | double_buffer = false | ) |
Creates a window using default parameters.
| double_buffer | Controls the double buffering. If true, the default is used, if false it is disabled |
Definition at line 41 of file sdl_window.cpp.
| Sdl_window::Sdl_window | ( | const char * | title, |
| int | x, | ||
| int | y, | ||
| int | w, | ||
| int | h, | ||
| Uint32 | flags, | ||
| bool | double_buffer = false ) |
Creates a window.
| title | window title |
| x | x position of the window, for centering SDL_WINDOWPOS_CENTERED can be passed |
| y | y position of the window, for centering SDL_WINDOWPOS_CENTERED can be passed |
| w | width of window |
| h | height of window |
| flags | Sdl flags for window creation |
| double_buffer | Controls the double buffering. If true, the default is used, if false it is disabled |
Definition at line 48 of file sdl_window.cpp.
References flags, sdl_gl_context, and sdl_window.
| Sdl_window::~Sdl_window | ( | ) |
Definition at line 92 of file sdl_window.cpp.
References sdl_gl_context, sdl_gl_worker_context, and sdl_window.
|
delete |
|
inline |
Definition at line 94 of file sdl_window.hpp.
References swap().

| SDL_GLContext Sdl_window::get_worker_context | ( | ) |
Returns the underlying worker context object. If it doesn'ลง yet exists it gets created. Should be called at least once from the rendering thread before the worker thread starts.
Definition at line 120 of file sdl_window.cpp.
References sdl_gl_context, sdl_gl_worker_context, and sdl_window.
Referenced by make_worker_context_current().
| void Sdl_window::make_render_context_current | ( | ) |
If using multiple OpenGL contexts for multithreading this function makes the render context current
Definition at line 111 of file sdl_window.cpp.
References sdl_gl_context, and sdl_window.
Referenced by display_xrgl_run().
| void Sdl_window::make_worker_context_current | ( | ) |
If using multiple OpenGL contexts for multithreading this function makes the worker context current
Definition at line 115 of file sdl_window.cpp.
References get_worker_context(), and sdl_window.
Referenced by display_xrgl_run(), and worker().

|
delete |
|
inline |
Definition at line 96 of file sdl_window.hpp.
References swap().

|
inline |
Sets window title
| title | Title to use |
Definition at line 112 of file sdl_window.hpp.
References sdl_window.
| void Sdl_window::swap | ( | Sdl_window & | o | ) |
Definition at line 132 of file sdl_window.cpp.
References height, sdl_gl_context, sdl_window, and width.
Referenced by Sdl_window(), and operator=().
| int Sdl_window::height |
Definition at line 141 of file sdl_window.hpp.
Referenced by display_xrgl_run(), draw(), handle_window_event(), and swap().
| SDL_GLContext Sdl_window::sdl_gl_context |
Definition at line 138 of file sdl_window.hpp.
Referenced by Sdl_window(), ~Sdl_window(), get_worker_context(), make_render_context_current(), and swap().
| SDL_GLContext Sdl_window::sdl_gl_worker_context = nullptr |
Definition at line 139 of file sdl_window.hpp.
Referenced by ~Sdl_window(), and get_worker_context().
| SDL_Window* Sdl_window::sdl_window |
Definition at line 137 of file sdl_window.hpp.
Referenced by Sdl_window(), ~Sdl_window(), display_xrgl_run(), draw(), get_worker_context(), handle_keyboard_event(), make_render_context_current(), make_worker_context_current(), set_title(), and swap().
| int Sdl_window::width |
Definition at line 140 of file sdl_window.hpp.
Referenced by display_xrgl_run(), draw(), handle_window_event(), and swap().