Tool to test SDL 2 functions. More...
#include "tools/sdl2/sdl2.hpp"
#include "sdl/texture.hpp"
#include "sdl/window.hpp"
#include "tools/sdl2/window.hpp"
#include "text.hpp"
#include <SDL.h>
#include <iostream>
#include <deque>
#include <boost/range/adaptor/reversed.hpp>
Go to the source code of this file.
Classes | |
struct | texit |
This exception when throw should terminate the application. More... | |
struct | tsdl |
struct | ttext_input |
Functions | |
static void | draw_text (sdl::twindow &window, const std::string &string, const int x, const int y) |
static void | draw_command_line (sdl::twindow &window, const std::string &command) |
static void | draw_command_history (sdl::twindow &window, const std::deque< std::string > &history) |
static bool | execute_command (std::string &command_line) |
std::string | get_token (const std::string &string, std::string::const_iterator &begin, const char separator) |
Gets a token from a string. More... | |
int | main () |
Variables | |
std::vector< sdl::twindow * > | windows |
Contains the windows created by the user. More... | |
Tool to test SDL 2 functions.
Definition in file sdl2.cpp.
|
static |
|
static |
|
static |
Definition at line 71 of file sdl2.cpp.
References font::ttext::render(), and font::ttext::set_text().
Referenced by draw_command_history(), and draw_command_line().
|
static |
Definition at line 104 of file sdl2.cpp.
References execute_window(), get_token(), utf8::insert(), and utf8::size().
Referenced by play_controller::hotkey_handler::execute_command(), and main().
std::string get_token | ( | const std::string & | string, |
std::string::const_iterator & | begin, | ||
const char | separator | ||
) |
Gets a token from a string.
Tokens are separated by a single separator
character.
string | The string to search for tokens. | |
[in,out] | begin | Input:
|
separator | The character marking the separation between tokens. |
separator
character, or if the character is not found until the end of the string
. Definition at line 121 of file sdl2.cpp.
References gui2::event::find().
Referenced by execute_command().
Definition at line 138 of file sdl2.cpp.
References draw_command_history(), draw_command_line(), utf8::erase(), execute_command(), sdl::twindow::fill(), utf8::insert(), sdl::twindow::render(), and utf8::size().
std::vector<sdl::twindow*> windows |