Dominaezzz / kgl

Thin multiplatform wrappers for graphics.
Apache License 2.0
106 stars 14 forks source link

Input struct pNext DSL #29

Closed Dominaezzz closed 4 years ago

Dominaezzz commented 4 years ago

The generator now generates addition DSL methods for pNext extensions for input structs.

Instance.create(layers, extensions) {
    applicationInfo {
        applicationName = "Test"
        applicationVersion = VkVersion(1U, 1U, 0U)
        engineName = "No engine!"
        engineVersion = VkVersion(1U, 0U, 0U)
        apiVersion = VkVersion(1u, 0u, 0u)
    }

    // pNext !!!!
    next {
        ValidationFlagsEXT(listOf(ValidationCheckEXT.ALL_EXT, ValidationCheckEXT.SHADERS_EXT))

        DebugReportCallbackCreateInfoEXT {
            flags = DebugReportEXT.WARNING_BIT_EXT or DebugReportEXT.ERROR_BIT_EXT
            callback { _, _, _, _, _, _, message ->
                println("Debug Message: $message")
            }
        }

        DebugUtilsMessengerCreateInfoEXT {
            messageType = DebugUtilsMessageTypeEXT.GENERAL
            messageSeverity = DebugUtilsMessageSeverityEXT.ERROR

            userCallback { messageSeverity, messageTypes, callbackData ->
                println("$messageSeverity $messageTypes $callbackData")
            }
        }
    }
}

Closes #10