Regardless of the platform, the libraries need to exist directly on the machine. For Linux, the equivalent library will need to be installed on the machine. I noticed that GLUT is included in the macOS platform libraries. Some commonly used libraries which handle these tasks are GLUT, SDL, SFML and GLFW. We could manually program our window and context, or we can use a pre-existing library that contains functions that can create a window and an OpenGL context for us. Chapter 2 of LearnOpenGL is a great source of background information and serves as inspiration for this tutorial. Some background information about OpenGL is strongly recommended for this tutorial, but not strictly required. (Note: Apple deprecated OpenGL in 2018 in favor of Metal, but we are using OpenGL 3.3, the version upon which all future versions of OpenGL are based macOS supports up to OpenGL 4.1.)įirst, we need to build a window and an OpenGL context. OpenGL appeared to be the most interesting to me, so we’ll experiment with it. There are several platform libraries to choose from. Platform libraries seem easy and straightforward to use, so let’s try it out. No additional action needs to be taken in order to utilize the platform libraries. In this way, the program is able to access the operating system services of the platform that it targets. Since the platform libraries are wrappers and bindings to the native libraries, any accesses to the platform libraries will be routed to where the actual implementation of the native library is located on the machine. This means that you can write a Kotlin program that uses any of the supported platform libraries. dll, etc.) should be installed on the machine.” That means the native libraries themselves (. … libs in the distribution are merely just wrappers and bindings to the native libraries. “The Kotlin/Native compiler automatically detects which of the platform libraries have been accessed and automatically links the needed libraries. Source: Kotlin/Native Interoperability How it Works Foundation … along with many other libraries and Apple frameworks. POSIX (available for all platforms except WebAssembly).The Kotlin/Native distribution includes “Platform Libraries”, which are a set of prebuilt libraries specific to each target.Ī few of the prebuilt libraries that come “out-of-the-box” when you download Kotlin/Native are: In this post, we’ll explore how well the Kotlin/Native compiler handles both pre-built and non-pre-built libraries. Look up the Advanced Kotlin course in our Course Schedule or we’re happy to answer any questions. You can learn more about Kotlin Multiplatform through Big Nerd Ranch’s Advanced Kotlin course. This topic requires a little more in-depth understanding of Android and iOS development and is beyond the scope of this blog series. Setting up an Android/iOS multi-platform app requires a different set of steps to set up. That’s because building an Android or iOS app requires more project files than a simple executable in order to run on a device. But you may have noticed that I only compiled functional executables for three platforms. In part 1 of this blog series, we looked at how one might compile Kotlin code for 8 different platforms using the Kotlin/Native compiler. Exploring Kotlin/Native – Part 2 – Interoperability
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |