Commit Graph

42 Commits

Author SHA1 Message Date
Julien Fischer
81e2d33789 Replace use of I/O globals in OpenGL maze example.
extras/graphics/samples/maze/maze.m:
    As above, use mutables intead of the I/O globals.

extras/graphics/samples/maze/globals.m:
    Delete this module; it is no longer required.
2022-03-20 16:29:01 +11:00
Julien Fischer
12731885e5 Update OpenGL maze example.
extras/graphics/samples/maze/maze.m:
    Use the new random number generator framework.

    Seed the random number generator using the system RNG, if
    the user does not provide a seed.

    Use the list shuffling code from the standard library.
2022-03-20 16:08:20 +11:00
Julien Fischer
f3d0812f4b Simplify OpenGL maze example.
extras/graphics/samples/maze/maze.m:
    As above.
2022-01-23 15:39:01 +11:00
Julien Fischer
4fac134384 Update programming style in OpenGL gears example.
extras/graphics/samples/gears/gears.m:
    As above.

    Replace tabs with spaces; delete trailing whitespace.
2022-01-23 15:02:29 +11:00
Julien Fischer
03c441fa8a Update programming style in OpenGL maze example.
Fix Makefiles for OpenGL examples on macOS.

extras/graphics/samples/maze.m:
extras/graphics/samples/globals.m:
    Update programming style.

    Replace tabs with spaces.

extras/graphics/samples/gears/Mmakefile.MacOSX:
extras/graphics/samples/maze/Mmakefile.MacOSX:
    Set header includes for the C compiler.

    Add a "run" target that sets DYLD_LIBRARY_PATH appropriately
    for running the examples in situ.
2022-01-23 14:49:50 +11:00
Julien Fischer
543a74938a Delete an old graphics sample.
extras/graphics/samples/pent/:
    Delete this; the togl library it used has not been supported
    for many years.

extras/graphics/README:
    Delete the (incorrect) entry for the above.

    Add a missing entry.
2022-01-12 17:08:34 +11:00
Fabrice Nicol
3180f3197d Fix compilation of OpenGL example. 2022-01-05 14:53:35 +11:00
Julien Fischer
b55c2ad6a8 Delete trailing whitespace.
extras/graphics/samples/calc/calc.m:
    As above.
2020-10-02 17:29:54 +10:00
Paul Bone
fc4b3ff196 Remove .cvsignore files
Remove old .cvsignore files, moving their contents to .gitignore files.
There are now no .cvsignore files in the repository.

I've also sorted some .gitignore files and avoided repeating a pattern in a
subdirectory's .gitignore file when it is already mentioned in the parent
.gitignore file.
2017-04-04 12:05:56 +10:00
Julien Fischer
e7010327d9 Delete references to picreg.
browser/interactive_query.m:
extras/dynamic_linking/Mmakefile:
extras/graphics/mercury_glut/Mmakefile:
extras/graphics/mercury_glut/Mmakefile.MacOSX:
extras/graphics/samples/calc/Makefile:
extras/graphics/samples/gears/Mmakefile:
extras/graphics/samples/maze/Mmakefile:
extras/graphics/samples/pent/Mmakefile:
extras/morphine/non-regression-tests/Mmakefile:
extras/morphine/source/collect.op:
    As above.
2016-04-26 14:03:04 +10:00
Zoltan Somogyi
d33273d033 Tell vim not to expand tabs in Makefiles.
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.

*/Makefile:
*/Mmakefile:
    As above.

tests/hard_coded/.gitignore:
    Don't ignore the purity subdir. This ignore must have been left over
    from when purity.m was a test in hard_coded, not hard_coded/purity,
    and it ignored an executable, not a directory.
