Skip to content

Instantly share code, notes, and snippets.

View mkotsbak's full-sized avatar

Marius B. Kotsbak mkotsbak

  • Webstep A/S Trondheim
  • Trondheim, Norway
  • X @mkotsbak
View GitHub Profile
@densh
densh / Snake.scala
Last active December 19, 2021 05:05
Snake game in 200 lines of Scala Native and SDL2 as demoed during Scala Matsuri 2017
import scalanative.native._
import SDL._
import SDLExtra._
@extern
@link("SDL2")
object SDL {
type Window = CStruct0
type Renderer = CStruct0
import clang.cindex
import os, textwrap, StringIO
from clang.cindex import Config, Index, CursorKind
clib_scalanative_path = '/Users/timothyklim/Development/scala-native/clib/src/main/scala/scala/scalanative/libc'
scalatypes_map_dict = {
"int": "CInt"
}