See also surface mode information
[ `Fullscreen | `Windowed ]
val mode :
modeis the application's surface mode. The value of this signal is defined by the
~modeargument of the surface given to
Useri.App.init, the occurences of the event specified by
Useri.Surface.set_mode_setterand external events.
val set_mode_setter :
mode React.event -> unit
set_mode_setter meuses occurences of
meto set, if possible, the current surface's application mode and the value of
val mode_flip :
'a React.event -> mode React.event
mode_flip eis an event which occur whenever
edoes with the opposite mode of
val pp_mode :
Format.formatter -> mode -> unit
pp_mode ppf mprints an unspecified representation of
See also surface specification information
[ `Gl of Gl.t | `Other ]
val create :
?mode:mode -> unit -> t
create hidpi pos size kind anchor mode ()is a surface specification with:
true(default) tries to get a high-dpi surface.
pos, a hint to position the surface by using
posas the position of the top-left corner of the surface in its backend dependent display container. The coordinates of the top-left corner of the display container is
(0,0)and coordinate increase in from top to bottom and left to right.
size, the size of the surface in logical pixels. Consult the individual backend documentation for the default value.
kindis the kind of surface.
handleis a backend dependent surface handle. In certain backends allows to interface
Useriwith pre-existing surfaces.
modeis the the surface mode.
Note. Currently the
pos arguments are
specified The actual raster size of the surface is in the
Useri.Surface.raster_size signal. Note that future versions of this library
will switch to physical dimensions (lack of backend support is
the problem at the moment).
See also information about surface
properties updates in the
Warning. These values and functions are defined
Useri.App.init was called.
val pos :
posis the position of the top-left corner of the surface in the surface's backend dependent display container.
val raster_size :
raster_sizeis the application's surface underlying raster size.
val size :
sizeis the application's surface logical size.
val update :
unit -> unit
update ()updates the rendering surface. This has to be called for your drawing commands to be taken into account.
val handle :
unit -> Useri_base.Surface.handle
handle ()is the application's surface backend dependent handle.
These events are for coordinating rendering in an energy
efficient manner. See Input, animation and rendering coordination for more information.
val refresh :
refreshoccurs whenever the surface needs to be redrawn with the number of seconds since its last occurence or, for the first occurence, the number of seconds since the application start.
The exact occurence frequency is unspecified but generally it
should not exceed the hinted frequency of
More precisely the following occurences are guaranteed:
Useri.Surface.sizesignal changes value (including the first time during
Useri.Time.unitsignal is created or updates.
Useriguarantees that this event doesn't occur simultaneously with any of the events or signal it exposes.
val request_refresh :
unit -> unit
request_refresh ()has the effect of making
Useri.Surface.refreshoccur some time after it was called. This function call is cheap and can be abused (can be called in a React step).
Warning. This function may be removed from the API in
val set_refresher :
'a React.event -> unit
set_refresher ruses sets
rto be used to generate an occurence of
Useri.Surface.refreshsome time after each occurence of
val steady_refresh :
until:'a React.event -> unit
Useri.Surface.refreshoccur at the hinted frequency of
val refresh_hz :
refresh_hzis the maximal hinted frequency in hertz for
Useri.Surface.refreshoccurences. The initial value is
val set_refresh_hz :
int -> unit
set_refresh_hzsets the value of