Category: sdl

How to fix libSDL.a(xyz): undefined reference to `__imp_timeBeginPeriod' and friends 1

How to fix libSDL.a(xyz): undefined reference to `__imp_timeBeginPeriod' and friends

How to fix this error : /usr/local/cross-tools/x86_64-w64-mingw32/lib/libSDL.a(SDL_systimer.o):SDL_systimer.c:(.text+0x25): undefined reference to `__imp_timeBeginPeriod' /usr/local/cross-tools/x86_64-w64-mingw32/lib/libSDL.a(SDL_systimer.o):SDL_systimer.c:(.text+0x2b): undefined reference to `__imp_timeGetTime' /usr/local/cross-tools/x86_64-w64-mingw32/lib/libSDL.a(SDL_systimer.o):SDL_systimer.c:(.text+0x50): undefined reference to `__imp_timeGetTime' /usr/local/cross-tools/x86_64-w64-mingw32/lib/libSDL.a(SDL_systimer.o):SDL_systimer.c:(.text+0xbb): undefined reference to `__imp_timeBeginPeriod' /usr/local/cross-tools/x86_64-w64-mingw32/lib/libSDL.a(SDL_systimer.o):SDL_systimer.c:(.text+0xe1): undefined reference to `__imp_timeSetEvent' /usr/local/cross-tools/x86_64-w64-mingw32/lib/libSDL.a(SDL_systimer.o):SDL_systimer.c:(.text+0x140): undefined reference...

Insert a SDL event programmatically 0

Insert a SDL event programmatically

SDL_Event user_event; user_event.type=SDL_USEREVENT; user_event.user.code=2; user_event.user.data1=NULL; user_event.user.data2=NULL; SDL_PushEvent(&user_event); ... in event loop switch (event.type) { case SDL_USEREVENT: if (event.user.code == MY_CUSTOM_DEFINE) { } break; (...) }