Kotlin OpenGL using FreeGLUT and FreeType2

Submitted by Dickens A S on Thu, 11/21/2019 - 14:50

Kickstart Kotlin OpenGL GLSL using GLEW, FreeGLUT and FreeType2 using below github code

Output 640x480 window with GLUT

FreeGLUT and FreeType2

Download MSYS2

This is required for windows to download pre-compiled libraries and its headers

Kotlin Vulkan Triangle using GLFW for Windows - Single file

Submitted by Dickens A S on Tue, 11/19/2019 - 12:46

Kotlin Vulkan Triangle using below github code

writing code in vulcan is a vast typing.

it has so many pipelines involed to make a simple code to work.

to bring it in a single file will make a developer get confidence and kick start his work in vulkan.

This explains how to do it.

Important Note:

Kotlin Vulkan Initialize

Submitted by Dickens A S on Fri, 11/15/2019 - 13:27

Kickstart Kotlin Vulkan using below github code

Install MSYS2

This is required for windows to download pre-compiled libraries and its headers

pacman -S mingw-w64-x86_64-vulkan-loader mingw-w64-i686-vulkan-loader mingw-w64-i686-vulkan-headers mingw-w64-x86_64-vulkan-headers

Note: libvulkan-1.dll should be copied to the exe folder to make the windows app work

Kotlin Native Def File

Kotlin OpenGL GLSL using GLEW and GLFW

Submitted by Dickens A S on Mon, 11/11/2019 - 19:08

Kickstart Kotlin OpenGL GLSL using GLEW and GLFW using below github code

C code vs kotlin code analysis

OpenGL C Code

Kotlin Code

GLuint vao;
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);

 

Cucumber browser automation with Kotlin

Submitted by Dickens A S on Wed, 11/06/2019 - 15:45

Kick start browser automation in cucumber using kotlin

System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir")+"\\driver\\chromedriver.exe")
driver = ChromeDriver()

Given("I am on the Google search page") {
   driver.get("https:\\www.google.com")
}

GitHub https://github.com/dickensas/kotlin-gradle-templates/tree/master/cucumber

Use the above to do a google search using Selenium WebDriver and Gherkin feature

KotlinX HTML with coroutines

Submitted by Dickens A S on Mon, 11/04/2019 - 16:10

use KotlinX with coroutines to create a delay in HTML rendering

var detectDiv = GlobalScope.launch {
	delay(2000L) //wait for 2 second browser ready hack
	val myDiv = document.create.div {
		p { +"some text " }
		div { +"my div tag" }
	}

	var root = document.getElementById("root")
	root?.append(myDiv)
}

Source Code

End Of Article

Kickstart Kotlin Web Assembly with Spring Boot

Submitted by Dickens A S on Sun, 11/03/2019 - 13:22

Easily create Kotlin Web Assembly project from these multiplatform boilerplate Gradle DSL

Kotlin Code

package wasm

fun main() {
    println("Hello World!")
}

JavaScript Code

No need to write JavaScript code simply put this HTML

<script src="build/bin/wasm/releaseExecutable/sboot_wasm.wasm.js" wasm="build/bin/wasm/releaseExecutable/sboot_wasm.wasm"> </script>

Run gradle command

  gradle assemble

Run gradle command

Spring Boot with Additional MIME Content Type

Submitted by Dickens A S on Sun, 11/03/2019 - 09:35

Spring boot provides default list of MIME content types from the below class

impot org.springframework.boot.web.server.MimeMappings;

Additional content types can be added using below example code for WebAssembly content type