package sfml

  1. Overview
  2. Docs
Bindings to the SFML multimedia library

Install

Dune Dependency

Authors

Maintainers

Sources

ocaml-sfml-0.09.2.tar.gz
sha256=ce1e50dec69a4495232261627a359a8fb54d79788147380bee78b0983f8b6951
md5=9ae99bb47bb68d5181d01b7bbc78a351

doc/sfml.graphics/SFBlendMode/index.html

Module SFBlendMode

type factor =
  1. | Zero
    (*

    (0, 0, 0, 0)

    *)
  2. | One
    (*

    (1, 1, 1, 1)

    *)
  3. | SrcColor
    (*

    (src.r, src.g, src.b, src.a)

    *)
  4. | OneMinusSrcColor
    (*

    (1, 1, 1, 1) - (src.r, src.g, src.b, src.a)

    *)
  5. | DstColor
    (*

    (dst.r, dst.g, dst.b, dst.a)

    *)
  6. | OneMinusDstColor
    (*

    (1, 1, 1, 1) - (dst.r, dst.g, dst.b, dst.a)

    *)
  7. | SrcAlpha
    (*

    (src.a, src.a, src.a, src.a)

    *)
  8. | OneMinusSrcAlpha
    (*

    (1, 1, 1, 1) - (src.a, src.a, src.a, src.a)

    *)
  9. | DstAlpha
    (*

    (dst.a, dst.a, dst.a, dst.a)

    *)
  10. | OneMinusDstAlpha
    (*

    (1 1, 1, 1) - (dst.a, dst.a, dst.a, dst.a)

    *)

Enumeration of the blending factors

The factors are mapped directly to their OpenGL equivalents, specified by glBlendFunc() or glBlendFuncSeparate().

type equation =
  1. | Add
    (*

    Pixel = Src * SrcFactor + Dst * DstFactor

    *)
  2. | Subtract
    (*

    Pixel = Src * SrcFactor - Dst * DstFactor

    *)
  3. | ReverseSubtract
    (*

    Pixel = Dst * DstFactor - Src * SrcFactor

    *)

Enumeration of the blending equations

The equations are mapped directly to their OpenGL equivalents, specified by glBlendEquation() or glBlendEquationSeparate().

type t = {
  1. color_src_factor : factor;
    (*

    Source blending factor for the color channels

    *)
  2. color_dst_factor : factor;
    (*

    Destination blending factor for the color channels

    *)
  3. color_equation : equation;
    (*

    Blending equation for the color channels

    *)
  4. alpha_src_factor : factor;
    (*

    Source blending factor for the alpha channel

    *)
  5. alpha_dst_factor : factor;
    (*

    Destination blending factor for the alpha channel

    *)
  6. alpha_equation : equation;
    (*

    Blending equation for the alpha channel

    *)
}

Blending modes for drawing

val make : ?equation:equation -> factor -> factor -> t

Construct the blend mode given the factors and equation.

This constructor uses the same factors and equation for both color and alpha components. It also defaults to the Add equation.

val alpha : t

Commonly used blending modes

Blend source and dest according to dest alpha

val add : t

Blend source and dest according to dest alpha

Add source to dest

val multiply : t

Add source to dest

Multiply source and dest

val none : t

Multiply source and dest

Overwrite dest with source

OCaml

Innovation. Community. Security.