Skip to content

Instantly share code, notes, and snippets.

@Groogy
Created July 22, 2017 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Groogy/5f89b6f40f8f86bfa4b8193904db2ce6 to your computer and use it in GitHub Desktop.
Save Groogy/5f89b6f40f8f86bfa4b8193904db2ce6 to your computer and use it in GitHub Desktop.
# Binding code
type Monitor = Void*
type Window = Void*
type Cursor = Void*
# My code
module Boleite
# Forward declaration
class RenderTarget
end
module Private
class GLFWSurface < RenderTarget
def initialize(@surface : LibGLFW3::Window)
end
def finalize()
unless @surface.null?
LibGLFW3.destroyWindow(@surface)
@surface = Pointer(Void).null # Will make @surface a union of LibGLFW3::Window | Pointer(Void)
@surface = LibGLFW3::Window.null # Doesn't work because null is not defined for the type Window.
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment