maforget / ComicRackCE

A Community Edition for the legendary Comic Book Manager ComicRack. ComicRack is back from the dead.
GNU General Public License v2.0
213 stars 20 forks source link

HW Accel #23

Open Salvora opened 5 months ago

Salvora commented 5 months ago

Opening an issue here for this subject. Looking at the code for the opengl, CR uses an outdated version of the Tao Framework opengl library. What do you guys think about using OpenTK instead?

https://github.com/opentk/opentk

apiweb commented 5 months ago

I think this is a good idea, especially since Tao is kind of holding us back from jumping on the .NET Core train. However, the process of conversion is not as straightforward.

Currently, OpenTK is at version 4.8.2, and it's designed to be compatible with .NET Core. The current version of ComicRack CE runs on .NET Framework 4.8, so a preliminary step would be to implement compatibility with version 3 of OpenTK (that is keeps compatibility with .Net framework). This transition alone might involve some adjustments in the existing codebase.

During my conversion attempts, I noticed that some methods and properties lack full parity between Tao and OpenTK. As I'm not an advanced in OpenGL programming, Sounds doable, but it’s a bit of a dance to understand what is happening.

If I'm not mistaken, there are 6 files currently utilizing Tao. If we can convert them to a more modern approach, such as using OpenTK, it could unlock significant possibilities for migrating the ComicRack codebase to .NET Core, but for now, I'm thinking this is won't be an easy process for now

maforget commented 5 months ago

I completely agree that we needed to update, but I have no experience with OpenGL also. I checked their website and wanted to do their Tutorial before doing any changes. I am also trying to understand all the number that affect the textures. The Memory usage is capped to either 256MB (Autotune) or 1024MB (when forcing with a command line switch). There are also a couple of other numbers that would need tweaking in TextureManagerSettings. I really wanted to read the documentation.

duckpuppy commented 5 months ago

I've been trying to get a chance to look at this project myself. I decompiled CR locally (along with the android app) myself during the pandemic to try to understand the networking code, but I'm not a .NET developer by any stretch so I didn't get as far as I'd like. What I have done, though, is video game programming as a PS2 dev back in the day and I might be able to work on the OpenGL changes. It's been a long time, but hopefully it'll come back to me. I can't promise how much time though.

On Sat, Jan 27, 2024, 5:12 PM maforget @.***> wrote:

I completely agree that we needed to update, but I have no experience with OpenGL also. I checked their website and wanted to do their Tutorial before doing any changes. I am also trying to understand all the number that affect the textures. The Memory usage is capped to either 256MB (Autotune) or 1024MB (when forcing with a command line switch). There are also a couple of other numbers that would need tweaking in TextureManagerSettings. I really wanted to read the documentation.

— Reply to this email directly, view it on GitHub https://github.com/maforget/ComicRackCE/issues/23#issuecomment-1913350672, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEWNP77TCCBAJFLR3Q7RLYQV3VRAVCNFSM6AAAAABCNOFMDKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTGM2TANRXGI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

maforget commented 5 months ago

I've started changing to the new library. I've just changed all the GL command to the corresponding one with the correct Enum, instead of just an int. Don't understand what it does and some of the actual code will need to be updated, because some command are deprecated. Still need to replace the Gdi and Wgl, but that might be for another day. Unless someone else wants to take care of it. Check this branch, if you have some update do a PR on that branch.

https://github.com/maforget/ComicRackCE/tree/OpenTK