enablerbr's picture

OpenGL 3.x only version of OpenTK?

how would i go about sliming down OpenTK? so that all i had was Windows support and OpenGL 3.x support only. its great that OpenTK offers support for multi-platforms and all the other new features. yet i would simply like just a slim version that just offers what i want. is there a simple way for me to strip it down?


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

We plan to create a 3.2-specific profile for OpenGL in the future. This requires some changes to the binding generator (Source/Bind), to make it use the "deprecated" value from Bind/Specifications/GL2/gl.spec and to avoid writing any of the enums that come from VersionXYDeprecated in Bind/Specifications/GL2/enum.spec and Bind/Specifications/GL2/enumext.spec (where XY = 10, 11, 12, ...).

Removing non-windows platforms is slightly easier: OpenTK is quite modular so you can simply use #ifdef to remove everything under the "Platform/X11", "Platform/MacOS" and "Platform/Egl" directories. You will get a few compilation errors in OpenTK/Platform/Factory.cs, OpenTK/Platform/Utilities.cs and OpenTK/Configuration.cs, but these should be trivial to fix.

Neither of those features is a high priority right now, but I will accept patches that implement either (so you won't need to maintain a fork for all eternity). In any case, it might be a good idea to file feature requests so we can prioritize and implement them.

Of course, you could always follow the butcher's way and delete everything you don't need from the source tree and fix the compilation errors that arise.

Another choice is to use a static linker or obfuscator that allows static linking. There are tools that can remove compiled code you don't use and the dll size to the bare essentials. I haven't tested any with OpenTK, but they should work unless you hit some strange bug in the tools.

enablerbr's picture

thanks for the reply. seems a little complicated my for skill level.