From: Martijn F. <fa...@ve...> - 2000-04-20 20:40:49
|
Mark Baker wrote: > On Thu, 20 Apr 2000, Martijn Faassen wrote: > > Odd, I thought I did use HW in my code. Also I recall something in the > > docs on the color keyed blits bit. I don't have it here but at > > home, but I'll look tonight if I get a chance. I'll mail a report > > on that tonight, hopefully. That'll be more constructive than my > > vague underinformed bitching of late. :) > > You can specify HWSURFACE, when you create the surface, and if it can't be > allocated in hardware memory, it'll be allocated in system memory. That must be what's happening then; I just checked and I do use HWSURFACE. So I wonder how David found out it wasn't possible; I suppose he did a query on the surface after creation? > Color keying works in software, as well as in hardware. Must be, then! I think I misread this in the SDL reference: SDL_SRCCOLORKEY means that the surface will be used for colorkey blits and if the hardware supports hardware acceleration of colorkey blits between two surfaces in video memory, to place the surface in video memory if possible, otherwise it will be placed in system memory. Our own PySDL says this: SRCCOLORKEY The surface will be used for colorkey blits and if the hardware supports hardware acceleration of colorkey blits between two surfaces in video memory, to place the surface in video memory if possible, otherwise it will be placed in system memory. Both are certainly a bit clunky as written, though it's obvious now that I didn't read them right. I would patch the texts to something like: SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits. If the hardware supports acceleration of colorkey blits between two surfaces in video memory, SDL will try to place the surface in video memory. If this isn't possible or if there is no hardware acceleration available, the surface will be placed in system memory. Or something like that. Of course I should send it off to Sam Lantinga, so I'll do that now. :) David Clark is also informed of this minor documentation patch. Though I was probably the only one who got confused by the original. Oooh, I finished off this mail, and *now* I found what confused me: SDL_SRCCOLORKEY and SDL_SRCALPHA will only be honored if the display surface is in video video memory (the surface returned by SDL_SetVideoMode() has the SDL_HWSURFACE flag set.) I didn't read the *display* part in display surface, and also managed to ignore what was between the brackets. Silly me! Regards, Martijn |