2015-01-08 22:07:29 +11:00
Julien Fischer
2a8be7bbf6 Replace '__' as module qualifier in rest of the extras.
extras/*/*.m:
	Replace the use of '__' as a module qualifier in the rest of
	the extras.

	s/io\.state/io/ in the extras.

	Use '=' instead of is/2 in a spot.
2014-12-29 16:48:17 +11:00
Sebastian Godelet
f9899940b7 Add .gitignore files to the extras/ directory
extras/.gitignore:
    Mercury ignores the --use-{grade}-subdir dir
    Mercury/** for git 1.8+ this recursively ignores all build files
    ignoring *.mh and *.init files
    *.err output files
    lib*.{dll|so|a|dylib} ignores target compiler library output
    *.jar ignores the Java grade output
    *.exe for Windows executables

extras/dynamic_linking/.gitignore:
    ignoring the copy of dl.m, name_mangle.m
    ignoring hello lib and dl_test* executables

extras/moose/samples/.gitignore:
    ignoring cgram.m small.m alpha.m expr.m which are
    generated from the .moo grammar files

extras/graphics/mercury_cairo/samples/.gitignore:
    ignoring *.png output and all executables

extras/**/.gitignore:
    In each sample/test/example folder the linux executable/test
    output is ignored
2014-02-27 16:58:43 +11:00
Julien Fischer
aff3343c68 Fix more compilation errors in extras.
extras/trailed_update/tr_store.m:
	Conform to runtime changes.

extras/gator/genotype.m:
extras/gator/phenotype.m:
extras/graphics/samples/maze/maze.m:
extras/trailed_update/samples/interpreter.m:
	Conform to standard library changes.
2014-02-06 03:31:59 +11:00
Julien Fischer
5f41df060a Fix broken line continuations.
Branches: main

extras/graphics/samples/pent/Mmakefile:
	Fix broken line continuations.

extras/graphics/samples/pent/globals.m:
	Conform to recent (and not so recent) stdlib changes.
2011-05-18 03:56:02 +00:00
Julien Fischer
1fbaa8f97c Conform to the recent change to the argument ordering of map.set/4.
Branches: main

extras/graphics/samples/maze/globals.m:
	Conform to the recent change to the argument ordering of map.set/4.
2011-05-18 03:52:34 +00:00
Julien Fischer
1b63613bfb Fix a bug in the OpenGL maze example.
extras/graphics/samples/maze/maze.m:
	Fix some code that didn't confrom to the current representation of
	the maze.  (This wasn't caught at compile-time because of the use
	of dynamic typing in this example.)
2008-11-27 03:42:37 +00:00
Julien Fischer
368df5703e Make the globals field in the I/O state non-unique.
Estimated hours taken: 0.5
Branches: main

Make the globals field in the I/O state non-unique.  There is an obvious
flaw in the unique version in that you can obtain multiple references
to a unique object just by calling the get_globals/3 predicate twice.
Also, the uniqueness aspect is rarely ever useful; most code that uses
it just ends up call unsafe_promise_unique/2.

library/io.m:
	Make the globals field in the I/O state non-unique.

NEWS:
	Mention this change.

compiler/globals.m:
extras/graphics/samples/maze/globals.m:
tests/hard_coded/io_globals_deadlock.m:
	Conform to the above change.
2007-02-11 04:05:45 +00:00
Julien Fischer
2e226e3daf Cleanups and minor fixes for the mtcltk calculator example.
Estimated hours taken: 0.3
Branches: main, release

Cleanups and minor fixes for the mtcltk calculator example.

extras/graphics/samples/calc/calc.m:
	Conform to recent changes in the standard library.

	Convert to 4-space indentation.

	Use state variables for threading the I/O state.

	Other formatting and style fixes.
2006-04-21 05:45:47 +00:00
Julien Fischer
456d23953a Update the OpenGL samples to conform with recent standard library
Estimated hours taken: 0.1
Branches: main

Update the OpenGL samples to conform with recent standard library
changes.

extras/graphics/samples/gears/gears.m:
extras/graphics/samples/maze/maze.m:
extras/graphics/samples/maze/globals.m:
	Conform to recent library changes.

extras/graphics/mercury_glut/Mmakefile:
extras/graphics/mercury_opengl/Mmakefile:
extras/graphics/samples/gears/Mmakefile:
extras/graphics/samples/maze/Mmakefile:
	Update the list of X libraries required by Mesa.
