maforget/ComicRackCE

HW Accel

Opened this issue · 4 comments

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

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

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.

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