Search code examples
javawindowsmacoscross-platformlwjgl

Can a game made with Windows natives be played on Mac?


If I were to make a videogame with LWJGL and Windows natives, could this be exported and run correctly on a Mac? If not, how can it be made to? I have gone through many websites, hoping to find an answer, but I can't tell if my problem is too specific or the question just has too many words. Thanks in advance!


Solution

  • While Java code is platform independent, natives only work for the platform you compile them for. This is the reason why there are different natives for Windows, Mac and Linux - otherwise you would only need a single type of natives. Natives compiled for Windows are generally not runnable on Mac.

    In order to save storage, you can just put the native files of the platform you want the program to run on in the natives folder. However, if you want the program to run on any platform out of the box, just put all the natives for all platforms into the natives folder - LWJGL will automatically choose the correct ones at run time.