shinyquagsire23 / OpenJKDF2

A cross-platform reimplementation of JKDF2 in C
Other
493 stars 39 forks source link

[Suggestion] Backend #278

Open SilentMRG opened 11 months ago

SilentMRG commented 11 months ago

Hello everybody!

Is it possible to add support for DirectX 9 or OpenGL 2.0? I'm stuck on a potato. I think these backends will help other people too. :)

Thank you for your attention!

shinyquagsire23 commented 11 months ago

Yeah a minspec renderer as been on my TODO list for a bit, probably targeting OpenGL 2.0 and w/o any of the fancy features. The biggest difficulty/annoyance is texture format conversion (the original game also had this issue, it converts 8bpp textures to 16bpp for uploads) and emissive lights (no clue how to do this one w/ OpenGL 2.0). But making an OpenGL 2.0 renderer which matches the OG hardware renderer should be easy enough.

My tentative target is maybe to also have a 32-bit EXE which targets WinXP/Win7/macOS 9+10, probably missing some features which are difficult to backport (ie, automatic updates probably)

SilentMRG commented 11 months ago

Good to know these things. =) Maybe I'm talking a lot of nonsense... A software renderer would be a good idea, you could try making a ddraw hook using this project: https://github.com/FunkyFr3sh/cnc-ddraw

I quoted "ddraw" as I saw that the vanilla version supports "DirectDraw". Anyway, I don't know if it would work... Like I said maybe I'm talking a lot of nonsense, because I don't understand anything about coding.

shinyquagsire23 commented 11 months ago

So technically, I could bring back all of the old drawing libraries (DirectDraw, GDI32, DirectInput, etc). Some of the code is still there, most of it I just didn't bother to decompile because SDL2 generally works better. Also, LEC's 8bpp software renderer was like 60% of the binary and will require a lot of effort to decompile.

My train of thought though was more or less just, most computers have OpenGL 2.0, and the ones that don't can either use the original EXE or something like Mesa's software OpenGL renderer.

SilentMRG commented 11 months ago

So really I said nonsense, hehehe. XD Well, just a question: Does the source port in its current state support SDL2 or will it be done in the future? Although I don't understand the technical part I feel you are right in your thinking about OpenGL 2.0.

shinyquagsire23 commented 11 months ago

yeah currently everything is SDL2 and OpenGL 3.2, and 256-color rendering is done with shaders (which will be an issue for OpenGL 2.0 maybe). And for multiplayer, DirectPlay was replaced by Valve's GameNetworkingSockets library

Alex3474247 commented 11 months ago

This can be very difficult, time-consuming and even so-to-speak not actual to implement because sdl2 is better and the original engine used the old version of directx: 7 and not 9 and of cource because of, what Shiny said above.