Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Linux GetTicks64 always returns 0 while GetTicks returns correct value #545

Open
geniot opened this issue Dec 9, 2022 · 8 comments
Open

Comments

@geniot
Copy link

geniot commented Dec 9, 2022

I'm using x86_64 Linux distributive.
sdl.GetTicks64() always returns 0 while sdl.GetTicks() returns a correct value.

@veeableful
Copy link
Contributor

Hi @geniot, could you let me know what version of go-sdl2 is being used? I believe it has been fixed in the newer versions such as v0.4.27.

@geniot
Copy link
Author

geniot commented Dec 11, 2022

I've been using 0.4.27 since the initial commit of my boilerplate code:
geniot/go-sdl2-cp-examples@36994f6#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6
The finding and the fixes came later:
geniot/go-sdl2-cp-examples@e2bf3aa
geniot/go-sdl2-cp-examples@4209ea5

@veeableful
Copy link
Contributor

Thanks @geniot for the response. Could you let me know what version of SDL2 is being used?

@geniot
Copy link
Author

geniot commented Dec 11, 2022

2.0:

vitaly@vitaly-laptop:~/GolandProjects/go-sdl2-cp-examples/bin$ ldd go_sdl2_cp_examples 
	linux-vdso.so.1 (0x00007ffd7cfae000)
	libSDL2-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 (0x00007fc9019d8000)
	libSDL2_ttf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libSDL2_ttf-2.0.so.0 (0x00007fc9017d0000)
	libSDL2_image-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libSDL2_image-2.0.so.0 (0x00007fc9015a0000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc901381000)
	libSDL2_mixer-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libSDL2_mixer-2.0.so.0 (0x00007fc901160000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc900d6f000)
...

@veeableful
Copy link
Contributor

Hi @geniot, if SDL2 2.0.0 is being used then it needs to be updated to at least SDL2 2.0.18 as that function isn't available in the older versions, according to https://wiki.libsdl.org/SDL2/SDL_GetTicks64

@geniot
Copy link
Author

geniot commented Dec 11, 2022

Thanks. I guess I'll stick with my fix as I'm also cross compiling for a handheld device where updating SDL2 is not so trivial. 49 days of game time is fine with me :)

@veeableful
Copy link
Contributor

Hi @geniot, you can try our master branch which has SDL2 2.0.20 static libraries and build your game statically using the command mentioned here. They haven't been tested but it may be worth a shot.

@geniot
Copy link
Author

geniot commented Dec 11, 2022

Thanks for the hint. I'll definitely try later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants