Home My Page Projects Code Snippets Project Openings 3D graphics for Standard ML
Summary Activity SCM

SCM Repository

[sml3d] View of /trunk/sml3d/src/openal/al-sig.sml
ViewVC logotype

View of /trunk/sml3d/src/openal/al-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 292 - (download) (annotate)
Tue Sep 30 07:54:18 2008 UTC (11 years ago) by jhr
File size: 2705 byte(s)
repository restructuring
(* al-sig.sml
 *
 * COPYRIGHT (c) 2008 John Reppy (http://www.cs.uchicago.edu/~jhr)
 * All rights reserved.
 *
 * An SML API for the OpenAL library (Version 1.1).  See openal.org for
 * documentation.
 *)

signature AL =
  sig

  (* scalars *)
    type byte = Int8.word
    type ubyte = Word8.word
    type short = Int16.int
    type ushort = Word16.word
    type float = FP.float
    type double = FP.double

  (* OenAL types *)
    eqtype source_id
    eqtype buffer_id

  (*
   * State retrieval
   *)
    val getVendorString : unit -> string
    val getRendererString : unit -> string
    val getVersionString : unit -> string
    val getExtensionsString : unit -> string
    val getExtensions : unit -> string list

  (*
   * Error support.
   * Obtain the most recent error generated in the AL state machine.
   *)
    eqtype error

    val NO_ERROR		: error
    val INVALID_NAME		: error
    val ILLEGAL_ENUM		: error
    val INVALID_ENUM		: error
    val INVALID_VALUE		: error
    val ILLEGAL_COMMAND		: error
    val INVALID_OPERATION	: error
    val OUT_OF_MEMORY		: error

    val getError : unit -> error

  (**
   * BUFFER
   * Buffer objects are storage space for sample data.
   * Buffers are referred to by Sources. One Buffer can be used
   * by multiple Sources.
   *)
    val genBuffer : unit -> buffer_id
    val genBuffers : unit -> buffer_id list
    val deleteBuffers : buffer_id list -> unit

  (* load 8-bit data into the buffer *)
    val bufferData8ubv : {id : buffer_id, mono : bool, data : Word8Vector.vector, freq : Word32.word} -> unit

  (* load 16-bit signed data, which is stored in a byte vector, into the buffer *)
    val bufferData16ubv : {id : buffer_id, mono : bool, data : Word8Vector.vector, freq : Word32.word} -> unit

  (* load 16-bit signed data into the buffer *)
    val bufferData16sv : {id : buffer_id, mono : bool, data : Int16Vector.vector, freq : Word32.word} -> unit

  (* Get Buffer parameters *)
    val getBufferFrequency : buffer_id -> Word32.word
    val getBufferBits : buffer_id -> Word32.word
    val getBufferChannels : buffer_id -> Word32.word
    val getBufferSize : buffer_id -> Word32.word

  (*
   * Global Parameters
   *)
    val dopplerFactor   : float -> unit
    val dopplerVelocity : float -> unit
    val speedOfSound    : float -> unit

  (* distance model *)
    eqtype distance_model
    val INVERSE_DISTANCE		: distance_model
    val INVERSE_DISTANCE_CLAMPED	: distance_model
    val LINEAR_DISTANCE			: distance_model
    val LINEAR_DISTANCE_CLAMPED		: distance_model
    val EXPONENT_DISTANCE		: distance_model
    val EXPONENT_DISTANCE_CLAMPED	: distance_model
    val distanceModel : distance_model option -> unit

  end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0