[Resolved] Unable to use OpenGL directly

Hello,

I read that Kotlin Native allows you to use OpenGL directly, only when I import “platform.OpenGL.*” an error occurs, I based this example on https://github.com/JetBrains/kotlin-native/blob/master/samples/opengl/src/openglMain/kotlin/OpenGlTeapot.kt . I looked, but I didn’t get an answer that I could understand, if someone could just explain to me the steps to take to benefit from OpenGL I would be very grateful.

Have you initialized you openGL window and context properly ?

I have copied and pasted the code from the above example.
I even tried to follow the procedure with Graddle, but it didn’t work.

Have you tried to download whole sample from github and run it locally with gradle? (Pay attention to instructions if you are running on linux).

Also it would be nice if you can add some details about error you are experiencing.

I’m on Windows, and when I run this command: ./gradlew assemble, it throws errors in the console. So, right now I’m just trying to do it with the command-line compiler like this: kotlinc-native Source.kt -o Runnable and then I have an error for each reference entitled:

Source.kt:9:17: error: unresolved reference: GLUT
import platform.GLUT.*

platform.GLUT.* is available only on OSX.

On Windows you can try GitHub - Dominaezzz/kgl: Thin multiplatform wrappers for graphics.

Okay, thanks for the explanation.