Closed bvssvni closed 10 years ago
rust-sdl2 has a start_text_input
and stop_text_input
.
This is probably to not allocate on each event.
Could add a new variant to InputEvent
:
CharInput { ch: char }
It will work if we enable text input by default in sdl2_game_window
and use String
:
Text(String)
The cost of allocating a String
will be small compared to checking the time.
Source: http://stackoverflow.com/questions/7612292/how-bad-it-is-to-keep-calling-malloc-and-free
I think we should just enable text input by default in sdl2_game_window
allocate a String
. In glfw_game_window
we should convert the char
to a String
.
rust-sdl2 has a
TextInputEvent(uint, Window, String)
glfw-rs has a
CharEvent(char)