2006-03-30 02:52:45 +00:00
Julien Fischer
66e5a99f43 Provide an example of a how mutables can be used with the OpenGL/GLUT
Estimated hours taken: 0.5
Branches: main

Provide an example of a how mutables can be used with the OpenGL/GLUT
bindings.

extras/graphics/samples/gears/gears.m:
	Use the mutables in place of the globals module we previously used.

	Don't pass the limit argument down to gears.init/2.  We can set its
	value directly after option processing now.

extras/graphics/samples/gears/globals.m:
	Delete this module.
2005-10-10 04:41:05 +00:00
Julien Fischer
aeca8fd712 Provide an example of how to use an initialise declaration in a library
Estimated hours taken: 0.1
Branches: main

Provide an example of how to use an initialise declaration in a library
binding.

extras/graphics/mercury_glut/glut.m:
	Use an initialise declaration to automatically initialise the GLUT
	binding.

extras/graphics/samples/gears/gears.m:
extras/graphics/samples/maze/maze.m:
	Conform to the above change.
2005-10-06 09:25:23 +00:00
Ian MacLarty
61c38eba2f Port the Tcl/Tk binding to Mac OS X.
Estimated hours taken: 5
Branches: main and 0.12

Port the Tcl/Tk binding to Mac OS X.

extras/graphics/mercury_tcltk/HOWTO:
	Remove the remark about interior pointers since it is no longer
	applicable.

extras/graphics/mercury_tcltk/Mmakefile:
	Try to link with tcl/tk 8.4 by default.

extras/graphics/mercury_tcltk/Mmakefile.MacOSX:
	Mmakefile for Mac OS X.

extras/graphics/mercury_tcltk/README:
	Mention Mmakefile.MacOSX.

extras/graphics/mercury_tcltk/mtcltk.m:
	Include the headers from a different location on Mac OS X.

extras/graphics/samples/calc/Mmakefile.MacOSX:
	Add a Mmakefile to compile the Tcl/Tk example on Mac OS X.

extras/graphics/samples/calc/README:
	Add a README.

extras/graphics/samples/calc/calc.m:
	Add spaces around some of the characters on the buttons, so that they
	are visible in Mac OS X.
2005-08-15 04:11:43 +00:00
Julien Fischer
32f148898d Fix up this Mmakefile so that the calculator example builds
Estimated hours taken: 0.1
Branches: main

extras/graphics/samples/calc/Mmakefile:
	Fix up this Mmakefile so that the calculator example builds
	in place on our current machines.
2005-08-10 09:12:16 +00:00
Julien Fischer
cf0e6bc496 Make the OpenGL/GLUT bindings compatible with OS X.
Estimated hours taken: 3
Branches: main, release

Make the OpenGL/GLUT bindings compatible with OS X.

extras/graphics/mercury_opengl/mogl.m:
extras/graphics/mercury_opengl/mglu.m:
extras/graphics/mercury_glut/glut*.m:
	Make sure the appropriate header files are included on OS X
	systems.

	Remove some unecessary imports and change the imports so that
	they are one-per-line.

	Workaround a problem with Apple's OpenGL implementation.

extras/graphics/mercury_glut/README:
extras/graphics/mercury_opengl/README:
	Refer users to Mmakefile.MacOSX for instructions on how to build
	the binding on OS X.

extras/graphics/mercury_opengl/Mmakefile.MacOSX:
extras/graphics/mercury_glut/Mmakefile.MacOSX:
	New file.  OS X specific Mmakefile for the GLUT binding.

extras/graphics/samples/gears/*.m:
	Remove unecessary module imports.  Import modules
	one-per-line.

extras/graphics/*/.cvsignore:
	Add .cvsignore files.
2005-06-29 05:21:45 +00:00
Julien Fischer
d90e0150db Convert the opengl maze demo to use glut rather than mtogl.
Estimated hours taken: 0.5 + unknown amount of time a while back
Branches: main

Convert the opengl maze demo to use glut rather than mtogl.
(It's more useful in this form since mtogl doesn't really work
anymore).

extras/graphics/samples/maze/maze.m:
extras/graphics/samples/maze/globals.m:
	Use glut rather than mtgol.

	Fix a problem where the maze wasn't resizing
	properly when the window was resized.

	Add a keyboard handler to make it easier to
	quit.

	Various syntax cleanups.

extras/graphics/samples/maze/Mmakefile:
	Use glut rather than mtogl and tcl/tk.
2005-01-20 04:50:22 +00:00
Julien Fischer
080d0484b1 Provide a binding for glGetString().
Estimates hours taken: 1.5
Branches main.

extras/graphics/mercury_opengl/mogl.m:
	Provide a binding for glGetString().

	Fix the foreign proc attributes on mogl.is_list/4.  It doesn't make
	calls back to Mercury.

	Fix some typos.

extras/graphics/samples/gears/gears.m:
	Use mogl.get_string/4 to print out various details of the GL
	implementation at the beginning of this demo.
2005-01-06 05:45:19 +00:00
Julien Fischer
b4b56c8f3d Add a sample program that demonstrates the use of the
Estimated hours taken: 1.5
Branches: main

Add a sample program that demonstrates the use of the
GLUT binding.

extras/graphics/samples/gears/Mmakefile:
extras/graphics/samples/gears/gears.m:
extras/graphics/samples/gears/globals.m:
	Add a sample program for the GLUT binding.
2004-06-14 11:34:06 +00:00
Fergus Henderson
4d9f101e33 Delete extraneous space after backslash,
Estimated hours taken: 0.1
Branches: main

extras/graphics/samples/maze/Mmakefile:
	Delete extraneous space after backslash,
	so that the backslash is treated as a line continuation marker.
2003-08-14 03:09:57 +00:00
Fergus Henderson
95050e9d28 Delete extraneous space after backslash,
Estimated hours taken: 0.1
Branches: main

extras/graphics/samples/maze/Mmakefile:
	Delete extraneous space after backslash,
	so that the backslash is treated as a line continuation marker.
2003-08-14 03:08:50 +00:00
Julien Fischer
15b576701c Remove dependency between mercury_opengl and mercury_tcltk by making
Estimated hours taken: 14.
Branches: main.

Remove dependency between mercury_opengl and mercury_tcltk by making
mtogl a separate library.

Modify togl so that it works with Tcl/Tk 8.0.5
(XXX It doesn't work (easily) with versions of Tcl/Tk greater than 8.0,
 we probably ought to consider using togl 1.6 at some point).

Make a number of small changes (mainly adding casts and missing MR_* prefixes)
to prevent compiler warnings.

