[Edu-sig] Simple frame buffer module

Chris Meyers cmeyers@guardnet.com
Mon, 27 Aug 2001 08:37:33 -0800


Hi Dave,
 
I played around with this a bit over the weekend. I'd like to use 
it in my class this fall. We're (unfortunately) on a win32 setup 
but I got it going with a couple of hacks. If you don't already 
have one, I could clean it up and send you a "cfb" binary download 
for windows folks that don't have a C compiler or want to mess with 
it.
 
One little thing. The window does not repaint when moved or 
uncovered. Is it possible to remedy this easily? I don't know 
anything about SDL programming, although this is helping me to 
start learning.
 
Thanks
Chris Meyers
 
BTW it took me a bit to figure out what in the world you were doing 
with the exclusive OR stuff in your line generation code. When I 
did it took me back to the machine code daze.

 

08/24/2001 9:42:19 PM, David Pettersson <dave@whatever.nu> wrote:

>Hi,
>
>I'd like to announce the simple frame buffer module that I wacked
>together after being fed up with having to create a GUI every time 
I
>wanted to illustrate something simple in Python (such as the 
iterative
>improvement of some problem). A short sample:
>
> import fb                       # import module
> f = fb.FrameBuffer()            # create an instance
> f.open(200, 200, "demo")        # open a window named "demo"
> for i in range(10, 190):        # simple loop
>   f.fg = (i, i, i)             # set fg colour
>   f.plot(i, i)                  # plot
> f.flip()                        # flip buffers
> raw_input('enter to quit')      # wait for keypress
> f.close()                       # close window
>
>Could be useful if you want students to be able to create simple
>graphics without having to teach them a GUI. The extension uses 
SDL to
>manage the graphics. The extension is available at
>
>  http://dave.whatever.nu/python/fb/
>
>Comments, suggestions and bug reports are all very welcome :).
>
>Sincerely,
>-- 
>David Pettersson
>dave@whatever.nu
>
>_______________________________________________
>Edu-sig mailing list
>Edu-sig@python.org
>http://mail.python.org/mailman/listinfo/edu-sig
>