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

linuxMain.korlibs.render.sdl2.Structs.kt Maven / Gradle / Ivy

There is a newer version: 4.0.10
Show newest version
package korlibs.render.sdl2

import kotlinx.cinterop.*

class SDL_DisplayMode {
    companion object {
        const val SIZE = 24
    }

    var format: Uint32 = 0
    var w: Int = 0
    var h: Int = 0
    var refresh_rate: Int = 0
    var driverdata: CPointer<*>? = null

    fun write(data: CPointer>) {
        val idata = data.reinterpret()
        format = idata[0]
        w = idata[1]
        h = idata[2]
        refresh_rate = idata[3]
        // driverdata = ??
    }
}

class SDL_Keysym {
    var scancode: Int = 0
    var sym: SDL_Keycode = 0
    var mod: Uint16 = 0 // offset: 8
    var unused: Uint32 = 0

    fun write(data: CPointer>) {
        val idata = data.reinterpret()
        val sdata = data.reinterpret()
        scancode = idata[0]
        sym = idata[1]
        mod = sdata[4]
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy