Created
July 22, 2017 13:10
-
-
Save Groogy/5f89b6f40f8f86bfa4b8193904db2ce6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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