All Downloads are FREE. Search and download functionalities are using the official Maven repository.

linuxMain.korlibs.kgl.KmlGlNative.kt Maven / Gradle / Ivy

There is a newer version: 4.0.10
Show newest version
// WARNING: File autogenerated DO NOT modify
// https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h
@file:Suppress("unused", "RedundantUnitReturnType", "PropertyName")

package korlibs.kgl

import X11Embed.*
import korlibs.graphics.shader.gl.*
import korlibs.memory.dyn.*
import kotlinx.cinterop.*

typealias XVisualInfo = ULongVar // Only used as pointer
typealias GLXDrawable = COpaquePointer
typealias GLXContext = COpaquePointer
typealias KeySym = Int
typealias CString = CPointer
typealias CDisplayPointer = CPointer?

internal object GLLib : DynamicLibrary("libGLX.so.0") {
    val glXGetProcAddress by func<(name: CPointer) -> CPointer?>()
    val glXChooseVisual by func<(d: CDisplayPointer, scr: Int, ptr: CPointer?) -> CPointer?>()
    val glXGetCurrentDisplay by func<() -> CDisplayPointer>()
    val glXGetCurrentDrawable by func<() -> GLXDrawable>()
    val glXSwapBuffers by func<(d: CDisplayPointer, w: Window) -> Unit>()
    val glXMakeCurrent by func<(d: CDisplayPointer, w: Window, glc: GLXContext) -> Unit>()
    val glXCreateContext by func<(d: CDisplayPointer, vi: CPointer?, shareList: GLXContext?, direct: Int) -> GLXContext>()
}

internal actual fun glGetProcAddressAnyOrNull(name: String): COpaquePointer? = memScoped {
    GLLib.glXGetProcAddress(name.cstr.placeTo(this)) ?: GLLib.getSymbol(name)?.toCPointer()
}

actual class KmlGlNative actual constructor() : NativeBaseKmlGl() {
    override val variant: GLVariant get() = GLVariant.LINUX_DESKTOP
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy