Pass const pointers to events
SDL_Events are only read.
This commit is contained in:
parent
fdf465851c
commit
2e532afd2b
4 changed files with 6 additions and 4 deletions
|
@ -797,7 +797,8 @@ sc_input_manager_process_file(struct sc_input_manager *im,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
sc_input_manager_handle_event(struct sc_input_manager *im, SDL_Event *event) {
|
sc_input_manager_handle_event(struct sc_input_manager *im,
|
||||||
|
const SDL_Event *event) {
|
||||||
bool control = im->controller;
|
bool control = im->controller;
|
||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
case SDL_TEXTINPUT:
|
case SDL_TEXTINPUT:
|
||||||
|
|
|
@ -61,6 +61,7 @@ sc_input_manager_init(struct sc_input_manager *im,
|
||||||
const struct sc_input_manager_params *params);
|
const struct sc_input_manager_params *params);
|
||||||
|
|
||||||
void
|
void
|
||||||
sc_input_manager_handle_event(struct sc_input_manager *im, SDL_Event *event);
|
sc_input_manager_handle_event(struct sc_input_manager *im,
|
||||||
|
const SDL_Event *event);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -812,7 +812,7 @@ sc_screen_is_mouse_capture_key(SDL_Keycode key) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
sc_screen_handle_event(struct sc_screen *screen, SDL_Event *event) {
|
sc_screen_handle_event(struct sc_screen *screen, const SDL_Event *event) {
|
||||||
bool relative_mode = sc_screen_is_relative_mode(screen);
|
bool relative_mode = sc_screen_is_relative_mode(screen);
|
||||||
|
|
||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
|
|
|
@ -137,7 +137,7 @@ sc_screen_set_rotation(struct sc_screen *screen, unsigned rotation);
|
||||||
// react to SDL events
|
// react to SDL events
|
||||||
// If this function returns false, scrcpy must exit with an error.
|
// If this function returns false, scrcpy must exit with an error.
|
||||||
bool
|
bool
|
||||||
sc_screen_handle_event(struct sc_screen *screen, SDL_Event *event);
|
sc_screen_handle_event(struct sc_screen *screen, const SDL_Event *event);
|
||||||
|
|
||||||
// convert point from window coordinates to frame coordinates
|
// convert point from window coordinates to frame coordinates
|
||||||
// x and y are expressed in pixels
|
// x and y are expressed in pixels
|
||||||
|
|
Loading…
Reference in a new issue