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

com.huskerdev.grapl.gl.GLContext.kt Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package com.huskerdev.grapl.gl


abstract class GLContext(
    val handle: Long,
    val majorVersion: Int,
    val minorVersion: Int
) {
    companion object {
        @JvmStatic
        @JvmOverloads
        fun create(
            shareWith: GLContext,
            coreProfile: GLProfile = GLProfile.CORE,
            majorVersion: Int = -1,
            minorVersion: Int = -1,
        ) = create(shareWith.handle, coreProfile, majorVersion, minorVersion)

        @JvmStatic
        @JvmOverloads
        fun create(
            shareWith: Long = 0L,
            coreProfile: GLProfile = GLProfile.CORE,
            majorVersion: Int = -1,
            minorVersion: Int = -1,
        ) = GLPlatform.current.createContext(coreProfile, shareWith, majorVersion, minorVersion)

        @JvmStatic
        fun current() = GLPlatform.current.createFromCurrentContext()

        @JvmStatic
        fun clear() = GLPlatform.current.clearContext()
    }

    abstract fun makeCurrent(): Boolean
    abstract fun delete()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy