aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamil Staps2015-08-19 11:07:55 +0200
committerCamil Staps2015-08-19 11:07:55 +0200
commit6b66ad843b6798d1a1910760c18d567f83d06bc8 (patch)
treee38aed893f4ef2453e0c3e3e440457bdcfeda683
parentLicense, readme (diff)
Setting up
-rw-r--r--Makefile4
-rw-r--r--Readme.md13
-rw-r--r--drawingframe.icl18
3 files changed, 25 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 3b0f432..4f0d2dd 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,8 @@ CLM_LIBS=$$(for l in $$(pkg-config --libs gtk+-2.0); do echo -n "-l $$l "; done)
CLM_INC=-I $(OBJECTIO) -I $(OBJECTIOLINUX) -I $(CLEANLIB)/StdLib
CLM_OPTS=-tst
+APP_OPTS=-h 512M
+
ICL=$(wildcard *.icl)
EXE=$(patsubst %.icl,%,$(ICL))
@@ -21,7 +23,7 @@ $(EXE): % : %.icl | copy
$(CLM) $(CLM_LIBS) $(CLM_INC) $(CLM_OPTS) $@ -o $@
run: $(filter $(EXE), $(MAKECMDGOALS))
- @for i in $^; do ./$$i -h 512M; done
+ @for i in $^; do ./$$i $(APP_OPTS); done
rebuild: clean all
diff --git a/Readme.md b/Readme.md
index 16544c1..e0fa966 100644
--- a/Readme.md
+++ b/Readme.md
@@ -4,6 +4,19 @@
That linux library was very buggy. The [camilstaps/ObjectIO][my_objectio] repository is an attempt to fix that library. This repository contains example programs, most of which are from [the tutorial][objectio_tut].
+# Setting up
+
+ $ git clone https://github.com/camilstaps/ObjectIO-examples
+ $ cd ObjectIO-examples
+
+Change the `CLEANHOME`, `CLEANLIB` and `OBJECTIO` variables to match your setup.
+
+ $ make
+
+After this, you may run examples with `make`:
+
+ $ make drawingframe run
+
# Legal
The ObjectIO library and the example programs from [the tutorial][objectio_tut] are subject to the [Clean License Conditions][clean_license], which means they are available under the LGPL and a commercial license.
diff --git a/drawingframe.icl b/drawingframe.icl
index 00e2862..73164d7 100644
--- a/drawingframe.icl
+++ b/drawingframe.icl
@@ -29,15 +29,15 @@ where
maxdomain = {x=origin.x+size.w,y=origin.y+size.h}
// Rainbow
-//example pict = foldr id pict [fill {corner1={x=x1 * w,y=0},corner2={x=x1 * w + w,y=h}} o (setPenColour (rainbow (toReal x1 / 5.0))) \\ x1 <- [0..160]]
-//where
-// w = 5
-// h = 100
-// rainbow :: a -> Colour | toReal a
-// rainbow i = let i` = toReal i
-// f = 0.3 in RGB { r = toInt (sin (f * i` + 0.0) * 127.0) + 128, // http://krazydad.com/tutorials/makecolors.php
-// g = toInt (sin (f * i` + PI / 1.5) * 127.0) + 128,
-// b = toInt (sin (f * i` + PI / 0.75) * 127.0) + 128 }
+example pict = foldr id pict [fill {corner1={x=x1 * w,y=0},corner2={x=x1 * w + w,y=h}} o (setPenColour (rainbow (toReal x1 / 5.0))) \\ x1 <- [0..160]]
+where
+ w = 5
+ h = 100
+ rainbow :: a -> Colour | toReal a
+ rainbow i = let i` = toReal i
+ f = 0.3 in RGB { r = toInt (sin (f * i` + 0.0) * 127.0) + 128, // http://krazydad.com/tutorials/makecolors.php
+ g = toInt (sin (f * i` + PI / 1.5) * 127.0) + 128,
+ b = toInt (sin (f * i` + PI / 0.75) * 127.0) + 128 }
// Points
//example = drawPointAt zero o (setPenSize 1)