extras/graphics/README:
	Mention the `mtogl' package.

extras/graphics/mercury_opengl/mercury_opengl.m:
extras/graphics/mercury_opengl/mglu.m:
extras/graphics/mercury_opengl/mogl.m:
	Remove mtogl from mercury_opengl package.
	Define quadric using pragma foreign_type
	Add some missing MR_* prefixes.

extras/graphics/mercury_opengl/mtogl:
	Remove references to header files that are no longer generated
	by the compiler.
	Use the new foreign language interface.
	Add some missing MR_* prefixes.

extras/graphics/mercury_opengl/togl.c:
	Allow the use of tk version 8.0.5
extras/graphics/mercury_opengl/tkInt8.0p5.h:
	New file.  (This is a part of tk)

extras/graphics/mercury_opengl/Mmakefile:
	Update mmakefile to reflect above changes.

extras/graphics/mercury_opengl/README:
	Mention mtogl.

extras/graphics/samples/calc/calc.m:
	Add some missing underscores; this prevents compiler warnings
	when compiling with intermodule-optimization enabled.

extras/graphics/samples/maze/Mmakefile:
extras/graphics/samples/pent/Mmakefile:
	Update mmakefiles to reflect above changes.
2003-08-13 05:54:33 +00:00
Simon Taylor
da2e0433c6 Use C2INITARGS or MLFLAGS instead of C2INITFLAGS.
Estimated hours taken: 0.25
Branches: main

bytecode/Mmakefile:
compiler/Mmakefile:
extras/aditi/Mmakefile:
extras/curses/sample/Mmakefile:
extras/graphics/samples/calc/Mmakefile:
extras/graphics/samples/maze/Mmakefile:
extras/graphics/samples/pent/Mmakefile:
extras/morphine/non-regression-tests/Mmakefile:
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
tests/benchmarks/Mmakefile:
tests/debugger/Mmakefile:
tests/debugger/declarative/Mmakefile:
tests/hard_coded/Mmakefile:
	Use C2INITARGS or MLFLAGS instead of C2INITFLAGS.
2001-12-19 15:08:30 +00:00
Fergus Henderson
b67e8963a1 Apply some improvements to extras/graphics
Estimated hours taken: 0.5 (plus unknown by original contributor)
Branches: main

Apply some improvements to extras/graphics
from Holger Krug <hkrug@rationalizer.com>.

extras/graphics/mercury_tcltk/mtk.m:
	Fix a bug: LVALUE_CAST renamed to MR_LVALUE_CAST.

extras/graphics/mercury_tcltk/mtk.m:
	Provide access to the root window.

extras/graphics/samples/calc/calc.m:
	Only create on top-level window.
2001-07-16 10:21:52 +00:00
Simon Taylor
fb42c9f41e Fix the location of the Tcl/Tk and OpenGL packages.
Estimated hours taken: 0.1

extras/graphics/samples/pent/Mmakefile:
	Fix the location of the Tcl/Tk and OpenGL packages.
1999-11-15 23:56:52 +00:00
Tyson Dowd
1b3227a1d3 Update the README file to accurately describe the directory.
Estimated hours taken: 0.5

extras/README:
	Update the README file to accurately describe the directory.

samples/maze/globals.m:
	Add the copyright message.
1998-09-29 05:57:19 +00:00
Tyson Dowd
1ddd0039be Added a new example.
Estimated hours taken: 5

graphics/samples/pent/*:
        Added a new example.
1998-09-29 05:33:49 +00:00
Tyson Dowd
037e0a752f Clean up samples to use the library versions of the graphics
Estimated hours taken: 3

samples/calc/Mmakefile:
samples/maze/Mmakefile:
samples/maze/globals.m:
samples/maze/maze.m:
	Clean up samples to use the library versions of the graphics
	packages.
1998-09-06 08:22:10 +00:00
Fergus Henderson
87788d9f14 Rename Mmake' as Mmakefile', since using the name `Mmake'
Estimated hours taken: 0.25

*/Mmake:
	Rename `Mmake' as `Mmakefile', since using the name `Mmake'
	causes problems on case-insensitive file systems.
1997-09-29 17:56:36 +00:00
Thomas Conway
8d79000cf8 Place various bits of sample code in the public domain.
Estimated hours taken: 0.1

Place various bits of sample code in the public domain.

extras/complex_numbers/samples/fft.m:
extras/graphics/samples/calc/calc.m:
extras/graphics/samples/maze/maze.m:
samples/ultra_sub.m:
	place the source in the public domain.
1997-09-11 22:08:56 +00:00
Fergus Henderson
04b720630b Update the copyright messages so that (a) they contain the correct years
and (b) they say "Copyright (C) ... _The_ University of Melbourne".
1997-07-27 15:09:59 +00:00
Thomas Conway
d3fffdb9ab A sample program for the OpenGL stuff.
Estimated hours taken: somewhere between 1 and 100

graphics/samples/maze:
	A sample program for the OpenGL stuff.
1997-07-18 05:04:26 +00:00
Thomas Conway
1d7dce07a2 A sample program for the Tcl/Tk stuff.
Estimated hours taken: somewhere between 1 and 100

graphics/samples/calc:
	A sample program for the Tcl/Tk stuff.
1997-07-18 05:04:11 +00:00