diff options
author | Camil Staps | 2015-08-19 11:07:55 +0200 |
---|---|---|
committer | Camil Staps | 2015-08-19 11:07:55 +0200 |
commit | 6b66ad843b6798d1a1910760c18d567f83d06bc8 (patch) | |
tree | e38aed893f4ef2453e0c3e3e440457bdcfeda683 | |
parent | License, readme (diff) |
Setting up
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | Readme.md | 13 | ||||
-rw-r--r-- | drawingframe.icl | 18 |
3 files changed, 25 insertions, 10 deletions
@@ -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 @@ -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) |