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

SCM Repository

[sml3d] View of /trunk/sml3d/README
ViewVC logotype

View of /trunk/sml3d/README

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1237 - (download) (annotate)
Thu Sep 22 21:24:47 2011 UTC (7 years, 9 months ago) by pavelk
File size: 6698 byte(s)
Fixed readme to reflect bug fix in SMLNJ 110.73

  A suite of libraries to support real-time 3D programming in SML using OpenGL.


  The SML3d Library currently only supports the MLton implementation of SML
  (both 32-bit and 64-bit versions).  Furthermore, it requires a version of
  MLton that is at least as recent as the r7407 svn revision (2010-01-22).
  For instructions on getting MLton, visit http://mlton.org.

  After unpacking, run the configure script and then make.  You can then
  try out some of the example programs.

  The process is a bit more complicated if you are installing sml3d from
  the SVN repository.  See the instructions below for details.


  Depending on which components of the SML3D library you are using, you
  will need to pass additional flags and (possibly) additional object files
  to the mlton command line.  We have packaged up this behavior in a shell
  script (bin/config-cmd.sh).  Thus, you can invoke mlton as follows

	MLTONFLAGS=`config-sml3d.sh components`

	EXTRAOBJS=`config-sml3d.sh objs components`

	mlton $MLTONFLAGS project.mlb $EXTRAOBJS

  where "project.mlb" is your project's MLB file.  Note that we use the
  config-sml3d.sh command twice: once to generate the command-line options
  and once to get the list of extra object files.  The "components" argument
  to the script specifies which components your project is using.  The values

	no-opengl	Do not use OpenGL support (incompatable with the glut
	glut		Use the GLUT library
	sdl		Use SDL (incompatable with the glut option).
	sdl-ttf		Use the SDL True-type font library (implies sdl
	sdl-image	Use the SDL True-type font library (implies sdl
	sdl-mixer	Use the SDL audio mixer library (implies sdl
	openal		Use the OpenAL library (incompatable with sdl-mixer).
	image-io	Use the SML3D image library, which requires additional
			C object files and libraries.
	opencl		Use the OpenCL library.
	movie		Use support for encoding movies from the OpenGL
			frame buffer

  If you use GNU make to build your project, you may want to include the
  mk/config.gmk file in your makefile.  Define the SML3D_CONFIG_OPTIONS make
  variable to the components that you are using and use the MLTON_FLAGS
  variable as an argument to the mlton command.


  The sml3d library has been ported to work on Windows XP and Windows
  Vista using the MinGW/MSys installation that comes with the MLton
  MSI files (http://mlton.org/Experimental).  When using the GLUT library
  on Windows, you need to make sure that Windows can find the GLUT DLL.
  If your sml3d tree is in


  then add


  to your PATH variable.

  - MLton's default install location is in C:\Program Files. Since most UNIX
    (and SML) tools don't play nice with spaces in directory names, a lot of
    headaches will be avoided if MLton is installed somewhere that doesn't 
    contain spaces in the path.
  - MLton's version, along with others, of MinGW does not come with autotools
    preinstalled. Since the autotools are only used to generate the configure
    script, you can run this from a UNIX distribution and ship the configure
    script over to windows, or you can use Cygwin. Or, if you've somehow gotten
    autotools to work under MinGW, you can probably just use them. =)
  - MLton's MinGW doesn't come with a preinstalled 'cc' program, although it 
    does come with gcc. Hence, when you run './configure', make sure to pass the
    argument that sets the CC variable properly. The easiest way to do this
    is './configure CC=`which gcc`'.
  - Up to SML/NJ 110.72, there is a bug when running CM.make under windows.
    Some of the commands are passed to the shell incorrectly. You can run the 
    commands yourself from the MS-DOS command line:
     Every time you see something like this:
      ["C:\SMLNJ\bin\ml-ulex"  "gl-spec.lex"]
      'C:\SMLNJ\bin\ml-ulex"  "gl-spec.lex' is not recognized as an internal or 
      external command, operable program or batch file.
      sources.cm:19.5-19.16 Error: tool "MLULex" failed: "C:\SMLNJ\bin\ml-ulex"
     From the command line, run something like this:
      C:\Path\To\sml3d\gen\gen-gl-glue> C:\SMLNJ\bin\ml-ulex gl-spec.lex
     Then perform the SML commands again.


  The SML3d library assumes that your system has OpenGL 2.1 available.
  It can be configured to use other libraries:

	GLUT		Available with most OpenGL systems.  An alternative
			is available from http://freeglut.sourceforge.net.
			For Windows systems (using MinGW), we have included
			GLUT support in the SML3d distribution.
	SDL		http://www.libsdl.org
	SDL_image	http://www.libsdl.org/projects/SDL_image
	SDL_ttf		http://www.libsdl.org/projects/SDL_ttf
	SDL_mixer	http://www.libsdl.org/projects/SDL_mixer
	OpenAL		http://openal.org
	libpng		http://www.libpng.org/pub/png/
	libtiff		http://www.libtiff.org/
	mencoder	http://www.mplayerhq.hu/


	    common	- SML code for vectors, matrices, etc.
	    opengl	- SML interfaces to the GL and GLU libraries
	    util	- various utility modules
	  glut		- SML interface to the GLUT library
	  gui		- A simple, GLUT-based, GUI library
	  image-io	- image I/O support
	  loaders	- loaders for some 3D file formats
	  openal	- SML interfaces to OpenAL
	  movie		- A library for generating movies from an application by sending
			  raw frames through mencoder
	  particles	- A library for particle effects.
	  sdl		- SML interfaces to SDL and related libraries
	  tests		- test programs
	examples/	- some example programs
	gen/		- code to generate the FFI glue code for OpenGL.
	windows/	- extra support files for Windows systems (requires


  If you have downloaded the sml3d sources from svn, then there are a few
  extra steps required to build the system.

	1) generating glue code.  The FFI glue code is generated from
	   an XML description.  To build the glue code, you will need a
	   recent version of SML/NJ (110.68+).  Then execute the following

		% cd gen/gen-gl-glue
		% sml
		- CM.make "sources.cm";
		- Gen.default ();

	2) The next step is to generate the configure file.  From the
	   sml3d directory,

		% autoheader -Iconfig
		% autoconf -Iconfig

	3) follow the INSTALLATION instructions from above.

	image loaders (ppm, pgm, png, jpeg)
	model loaders (obj and mtl files)

This software is Copyright (c) 2010 John Reppy (All rights reserved).  It is
distributed under the GNU GENERAL PUBLIC LICENSE (Version 2).  See the COPYING
file for details.

ViewVC Help
Powered by ViewVC 1.0.0