Re: [Edu-sig] Simple frame buffer module
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
On Mon, 2001-08-27 at 18:37, Chris Meyers wrote: Hi!
I played around with this a bit over the weekend. I'd like to use it in my class this fall.
That sounds great :). I'd like to get some feedback.
have one, I could clean it up and send you a "cfb" binary download
That would be great. I'm going to go over the package completely (I have no idea what I was thinking at the time - there are numerous errors throughout the entire package and some more documentation wouldn't hurt. I'll clean this up right away and release a 1.1 in a couple of hours. I might break some code, so beware.
One little thing. The window does not repaint when moved or uncovered. Is it possible to remedy this easily?
Well, I can't reproduce this here (I'm running Linux and Xfree86 3.3.6) - it sounds like a Win32 issue. Can anyone shed any light on this? By the way, thanks to you all for the great response :). Sincerely, -- David Pettersson dave@whatever.nu
participants (2)
-
Chris Meyers
-
David Pettersson