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

SDL renderer backend #920

Open
mardy opened this issue Mar 22, 2024 · 1 comment
Open

SDL renderer backend #920

mardy opened this issue Mar 22, 2024 · 1 comment

Comments

@mardy
Copy link

mardy commented Mar 22, 2024

Hi there!
I was considering the idea of porting this game to the Nintendo Wii, but it looks like it isn't doable right now, since there is no OpenGL library for the Wii.

I had a look at the renderer.hpp file, and at first sight I didn't find anything in there that would not be possible to implement using the SDL_Renderer API (please correct me if I'm wrong). It would be nice if the renderer was reimplemented using the SDL_Renderer API, because then it would be portable to any platform which supports SDL2. I found issue #907 about the 3DS, for instance.

@lethal-guitar
Copy link
Owner

Hi, nice, that'd be really cool to see it running on a Wii 🙂 It would indeed be great to have the option for solely SDL-based rendering for increased portability. It's not quite as straightforward as it may seem at first though:

I had a look at the renderer.hpp file, and at first sight I didn't find anything in there that would not be possible to implement using the SDL_Renderer API

While the majority of the interface could easily be implemented using SDL_Renderer, there are certain special effects (white damage flash for sprites, underwater effect, cloak powerup translucency effect) which need custom shaders. On top of that, map tile rendering uses VBOs for efficiency.

For reference, see:
https://github.com/lethal-guitar/RigelEngine/blob/master/src/engine/graphical_effects.cpp

: pRenderer->createVertexBuffer(data.mVertices);

That being said, there are definitely ways around this. The tile rendering used to be more straightforward earlier in the project, so you could revert that part of the code to before the changes were made (the relevant commit: 3fe48b8).

As for the special effects, those could also be implemented on the CPU to avoid the need for dedicated shaders.

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