Re: [Haskell-cafe] Pixel plotter

2007-10-19 Thread Brandon S. Allbery KF8NH


On Oct 19, 2007, at 15:14 , Andrew Coppin wrote:


Peter Verswyvelen wrote:
I find it a petty the library does not work with GHCi :-(  It has  
to do with the threaded RTS I guess. Any hints how I could fix this?


Yeah, lots of things seem to dislike running in GHCi. (I'm guessing  
this is to do with trying to talk to C from inside an  
interpreter... I don't really know for sure why it doesn't work,  
but it doesn't surprise me.)


Could be that (but I think unlikely), or threading (common; gtk2hs  
has hacks specifically for ghci/runghc), or special initialization  
needed for windowing programs (I think Windows requires this, and I  
know OSX does).


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pixel plotter

2007-10-19 Thread Andrew Coppin

Peter Verswyvelen wrote:
Yeah I missed that too at first sight... A hint to the author: rename 
this into README.WIN32.txt or something :-)


But I don't think the author of that library reads this mailing list?


Mmm... I suppose technically somebody could submit a Darcs patch? ;-) 
[Darcs even has special support for renaming files...]


I find it a petty the library does not work with GHCi :-(  It has to 
do with the threaded RTS I guess. Any hints how I could fix this?


Yeah, lots of things seem to dislike running in GHCi. (I'm guessing this 
is to do with trying to talk to C from inside an interpreter... I don't 
really know for sure why it doesn't work, but it doesn't surprise me.)


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pixel plotter

2007-10-19 Thread Roel van Dijk
I find it a petty the library does not work with GHCi :-(  It has to do
with the threaded RTS I guess. Any hints how I could fix this?

Not sure how useful this is, but it works for me. I have a toy project
that uses OpenGL and SDL and I have no problems running it from within
GHCi in Linux. Perhaps the problem can be narrowed down to Windows.

My versions:
GHC-6.6.1
SDL-0.4.0
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pixel plotter

2007-10-18 Thread Andrew Coppin

Bit Connor wrote:

There should be a WIN32 file with instructions for installing on windows.
  


Thanks. I didn't spot that...

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pixel plotter

2007-10-17 Thread Bit Connor
There should be a WIN32 file with instructions for installing on windows.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pixel plotter

2007-10-14 Thread Jon Harrop
On Sunday 14 October 2007 13:31:56 Andrew Coppin wrote:
 PS. I've investigated existing APIs and I'm not seeing anything that
 looks useful. Lots of support for drawing lines and arcs and so on, but
 not for plotting individual pixels.

I highly recommend OpenGL. Even if you are just filling texture maps for now, 
you have a future proof way to do far more sophisticated graphics.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pixel plotter

2007-10-14 Thread Andrew Coppin

Jon Harrop wrote:

On Sunday 14 October 2007 13:31:56 Andrew Coppin wrote:
  

PS. I've investigated existing APIs and I'm not seeing anything that
looks useful. Lots of support for drawing lines and arcs and so on, but
not for plotting individual pixels.



I highly recommend OpenGL. Even if you are just filling texture maps for now, 
you have a future proof way to do far more sophisticated graphics.
  


...just... the irony of using OpenGL to write a software ray tracer. ;-)

Oh, and the irony of using OpenGL (an API of unimaginable complexity) 
just to write pixels to the screen. Isn't that kind of like using a 
thermonuclear device to crack a nut?


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pixel plotter

2007-10-14 Thread nornagon
On 14/10/2007, Andrew Coppin [EMAIL PROTECTED] wrote:
 Jon Harrop wrote:
  On Sunday 14 October 2007 13:31:56 Andrew Coppin wrote:
 
  PS. I've investigated existing APIs and I'm not seeing anything that
  looks useful. Lots of support for drawing lines and arcs and so on, but
  not for plotting individual pixels.
 
 
  I highly recommend OpenGL. Even if you are just filling texture maps for 
  now,
  you have a future proof way to do far more sophisticated graphics.
 

 ...just... the irony of using OpenGL to write a software ray tracer. ;-)

 Oh, and the irony of using OpenGL (an API of unimaginable complexity)
 just to write pixels to the screen. Isn't that kind of like using a
 thermonuclear device to crack a nut?


