mirror of https://github.com/libsdl-org/SDL.git
updated the snake demo to be C++ compatible
This commit is contained in:
parent
78f816d74e
commit
5dd2492645
|
|
@ -208,7 +208,7 @@ void snake_step(SnakeContext *ctx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int handle_key_event_(SnakeContext *ctx, SDL_Scancode key_code)
|
static SDL_AppResult handle_key_event_(SnakeContext *ctx, SDL_Scancode key_code)
|
||||||
{
|
{
|
||||||
switch (key_code) {
|
switch (key_code) {
|
||||||
/* Quit. */
|
/* Quit. */
|
||||||
|
|
@ -309,7 +309,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||||
return SDL_APP_FAILURE;
|
return SDL_APP_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
AppState *as = SDL_calloc(1, sizeof(AppState));
|
AppState *as = (AppState *)SDL_calloc(1, sizeof(AppState));
|
||||||
if (!as) {
|
if (!as) {
|
||||||
return SDL_APP_FAILURE;
|
return SDL_APP_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue