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/format.sml
ViewVC logotype

View of /trunk/sml3d/src/openal/format.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 879 - (download) (annotate)
Sat May 8 15:59:26 2010 UTC (8 years, 7 months ago) by jhr
File size: 656 byte(s)
  Working on OpenAL implementation
(* format.sml
 *
 * COPYRIGHT (c) 2010 John Reppy (http://cs.uchicago.edu/~jhr)
 * All rights reserved.
 *)

structure Format =
  struct
    local
      open ALTypes
      open ALConsts
    in

    type format = al_enum

    val MONO8 : format = AL_FORMAT_MONO8
    val MONO16 : format = AL_FORMAT_MONO16
    val STEREO8 : format = AL_FORMAT_STEREO8
    val STEREO16 : format = AL_FORMAT_STEREO16

  (* NOTE: relies on ordering of constant values! *)
    fun isMono fmt = (fmt <= MONO16)
    fun channels fmt = if (fmt <= MONO16) then 1 else 2
    fun bytesPerChannel fmt = if (fmt = MONO8) orelse (fmt = STEREO8) then 1 else 2

    end (* local *)
  end


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