OpenGL is used as a pixel-plotting mechanism relatively often. You
wouldn't be doing anything new if you did it that way.

I say someone binds SDL[1]. (If it hasn't been done already.)

- Jeremy

[1] - http://libsdl.org
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pixel plotter

2007-10-14 Thread Roel van Dijk
 I say someone binds SDL[1]. (If it hasn't been done already.)

Ask and you shall receive:

http://darcs.haskell.org/~lemmih/hsSDL/

I use those SDL bindings to plot pixels with OpenGL and play with 3D
stuff in Haskell.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pixel plotter

2007-10-14 Thread Dan Piponi
Andrew said:

 Oh, and the irony of using OpenGL (an API of unimaginable complexity) just to 
 write pixels to the screen. Isn't that kind of like using a thermonuclear 
 device to crack a nut?

Saying that using OpenGL to write pixels to the screen is like using a
thermonuclear device to crack a nut, is like saying that using a
computer to edit files is like using a thermal lance to slice butter.
(Do you like my higher order simile?)

Incidentally, people raytrace with OpenGL all the time via GPGPU:
http://www.gpgpu.org/cgi-bin/blosxom.cgi/Advanced%20Rendering/index.html
I'm looking forward to someone implementing a nice Haskell API to all
that yummy GPGPU stuff, like Python's
http://www.cs.lth.se/home/Calle_Lejdfors/pygpu/ (I've heard
rumours...)
--
Dan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pixel plotter

2007-10-14 Thread Peter Verswyvelen
Interesting! I just wanted to reply (although Andrew Coppin must have 
unsubscribed by now...) that I have an application that plots pixels 
using OpenGL (it's actually not that hard, just visit the new Haskell 
OpenGL page, and look at the examples given, e.g. 
http://darcs.haskell.org/packages/GLUT/examples/RedBook/Image.hs). But 
the SDL stuff seems easier...


Thanks,
Peter Verswyvelen

Roel van Dijk wrote:

I say someone binds SDL[1]. (If it hasn't been done already.)



Ask and you shall receive:

http://darcs.haskell.org/~lemmih/hsSDL/

I use those SDL bindings to plot pixels with OpenGL and play with 3D
stuff in Haskell.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


  


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pixel plotter

2007-10-14 Thread Luke Palmer
YEEESSS!!   W00t11   I've been looking for that for a long time.  I
get so sick of glut...  Thanks.

Luke

On 10/14/07, Roel van Dijk [EMAIL PROTECTED] wrote:
  I say someone binds SDL[1]. (If it hasn't been done already.)

 Ask and you shall receive:

 http://darcs.haskell.org/~lemmih/hsSDL/

 I use those SDL bindings to plot pixels with OpenGL and play with 3D
 stuff in Haskell.
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Pixel plotter

2007-10-14 Thread Tim Docker
Andrew Coppin:

 As far as I know, all of this is *possible* with Gtk2hs
 right now - it's just vastly more complex than making
 a single function call. So what I'd like to do is write
 a small library which will enable me to do each of the
 above tasks in 1 function call. However, I'm getting
 nowhere fast with this. Anybody have any suggestions?

Despite having a large API gtk2hs is pretty easy to use for these kind of
tasks. You can look at this library [1] (for plotting charts) to see
simple examples of opening windows, saving images etc. It uses
the (nice) 2D cairo API for drawing, though it's not too hard to work with
raw pixels via the functions in Graphics.UI.Gtk.Gdk.Pixbuf.

You'll need to restrict your drawing calls to a single thread - most GUI
toolkits will require this. Haskell makes this easy through its
ability to pass drawing actions from thread to thread.

Tim

[1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Chart-2007.8.8

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe