From: David C. <D. C. <si...@te...> - 2000-06-03 16:51:52
|
Mark Baker writes: > On Fri, 02 Jun 2000, Pete Shinners wrote: > > right now in pysdl, there's no way to go mess with > > pixels aside from the get_at and put_at. needless > > to say this is extremely slow. even a 200x150 window > > of the fire takes a couple seconds each frame. > > This is inaccurate. You can manipulate surfaces using the slice operator. > surface[y] returns a list of pixels. > c_x = surface[y] > x = 0 > while x < len(c_x): > c_x[x] = some_color > some_color = some_other_color() > x = x + 1 > > Whether or not this ends up being faster, is a different story all together. My understanding is that the following minimal test program should work. Unfortunately, it doesn't. #! /usr/bin/env python import sdl sdl.init(sdl.INIT_VIDEO) video = sdl.video_set_mode(200,200,16,sdl.SWSURFACE) video[100][100] = video.map_rgb((255,255,255)) video.update_rect((0,0,0,0)) while 1: pass This should plot a white pixel at the center of the surface, but no white pixel appears. This is strange; I remember testing this back when it was introduced in 0.0.3, and it worked fine then. Am I doing something wrong? -- David Clark si...@te... Preliminary pySDL Documentation: http://www3.telus.net/futility/futility/docs/pysdl/index.html |