Go to the documentation of this file.
19 #include <emscripten/emscripten.h>
114 s->sprite_rect.w +=
s->scale_direction;
115 s->sprite_rect.h +=
s->scale_direction;
116 if (
s->scale_direction > 0) {
119 s->scale_direction = -1;
122 if (
s->sprite_rect.w <= 1 ||
s->sprite_rect.h <= 1) {
123 s->scale_direction = 1;
127 s->sprite_rect.y = (
viewport.
h -
s->sprite_rect.h) / 2;
155 #ifdef __EMSCRIPTEN__
157 emscripten_cancel_main_loop();
204 #ifdef __EMSCRIPTEN__
205 emscripten_set_main_loop(
loop, 0, 1);
215 double fps = ((double)
frames * 1000) / (now - then);
216 SDL_Log(
"%2.2f frames per second\n", fps);
#define SDL_RenderPresent
#define SDL_SetRenderTarget
A collection of pixels used in software blitting.
SDL_Renderer ** renderers
SDLTest_CommonState * SDLTest_CommonCreateState(char **argv, Uint32 flags)
Parse command line parameters and create common state.
The type used to identify a window.
#define SDL_stack_alloc(type, count)
void SDLTest_CommonQuit(SDLTest_CommonState *state)
Close test window.
#define SDL_CreateTextureFromSurface
SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv)
Easy argument handling when test app doesn't need any custom args.
#define SDL_RenderGetViewport
Uint32 SDL_GetTicks(void)
Get the number of milliseconds since the SDL library initialization.
#define SDL_LoadBMP(file)
#define SDL_DestroyTexture
SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
Open test window.
SDL_RendererFlip
Flip constants for SDL_RenderCopyEx.
static SDL_Renderer * renderer
static SDLTest_CommonState * state
#define SDL_stack_free(data)
The structure that defines a point (integer)
#define SDL_LogSetPriority
SDL_Texture * LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent)
A rectangle, with the origin at the upper left (integer).
int main(int argc, char *argv[])
void SDLTest_CommonEvent(SDLTest_CommonState *state, SDL_Event *event, int *done)
Common event handler for test windows.
GLenum GLenum GLuint texture
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
#define SDL_CreateTexture