sig
type pointer
type keycode =
AlphaNum of char
| NumPad of int
| FKey of int
| KeyEscape
| KeyLControl
| KeyLShift
| KeyLAlt
| KeyLSystem
| KeyRControl
| KeyRShift
| KeyRAlt
| KeyRSystem
| KeyMenu
| KeyLBracket
| KeyRBracket
| KeySemiColon
| KeyComma
| KeyPeriod
| KeyQuote
| KeySlash
| KeyBackSlash
| KeyTilde
| KeyEqual
| KeyDash
| KeySpace
| KeyReturn
| KeyBack
| KeyTab
| KeyPageUp
| KeyPageDown
| KeyEnd
| KeyHome
| KeyInsert
| KeyDelete
| KeyAdd
| KeySubtract
| KeyMultiply
| KeyDivide
| KeyLeft
| KeyRight
| KeyUp
| KeyDown
| KeyPause
type mouseButton =
ButtonLeft
| ButtonRight
| ButtonMiddle
| ButtonX1
| ButtonX2
type joyAxis =
JoyAxisX
| JoyAxisY
| JoyAxisZ
| JoyAxisR
| JoyAxisU
| JoyAxisV
| JoyAxisPOV
type eventType =
EvtClosed
| EvtResized
| EvtLostFocus
| EvtGainedFocus
| EvtTextEntered
| EvtKeyPressed
| EvtKeyReleased
| EvtMouseWheelMoved
| EvtMouseButtonPressed
| EvtMouseButtonReleased
| EvtMouseMoved
| EvtJoyButtonPressed
| EvtJoyButtonReleased
| EvtJoyMoved
type event =
KeyEvent of Sfml.eventType * Sfml.keycode * bool * bool * bool
| TextEvent of Sfml.eventType * int
| MouseMoveEvent of Sfml.eventType * int * int
| MouseButtonEvent of Sfml.eventType * Sfml.mouseButton
| MouseWheelEvent of Sfml.eventType * int
| JoyMoveEvent of Sfml.eventType * int * Sfml.joyAxis * float
| JoyButtonEvent of Sfml.eventType * int * int
| SizeEvent of Sfml.eventType * int * int
| Other of Sfml.eventType
| NullEvent
class input :
Sfml.pointer ->
object
method getJoystickAxis : int -> Sfml.joyAxis -> float
method getMouseX : int
method getMouseY : int
method isJoystickButtonDown : int -> int -> bool
method isKeyDown : Sfml.keycode -> bool
method isMouseButtonDown : Sfml.mouseButton -> bool
end
type videoMode = {
screenWidth : int;
screenHeight : int;
bitsPerPixel : int;
}
external getDesktopVideoMode : unit -> Sfml.videoMode
= "getDesktopVideoMode"
external getVideoModesCount : unit -> int = "getVideoModesCount"
external getVideoMode : int -> Sfml.videoMode = "getVideoMode"
external isVideoModeValid : Sfml.videoMode -> bool = "isVideoModeValid"
val videoModeFrom : int -> int -> int -> Sfml.videoMode
type windowStyle =
NoTitleBar
| FixedBar
| Resize
| FixedBarClose
| ResizeClose
| Fullscreen
class virtual abstractWindow :
unit ->
object
val virtual point : Sfml.pointer
method close : unit
method display : unit
method enableKeyRepeat : bool -> unit
method getEvent : Sfml.event
method getFrameTime : int
method getHeight : int
method getInput : Sfml.input
method getWidth : int
method isOpened : bool
method setActive : bool -> unit
method setCursorPosition : int -> int -> unit
method setFramerateLimit : int -> unit
method setJoystickThreshold : float -> unit
method setPosition : int -> int -> unit
method show : bool -> unit
method showMouseCursor : bool -> unit
method useVerticalSync : bool -> unit
end
class window :
Sfml.videoMode * string * Sfml.windowStyle ->
object
val point : Sfml.pointer
method close : unit
method display : unit
method enableKeyRepeat : bool -> unit
method getEvent : event
method getFrameTime : int
method getHeight : int
method getInput : input
method getWidth : int
method isOpened : bool
method setActive : bool -> unit
method setCursorPosition : int -> int -> unit
method setFramerateLimit : int -> unit
method setJoystickThreshold : float -> unit
method setPosition : int -> int -> unit
method show : bool -> unit
method showMouseCursor : bool -> unit
method useVerticalSync : bool -> unit
end
type color = { v_r : int; v_g : int; v_b : int; v_a : int; }
val color_add : Sfml.color -> Sfml.color -> Sfml.color
val color_modulate : Sfml.color -> Sfml.color -> Sfml.color
val color_fromRGBA : int -> int -> int -> int -> Sfml.color
val color_fromRGB : int -> int -> int -> Sfml.color
val black : Sfml.color
val white : Sfml.color
val red : Sfml.color
val green : Sfml.color
val blue : Sfml.color
val yellow : Sfml.color
val mangenta : Sfml.color
val cyan : Sfml.color
type blendMode = BlendAlpha | BlendAdd | BlendMultiply | BlendNone
type font
external font_create : unit -> Sfml.font = "c_font_create"
external font_createfromfile : string -> int -> Sfml.font
= "c_font_createfromfile"
val default_font : Sfml.font
type image_path =
EmptyImage
| File of string
| Color of (Sfml.color * int * int)
| PixelTab of (int array * int * int)
| PointerData of Sfml.pointer
class image :
Sfml.image_path ->
object
method bind : unit
method createMaskFromColor : Sfml.color -> int -> unit
method getHeight : int
method getPixel : int -> int -> Sfml.color
method getPixelTab : int array
method getPoint : Sfml.pointer
method getWidth : int
method isSmooth : bool
method resize : int -> int -> Sfml.color -> unit
method saveToFile : string -> bool
method setPixel : int -> int -> Sfml.color -> unit
method setSmooth : bool -> unit
end
type floatRect = {
fLeft : float;
fTop : float;
fRight : float;
fBottom : float;
}
type intRect = { iLeft : int; iTop : int; iRight : int; iBottom : int; }
val floatRect_offset : Sfml.floatRect -> float -> float -> Sfml.floatRect
val intRect_offset : Sfml.intRect -> int -> int -> Sfml.intRect
val floatRect_contains : Sfml.floatRect -> float -> float -> bool
val intRect_contains : Sfml.intRect -> int -> int -> bool
external intRect_insersects : Sfml.intRect -> Sfml.intRect -> bool
= "intRect_intersects"
external floatRect_insersects : Sfml.floatRect -> Sfml.floatRect -> bool
= "floatRect_intersects"
class virtual drawable :
unit ->
object
val virtual point : Sfml.pointer
method getBlendMode : Sfml.blendMode
method getCenterX : float
method getCenterY : float
method getColor : Sfml.color
method getPoint : Sfml.pointer
method getRotation : float
method getScaleX : float
method getScaleY : float
method getX : float
method getY : float
method move : float -> float -> unit
method rotate : float -> unit
method scale : float -> float -> unit
method setBlendmode : Sfml.blendMode -> unit
method setCenter : float -> float -> unit
method setColor : Sfml.color -> unit
method setPosition : float -> float -> unit
method setRotation : float -> unit
method setScale : float -> float -> unit
method setScaleX : float -> unit
method setScaleY : float -> unit
method setX : float -> unit
method setY : float -> unit
end
class sprite :
unit ->
object
val point : Sfml.pointer
method flipX : bool -> unit
method flipY : bool -> unit
method getBlendMode : blendMode
method getCenterX : float
method getCenterY : float
method getColor : color
method getHeight : float
method getImage : Sfml.image
method getPixel : int -> int -> Sfml.color
method getPoint : pointer
method getRotation : float
method getScaleX : float
method getScaleY : float
method getSubRect : Sfml.intRect
method getWidth : float
method getX : float
method getY : float
method move : float -> float -> unit
method resize : float -> float -> unit
method rotate : float -> unit
method scale : float -> float -> unit
method setBlendmode : blendMode -> unit
method setCenter : float -> float -> unit
method setColor : color -> unit
method setImage : Sfml.image -> unit
method setPosition : float -> float -> unit
method setRotation : float -> unit
method setScale : float -> float -> unit
method setScaleX : float -> unit
method setScaleY : float -> unit
method setSubRect : Sfml.intRect -> unit
method setX : float -> unit
method setY : float -> unit
end
type stringStyle = { bold : bool; italic : bool; underlined : bool; }
class sfString :
unit ->
object
val point : Sfml.pointer
method getBlendMode : blendMode
method getCenterX : float
method getCenterY : float
method getColor : color
method getFont : Sfml.font
method getPoint : pointer
method getRect : Sfml.floatRect
method getRotation : float
method getScaleX : float
method getScaleY : float
method getSize : float
method getStyle : Sfml.stringStyle
method getText : string
method getX : float
method getY : float
method move : float -> float -> unit
method rotate : float -> unit
method scale : float -> float -> unit
method setBlendmode : blendMode -> unit
method setCenter : float -> float -> unit
method setColor : color -> unit
method setFont : Sfml.font -> unit
method setPosition : float -> float -> unit
method setRotation : float -> unit
method setScale : float -> float -> unit
method setScaleX : float -> unit
method setScaleY : float -> unit
method setSize : float -> unit
method setStyle : Sfml.stringStyle -> unit
method setText : string -> unit
method setX : float -> unit
method setY : float -> unit
end
class view :
Sfml.floatRect ->
object
method getCenterX : float
method getCenterY : float
method getHalfSizeX : float
method getHalfSizeY : float
method getPoint : Sfml.pointer
method getRect : Sfml.floatRect
method move : float -> float -> unit
method setCenter : float -> float -> unit
method setFromRect : Sfml.floatRect -> unit
method setHalfSize : float -> float -> unit
method zoom : float -> unit
end
class renderWindow :
Sfml.videoMode * string * Sfml.windowStyle ->
object
val point : Sfml.pointer
method capture : Sfml.image
method close : unit
method convertCoords : int -> int -> float * float
method display : unit
method drawSprite : Sfml.sprite -> unit
method drawString : Sfml.sfString -> unit
method enableKeyRepeat : bool -> unit
method getDefaultView : Sfml.view
method getEvent : event
method getFrameTime : int
method getHeight : int
method getInput : input
method getView : Sfml.view
method getWidth : int
method isOpened : bool
method preserveOpenGLStates : bool -> unit
method setActive : bool -> unit
method setBackgroundColor : Sfml.color -> unit
method setCursorPosition : int -> int -> unit
method setFramerateLimit : int -> unit
method setJoystickThreshold : float -> unit
method setPosition : int -> int -> unit
method setView : Sfml.view -> unit
method show : bool -> unit
method showMouseCursor : bool -> unit
method useVerticalSync : bool -> unit
end
class clock :
unit ->
object
val point : Sfml.pointer
method getElapsedTime : float
method reset : unit
end
external sleep : float -> unit = "clock_sleep"
class randomizer :
unit ->
object
val point : Sfml.pointer
method getFloat : float -> float -> float
method getInt : int -> int -> int
method getSeed : int
method setSeed : int -> unit
end
end