bogue
Library
Module
Module type
Parameter
Class
Class type
Dependency graph
val exit_on_escape : int * int * ( board -> unit )
val create :
?shortcuts:shortcuts ->
?connections:Widget.connection list ->
?on_user_event:( Tsdl.Sdl.event -> unit ) ->
Window.t list ->
board
Create a board
from a list of layouts and connections. The list of connections can be empty, because connections can be added afterwards. Each Layout in the list will open as a new window.
val of_windows :
?shortcuts:shortcuts ->
?connections:Widget.connection list ->
?on_user_event:( Tsdl.Sdl.event -> unit ) ->
Window.t list ->
board
Synonym for create
.
val of_layouts :
?shortcuts:shortcuts ->
?connections:Widget.connection list ->
?on_user_event:( Tsdl.Sdl.event -> unit ) ->
Layout.t list ->
board
Similar to create
. Each layout in the list will be displayed in a different window.
val of_layout :
?shortcuts:shortcuts ->
?connections:Widget.connection list ->
?on_user_event:( Tsdl.Sdl.event -> unit ) ->
Layout.t ->
board
Similar to of_layout
but with only one layout.
val make :
?shortcuts:shortcuts ->
Widget.connection list ->
Layout.t list ->
board
val run :
?before_display:( unit -> unit ) ->
?after_display:( unit -> unit ) ->
board ->
unit
Creating global keyboard shortcuts
type shortcut_action = board -> unit
val shortcuts_empty : unit -> shortcuts
val shortcuts_add :
shortcuts ->
?keymod:Tsdl.Sdl.keymod ->
int ->
shortcut_action ->
shortcuts
val shortcuts_add_ctrl : shortcuts -> int -> shortcut_action -> shortcuts
val shortcuts_add_ctrl_shift : shortcuts -> int -> shortcut_action -> shortcuts
val shortcuts_of_list : (int * int * shortcut_action) list -> shortcuts
List of (SDL keycode, SDL keymod, action)
Using Bogue together with another graphics loop
See the embed
example.
val make_sdl_windows : ?windows:Tsdl.Sdl.window list -> board -> unit
This is only useful if you have your own graphics loop, and do not use run
. This function creates an SDL window for each top layout in the board. One can use predefined windows with the optional argument windows
. They will be used by the layouts in the order they appear in the list. If there are fewer windows than layouts, new windows are created. If there are more, the excess is disregarded.
val refresh_custom_windows : board -> unit
Ask the GUI to refresh (ie. repaint) the custom windows (those that were not created by Bogue itself).
val one_step :
?before_display:( unit -> unit ) ->
bool ->
(( unit -> unit ) * ( unit -> unit )) ->
?clear:bool ->
board ->
bool
This is only useful if you have your own graphics loop, and do not use run
. Calling one_step ~before_display anim (start_fps, fps) ~clear board
is what is executed at each step of the Bogue mainloop. If anim=true
this step is non blocking; this is what you want if either Bogue or your loop has an animation running. If anim=false
then the function will wait until an event is received.