BlueMonkMN's picture

Multi-platform binary?

I notice that all platforms are compiled right into the same binary. Does this imply that you can take the same compiled "binary" (CLR) image and use it on various platforms? Or does it still need to be compiled for the various environments. This question just arose in my mind as I was trying to see if my local copy of all the OpenTK code could be compiled with a subset of the full code. It doesn't look like I can exclude the X11 stuff without changing code.


Comments

Comment viewing options

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

Well, I've been using the same pre-compiled DLL of 0.9.0 included in the download archive under both Windows and Linux without issue so I can only assume it's fine on both without a specific recompile.

the Fiddler's picture

Yeah, the same dll runs everywhere. You cannot exclude specific platforms from the library (there's little need, since the platform specific code is a few KB, whereas OpenGL weights more than 1MB).

If you need to reduce size (I cannot think any other reason to exclue e.g. X11 code), there are tools that can "merge" OpenTK.dll with your executable and strip unecessary code (this should reduce size *tremendously*).

If you don't wish to support a specific platform, check the OpenTK.Configuration.RunningOn* properties (SVN only) and throw an exception. However you should consider allowing the code to run on unknown platforms anyway, but make clear that these are unsupported configurations.

BlueMonkMN's picture

Mostly it was just a curiosity question. I have no real need to exclude platforms/code. I just want to understand the architecture. Thanks for the reply. I have been considering merging OpenTK code with my own project instead of linking them as separate modules, but haven't come to a decision on that yet. I assume I would have to make mention of it in the license/credits of SGDK2 if I linked it into SGDK2 code.

One nice thing about having it remain external is that people can then upgrade OpenTK without an upgrade of SGDK2 if they want their SGDK2 projects to take advantage of some new feature.