Skip to content

Instantly share code, notes, and snippets.

@floringogianu
Created October 10, 2016 12:08
Show Gist options
  • Save floringogianu/1a5eaa0e56e6bf70079f18039ce71004 to your computer and use it in GitHub Desktop.
Save floringogianu/1a5eaa0e56e6bf70079f18039ce71004 to your computer and use it in GitHub Desktop.
# This should work with xitari (the c++ Arcade Learning Environment fork) too.
# Define a type for the c struct pointer
type DoomGame end
# Load the shared object. This needs to expose c functions (see "extern C")
newGame = ccall( (:vizdoom_new, "libvizdoom"), Ptr{DoomGame}, ())
# Load a configuration file.
hasLoaded = ccall( (:vizdoom_loadConfig, "libvizdoom"), Bool, (Ptr{DoomGame},Cstring), newGame, "../../examples/config/basic.cfg")
# Initialize the game. The GUI should pop up.
ccall( (:vizdoom_init, "libvizdoom"), Void, (Ptr{DoomGame},), newGame)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment