Module Graphv_gles2_native
This module is ready for use by user applications. It combines the Graphv_gles2_native_impl module with the Graphv_font_stb_truetype module to produce a new vector library.
module CreateFlags : sig ... endFlags for rendering quality.
module Cache : sig ... endval create : flags:CreateFlags.t -> unit -> tCreates a new renderer. Make sure the OpenGL context that is being used supports the stencil buffer.
module Align : sig ... endText alignment flags.
module BlendFactor : sig ... endBlending modes used for compositing. The current blend mode determines how a fill or stroke is composited to the current framebuffer. See here for more information on the different blending modes.
module Bounds : sig ... endmodule Buffer : sig ... endThis module exposes the native platforms buffer. Can be used for copy-free interop.
module Color : sig ... endOperations on colors.
module CompositeOperation : sig ... endmodule CompositeOperationState : sig ... endmodule ImageFlags : sig ... endmodule LineCap : sig ... endmodule LineJoin : sig ... endmodule Matrix : sig ... endA module for basic 2x2 (+2) matrix operations.
module Winding : sig ... endmodule FloatOps : sig ... endA module for swapping the default integer operators with floating point operators.
val save : t -> unitSaves all context state to be restored later. Must have a corresponding
restorecall in order to be correct. Saves and restores happen in LIFO (stack) order.
val restore : t -> unitRestore a previously saved state. Must have a previous
savecall in order to be correct. Saves and restores happen in LIFO (stack) order.
val reset : t -> unitReset the current state to default settings. Only affects the current state, not an previously saved states. Does not clear any saved states.
val set_device_pixel_ratio : t -> float -> unitval set_shape_antialias : t -> enabled:bool -> unitval set_miter_limit : t -> limit:float -> unitval set_stroke_width : t -> width:float -> unitval set_line_cap : t -> cap:LineCap.t -> unitval set_line_join : t -> join:LineJoin.t -> unitval begin_frame : t -> width:float -> height:float -> device_ratio:float -> unitStart a fresh frame. Resets all state.
- parameter width
The width of the viewport area.
- parameter height
The height of the viewport area.
- parameter device_ratio
The scaling factor for the render. Also known as the Device Pixel Ratio. Use this to get pixel-perfect rendering on high-resolution displays.
val cancel_frame : t -> unitCancels a built up frame. Should call
begin_frameto start a new render.
val end_frame : t -> unitFlush and render the frame to the screen. Nothing is drawn until this method is called. Alternatively can call
cancel_frameto not render the build up frame.
module Transform : sig ... endmodule Scissor : sig ... endmodule Global : sig ... endval fill : t -> unitFill the last created path. You can call both stroke and fill for a given path. The path is not cleared until
Path.begin_is called again.
val stroke : t -> unitStroke the last created path. You can call both stroke and fill for a given path. The path is not cleared until
Path.begin_is called again
module Path : sig ... endDraw shapes.
module Image : sig ... endmodule Paint : sig ... endCreate various fill and stroke effects.
val set_fill_color : t -> color:Color.t -> unitval set_fill_paint : t -> paint:Paint.t -> unitval set_stroke_color : t -> color:Color.t -> unitval set_stroke_paint : t -> paint:Paint.t -> unit
module Text : sig ... endModule for text rendering. Text is rendered using a glyph bitmap. The default bitmap size is 2048x2048. It is possible to run out of space in this bitmap so try to be conservative with font sizes and number of fonts. Glyphs are grouped by font, size, and blur. A glyph will be rendered once per combination of properties.