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

SCM Repository

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

Annotation of /trunk/sml3d/README

Parent Directory Parent Directory | Revision Log Revision Log


Revision 998 - (view) (download)

1 : jhr 139 SUMMARY
2 : jhr 225
3 : jhr 139 A suite of libraries to support real-time 3D programming in SML using OpenGL.
4 : jhr 1
5 : jhr 139 INSTALLATION
6 : jhr 225
7 : jhr 731 The SML3d Library currently only supports the MLton implementation of SML
8 :     (both 32-bit and 64-bit versions). Furthermore, it requires a version of
9 :     MLton that is at least as recent as the r7407 svn revision (2010-01-22).
10 :     For instructions on getting MLton, visit http://mlton.org.
11 : jhr 139
12 :     After unpacking, run the configure script and then make. You can then
13 :     try out some of the example programs.
14 :    
15 : jhr 288 The process is a bit more complicated if you are installing sml3d from
16 :     the SVN repository. See the instructions below for details.
17 :    
18 : jhr 139 USAGE
19 :    
20 :     Depending on which components of the SML3D library you are using, you
21 : jhr 225 will need to pass additional flags and (possibly) additional object files
22 : jhr 542 to the mlton command line. We have packaged up this behavior in a shell
23 : jhr 225 script (bin/config-cmd.sh). Thus, you can invoke mlton as follows
24 : jhr 139
25 : jhr 225 MLTONFLAGS=`config-sml3d.sh components`
26 : jhr 139
27 : jhr 225 EXTRAOBJS=`config-sml3d.sh objs components`
28 :    
29 :     mlton $MLTONFLAGS project.mlb $EXTRAOBJS
30 :    
31 :     where "project.mlb" is your project's MLB file. Note that we use the
32 :     config-sml3d.sh command twice: once to generate the command-line options
33 :     and once to get the list of extra object files. The "components" argument
34 :     to the script specifies which components your project is using. The values
35 : jhr 139 are:
36 : jhr 151
37 : jhr 479 no-opengl Do not use OpenGL support (incompatable with the glut
38 : jhr 151 option)
39 :     glut Use the GLUT library
40 : jhr 479 sdl Use SDL (incompatable with the glut option).
41 : jhr 139 sdl-ttf Use the SDL True-type font library (implies sdl
42 : jhr 152 option).
43 : jhr 139 sdl-image Use the SDL True-type font library (implies sdl
44 : jhr 479 option).
45 : jhr 139 sdl-mixer Use the SDL audio mixer library (implies sdl
46 : jhr 479 option).
47 :     openal Use the OpenAL library (incompatable with sdl-mixer).
48 : jhr 542 image-io Use the SML3D image library, which requires additional
49 :     C object files and libraries.
50 : jhr 983 opencl Use the OpenCL library.
51 :     movie Use support for encoding movies from the OpenGL
52 :     frame buffer
53 : jhr 139
54 :     If you use GNU make to build your project, you may want to include the
55 :     mk/config.gmk file in your makefile. Define the SML3D_CONFIG_OPTIONS make
56 :     variable to the components that you are using and use the MLTON_FLAGS
57 :     variable as an argument to the mlton command.
58 : jhr 151
59 :    
60 : jhr 288 WINDOWS
61 :    
62 :     The sml3d library has been ported to work on Windows XP and Windows
63 :     Vista using the MinGW/MSys installation that comes with the MLton
64 :     MSI files (http://mlton.org/Experimental). When using the GLUT library
65 :     on Windows, you need to make sure that Windows can find the GLUT DLL.
66 :     If your sml3d tree is in
67 :    
68 :     c:\Users\yourlogin\sml3d
69 :    
70 :     then add
71 :    
72 :     c:\Users\yourlogin\sml3d\windows\bin
73 :    
74 :     to your PATH variable.
75 : pavelk 997
76 :     NOTES:
77 : jhr 288
78 : pavelk 997 - MLton's default install location is in C:\Program Files. Since most UNIX
79 :     (and SML) tools don't play nice with spaces in directory names, a lot of
80 :     headaches will be avoided if MLton is installed somewhere that doesn't
81 :     contain spaces in the path.
82 :    
83 :     - MLton's version, along with others, of MinGW does not come with autotools
84 :     preinstalled. Since the autotools are only used to generate the configure
85 :     script, you can run this from a UNIX distribution and ship the configure
86 :     script over to windows, or you can use Cygwin. Or, if you've somehow gotten
87 :     autotools to work under MinGW, you can probably just use them. =)
88 :    
89 : pavelk 998 - MLton's MinGW doesn't come with a preinstalled 'cc' program, although it
90 :     does come with gcc. Hence, when you run './configure', make sure to pass the
91 : pavelk 997 argument that sets the CC variable properly. The easiest way to do this
92 :     is './configure CC=`which gcc`'.
93 :    
94 :     - As of SML/NJ 110.72, there is a bug when running CM.make under windows.
95 :     Some of the commands are passed to the shell incorrectly. You can run the
96 :     commands yourself from the MS-DOS command line:
97 :    
98 :     Every time you see something like this:
99 :    
100 :     ["C:\SMLNJ\bin\ml-ulex" "gl-spec.lex"]
101 :     'C:\SMLNJ\bin\ml-ulex" "gl-spec.lex' is not recognized as an internal or
102 :     external command, operable program or batch file.
103 :     sources.cm:19.5-19.16 Error: tool "MLULex" failed: "C:\SMLNJ\bin\ml-ulex"
104 :     "gl-spec.lex"
105 :    
106 :     From the command line, run something like this:
107 :    
108 :     C:\Path\To\sml3d\gen\gen-gl-glue> C:\SMLNJ\bin\ml-ulex gl-spec.lex
109 :    
110 :     Then perform the SML commands again.
111 : jhr 288
112 : pavelk 997
113 : jhr 151 DEPENDENCIES
114 :    
115 : jhr 288 The SML3d library assumes that your system has OpenGL 2.1 available.
116 :     It can be configured to use other libraries:
117 : jhr 151
118 :     GLUT Available with most OpenGL systems. An alternative
119 :     is available from http://freeglut.sourceforge.net.
120 : jhr 225 For Windows systems (using MinGW), we have included
121 :     GLUT support in the SML3d distribution.
122 : jhr 151 SDL http://www.libsdl.org
123 :     SDL_image http://www.libsdl.org/projects/SDL_image
124 :     SDL_ttf http://www.libsdl.org/projects/SDL_ttf
125 :     SDL_mixer http://www.libsdl.org/projects/SDL_mixer
126 :     OpenAL http://openal.org
127 : jhr 542 libpng http://www.libpng.org/pub/png/
128 :     libtiff http://www.libtiff.org/
129 : jhr 983 mencoder http://www.mplayerhq.hu/
130 : jhr 151
131 : jhr 139 ROADMAP
132 :    
133 : jhr 1 doc/
134 :     src/
135 : jhr 383 base/
136 :     common - SML code for vectors, matrices, etc.
137 :     opengl - SML interfaces to the GL and GLU libraries
138 :     util - various utility modules
139 : jhr 1 glut - SML interface to the GLUT library
140 :     gui - A simple, GLUT-based, GUI library
141 : jhr 542 image-io - image I/O support
142 : jhr 139 loaders - loaders for some 3D file formats
143 :     openal - SML interfaces to OpenAL
144 : jhr 983 movie - A library for generating movies from an application by sending
145 :     raw frames through mencoder
146 : jhr 1 particles - A library for particle effects.
147 : jhr 139 sdl - SML interfaces to SDL and related libraries
148 :     tests - test programs
149 : jhr 1 examples/ - some example programs
150 : jhr 288 gen/ - code to generate the FFI glue code for OpenGL.
151 : jhr 225 windows/ - extra support files for Windows systems (requires
152 :     MinGW)
153 : jhr 1
154 : jhr 288 BUILDING FROM SVN
155 :    
156 : jhr 423 If you have downloaded the sml3d sources from svn, then there are a few
157 :     extra steps required to build the system.
158 : jhr 288
159 :     1) generating glue code. The FFI glue code is generated from
160 : jhr 423 an XML description. To build the glue code, you will need a
161 : jhr 288 recent version of SML/NJ (110.68+). Then execute the following
162 :     steps.
163 :    
164 : pavelk 997 % cd gen/gen-gl-glue
165 : jhr 288 % sml
166 :     - CM.make "sources.cm";
167 :     - Gen.default ();
168 :    
169 :     2) The next step is to generate the configure file. From the
170 :     sml3d directory,
171 :    
172 : jhr 793 % autoheader -Iconfig
173 : jhr 288 % autoconf -Iconfig
174 :    
175 :     3) follow the INSTALLATION instructions from above.
176 :    
177 :    
178 :     TODO
179 : jhr 1 image loaders (ppm, pgm, png, jpeg)
180 :     model loaders (obj and mtl files)
181 :     SDL
182 :    
183 : jhr 984 This software is Copyright (c) 2010 John Reppy (All rights reserved). It is
184 : jhr 1 distributed under the GNU GENERAL PUBLIC LICENSE (Version 2). See the COPYING
185 :     file for details.

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