grimfang4 / sdl-gpu

A library for high-performance, modern 2D graphics with SDL written in C.
MIT License
1.19k stars 123 forks source link

Demos don't work (and can't set up on my own) #209

Open TheOneTrueZandra opened 3 years ago

TheOneTrueZandra commented 3 years ago

Hey! So I'm trying to set up sdl-gpu on windows for my own project, and was having a bunch of issues. I figured an easy way to possibly figure out how to get everything working was to look into the demos included with the project.

However, it appears that even the default demos that come with sdl-gpu aren't functioning correctly. Whenever I build them, they build successfully, but running them immediately gives me the prompt "the procedure entry point SDL_RWseek could not be located in the dynamic link library" with a path referencing the demo I just ran.

Normally I'd think I'm doing something wrong, but as far as I'm aware, all I need to do is run the cmake GUI, provide the correct paths to the SDL include folder and 2 libs (SDL2main.lib and SDL2.lib).

This kinda extends into making my own project, as creating my own project with the intent of using sdl-gpu was halted by the same issue. I'm not really familiar with cmake too much, but the fact that a vanilla, unmodified version of the project cloned this morning from git doesn't work makes me feel a little better about that.

grimfang4 commented 3 years ago

Which version of SDL2 are you using? This sounds like a binary compatibility breakage from libSDL (that's where SDL_RWseek comes from), so you might need to rebuild SDL_gpu with the version of SDL2 you have or use an older version of SDL2.

TheOneTrueZandra commented 3 years ago

The latest version (2.0.12). I tried working backwards, none of the previous versions I tried (tried back a few versions, dunno which exactly) work as well.

Is there a specific SDL version I should use? I didn't see anything listed in the readme or otherwise

TheOneTrueZandra commented 3 years ago

@grimfang4 Okay! So after more testing on a fresh project, it looks like SDL 2.0.10 and 2.0.12 are broken, but 2.0.9 works.

We'll probably just switch to using SDL 2.0.9 so that we have SDL_GPU available, but you should probably look into why it doesn't work with 2.0.10 and 2.0.12. It's whatever that issue is with SDL_RWseek, for sure.

cppmadguy commented 3 years ago

I Think I've found the 'problem'. Starting in SDL 2.10.0, functions are used instead of macros for SDL_RW* operations. This explain why this issue is happening for all versions of SDL after 2.9.0. This is mentioned in the WhatsNew.txt