You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
(57) |
May
(30) |
Jun
(44) |
Jul
(37) |
Aug
(9) |
Sep
(59) |
Oct
(21) |
Nov
|
Dec
(4) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
|
From: Martijn F. <fa...@ve...> - 2000-04-20 10:12:00
|
Mark Baker wrote: > SDL doesn't allow for hardware surfaces in X. The only exception I can think > of, is DGA, and only the main surface is in video memory. Odd, I'm pretty sure I've used one. I've done blitting with a transparent color after all, and from the docs I gleaned this is only possible with hardware surfaces? Regards, Martijn |
|
From: Martijn F. <fa...@ve...> - 2000-04-20 10:10:34
|
David Clark <David Clark wrote: [snip] > Out of curiousity, is anyone able to create a HWSURFACE? Yeah, I've had no problems with that. Now what was my video card again.. I'm running a stock 6.1 Red Hat box at 1024x768 16 bits at home. Regards, Martijn |
|
From: David C. <D. C. <si...@te...> - 2000-04-20 03:06:07
|
Mark Baker writes (referring to the differences in blit speed between
PNGs and BMPs):
>
> I'm willing to bet that the speed difference in the blit, is due to the fact
> that surfaces aren't in the same format as the video surface before you blit.
> The blit function converts them at runtime, if it's not in the same format.
>
>
> Try changing
> src = sdl.image_load("./happy.png")
> to
> src = sdl.image_load("./happy.png").convert(fb, sdl.SWSURFACE)
>
> To be fair, you'll want to do it to the BMP, too. This should give comparable
> figures.
>
Wow! Not only did that make the PNG and BMP times the same, it cut
them by about 40%! Very nice. Thanks for your help.
Preliminary SDL documentation:
http://www3.telus.net/futility/futility/docs/pysdl/index.html
--
----------------------------------------------------------------
David "Futility [D!]" Clark | Everyone's gotta be something.
si...@te... | Me, I'm garbage.
| It's all I've ever wanted to be.
| Shock me again, and I'll say
| anything you want me to. -MGB
|
|
From: Mark B. <mb...@0x...> - 2000-04-20 02:56:19
|
On Wed, 19 Apr 2000, "David Clark wrote:
> Ok, I've tried blitting the various file formats supported by
> image_load() and image_load_type(). My results:
>
> BMP: fine.
> JPG: fine.
> PNG: about 50% slower than bmps or jpgs.
> PCX: good speed, same as bmps and jpgs, but odd palette (yellows were
> blue)
> TIFF: failed to create surface: "RuntimeError: unable to allocate SDL
> surface" for image_load(), and "RuntimeError: unable to acquire file
> info" for image_load_type().
> PPM: untested
> GIF: untested (my copy of the Gimp doesn't output these types)
I'm willing to bet that the speed difference in the blit, is due to the fact
that surfaces aren't in the same format as the video surface before you blit.
The blit function converts them at runtime, if it's not in the same format.
TIFF support, though mentioned in SDL_image, is not yet implemented.
As such, you can't load TIFFs, yet. I may write a loder and send it to Sam
Lantinga, if I ever find time to.
Try changing
src = sdl.image_load("./happy.png")
to
src = sdl.image_load("./happy.png").convert(fb, sdl.SWSURFACE)
To be fair, you'll want to do it to the BMP, too. This should give comparable
figures.
|
|
From: David C. <D. C. <si...@te...> - 2000-04-20 02:33:45
|
Ok, I've tried blitting the various file formats supported by
image_load() and image_load_type(). My results:
BMP: fine.
JPG: fine.
PNG: about 50% slower than bmps or jpgs.
PCX: good speed, same as bmps and jpgs, but odd palette (yellows were
blue)
TIFF: failed to create surface: "RuntimeError: unable to allocate SDL
surface" for image_load(), and "RuntimeError: unable to acquire file
info" for image_load_type().
PPM: untested
GIF: untested (my copy of the Gimp doesn't output these types)
--
----------------------------------------------------------------
it's crowded and i feel lost in here
i'm trying to find a familiar fear
i look everywhere but i just can't see
there's not anything that reminds me of me
- Chantal Kreviazuk, Wayne
|
|
From: David C. <D. C. <si...@te...> - 2000-04-20 02:19:13
|
Mark Baker writes:
>
> > Blitting a png takes about 50% longer than an identical bmp. (Of
> > course, the png is compressed to 5% of the bmp's size :)
>
> Are you including the loading time? PNGs are decompressed on load, like all
> other image types, so after the load, it should blit at the same rate as a BMP.
>
The images were loaded to a non-visible surface before the timing
loop begins, so I believe there actually is a difference in blit rates
between PNGs and BMPs. Here's my (ugly) code:
<snip>
import sdl, random, sys, time
width = 640
height = 480
depth = 16
fb = sdl.video_set_mode(width, height, depth, sdl.SWSURFACE)
src = sdl.image_load("./happy.png")
#src = sdl.image_load("./happy.bmp")
start = time.time()
for i in range(500):
x_pos = (random.random() * (width * 0.9))
y_pos = (random.random() * (height * 0.9))
fb.blit(src, (0, 0, 64, 48), (x_pos, y_pos, 64, 48))
fb.update_rect((x_pos, y_pos, 64, 48))
# fb.update_rect( (0,0,0,0) )
end = time.time()
print "500 repetions took", end-start, "seconds."
print "That's", (end-start) * 2, "milliseconds per blit."
sdl.quit()
sys.exit(0)
<snip>
As you can see, pretty unsophisticated - I switched between options
just by uncommenting and recommenting code :) Anyway, I realize that
the timed loop is pretty full, but I was looking for relative numbers
here, not absolute measurements.
Preliminary pySDL documentation:
http://www3.telus.net/futility/futility/docs/pysdl/index.html
--
-------------------------------------------------------------------------\
David "Futility [D!]" Clark | "Being healthy" is merely dying at the |
si...@te... | slowest possible rate. |
|
|
From: Mark B. <mb...@0x...> - 2000-04-20 02:07:36
|
On Wed, 19 Apr 2000, "David Clark wrote: > I was doing a little video testing, profiling large numbers of blits > to the framebuffer, and noticed a few interesting facts... > > A blit of a 7k bmp from one SWSURFACE to another took less than a > millisecond. Woohoo! > > update_rect((0,0,0,0)) is expensive, but not prohibitivly so. Updating > a 640 x 480 surface all at once only took about 20 times longer than > updating a 64 x 48 rectangle, in spite of the fact that the surface is > 100 times bigger than the rectangle. Well this is good. SDL is fairly speedy, all things considered, and I've heard good things about the V3 X server. It's my hope we won't get too much in the way, with PySDL. > Blitting a png takes about 50% longer than an identical bmp. (Of > course, the png is compressed to 5% of the bmp's size :) Are you including the loading time? PNGs are decompressed on load, like all other image types, so after the load, it should blit at the same rate as a BMP. > Out of curiousity, is anyone able to create a HWSURFACE? I'm simply > unable, using the setup below. I realize this is kind of off topic, so > feel free to ignore this question :) SDL doesn't allow for hardware surfaces in X. The only exception I can think of, is DGA, and only the main surface is in video memory. |
|
From: David C. <D. C. <si...@te...> - 2000-04-20 01:52:20
|
I was doing a little video testing, profiling large numbers of blits to the framebuffer, and noticed a few interesting facts... A blit of a 7k bmp from one SWSURFACE to another took less than a millisecond. Woohoo! update_rect((0,0,0,0)) is expensive, but not prohibitivly so. Updating a 640 x 480 surface all at once only took about 20 times longer than updating a 64 x 48 rectangle, in spite of the fact that the surface is 100 times bigger than the rectangle. There was no performance difference between windowed and fullscreen drawing. Blitting a png takes about 50% longer than an identical bmp. (Of course, the png is compressed to 5% of the bmp's size :) Out of curiousity, is anyone able to create a HWSURFACE? I'm simply unable, using the setup below. I realize this is kind of off topic, so feel free to ignore this question :) i586 Celeron 525 Voodoo3 video card XFree86 3.3.5 Kernel 2.2.12 SVGA video driver Preliminary pySDL documentation: http://www3.telus.net/futility/futility/docs/pysdl/index.html -- I'd rather be lost in my empyrean world, Than live down on earth... I can't explain Why I don't belong to this same world - I don't fit in, And I will not stay. - Paula Cole, Saturn Girl |
|
From: Mark B. <mb...@0x...> - 2000-04-19 22:57:47
|
On Wed, 19 Apr 2000, Martijn Faassen wrote: > I'm still not convinced we can't simply accept the slower option if that > makes the API more clean. That's generally the Python approach, after all. You don't have to worry, since I've no intentions of using strings as a source of data, regardless of the paticular performance benefit it offers for MetaKit. StringIO can be used, if people really want to use strings this way. This is the best aspect of Eric's patch. |
|
From: Martijn F. <fa...@ve...> - 2000-04-19 18:17:53
|
Eric Jacobs wrote: > > > Loading from strings directly doesn't seem necessary to me either; you can > > easily use StringIO or cStringIO to wrap the string up as a file-like > > object after all? > > Yes. > > I included that solely on account of performance, not functionality. I've > been doing some cursory testing; it seems that for large images (I used a > 62k 800x600 RGB PNG) it takes roughly the same amount of time whichever > method you load it with, from MetaKit or from the filesystem. But with > small images (an assortment of PNGs from 100 bytes to about 2K), I found > that MetaKit can approach the performance of the filesystem, but only > by loading the image as a string; the amount of data used constructing and > deconstructing wrappers was high relative to the actual amount of image > data being transferred. What about wrapping cStringIO around the string? Have you tried that? > The function overloading is ugly but necessary in this case, especially as > more functions are implemented that use SDL_RWops. I would hate to see the > size of the API mushroom as little functions are multiplied to cover every > little case. I'm still not convinced we can't simply accept the slower option if that makes the API more clean. That's generally the Python approach, after all. Hopefully soon I'll get some time to study all this myself, though. :) Regards, Martijn |
|
From: Mark B. <mb...@0x...> - 2000-04-19 18:00:33
|
On Wed, 19 Apr 2000, Martijn Faassen wrote: > Mark Baker wrote: > So it'll accept both file objects and filenames. > That's overloading it. It's confusing if you can put a filename string into > a function *and* a file object. I'd rather have two differently > named functions, one for the filename string, one for the file object. > Or just the latter; it's trivial to do an open() myself, after all. Yes, it will accept both filenames and file-like objects. If you don't want to supply filenames, then you don't have to. > > For languages like C++, function overloading using different types is common > > place. Though these are through seperate functions, in C++, the internal > > representation to the user of PySDL isn't overly important. > > I know C++ allows stuff like this, but that doesn't mean we should > apply it here. :) I think it pollutes the API to do this, and it just > doesn't seem necessary. I understand it already works like that, so in > that case I'm complaining about the current functionality (I haven't > experimented with it yet). Python also allows for this as well, in a somewhat less 'clean' manner, via type() and the types module. Inspecting an object for read, write, seek, etc methods is no more type pure, either. Does anyone else feel strongly against this? I could change it, I simply see no real reason to. I would simply remove the ability to load from a filename entirely, and leave it to people to manage their files. Seems pointless to me, but I'd like to hear what the consensus is first. |
|
From: Eric J. <ea...@ri...> - 2000-04-19 17:59:44
|
> Loading from strings directly doesn't seem necessary to me either; you can > easily use StringIO or cStringIO to wrap the string up as a file-like > object after all? Yes. I included that solely on account of performance, not functionality. I've been doing some cursory testing; it seems that for large images (I used a 62k 800x600 RGB PNG) it takes roughly the same amount of time whichever method you load it with, from MetaKit or from the filesystem. But with small images (an assortment of PNGs from 100 bytes to about 2K), I found that MetaKit can approach the performance of the filesystem, but only by loading the image as a string; the amount of data used constructing and deconstructing wrappers was high relative to the actual amount of image data being transferred. The function overloading is ugly but necessary in this case, especially as more functions are implemented that use SDL_RWops. I would hate to see the size of the API mushroom as little functions are multiplied to cover every little case. |
|
From: Martijn F. <fa...@ve...> - 2000-04-19 17:13:29
|
Mark Baker wrote: > On Wed, 19 Apr 2000, Martijn Faassen wrote: > > I think we shouldn't overload the load function too much. Can't we > > instead have two functions, one to load from a file object, and another > > to load through a filename? Or perhaps just don't have the last one > > at at all; it's not hard to create a file object after all. Generally > > it's better to have multiple functions instead of one function which > > can receive an argument that can be fundamentally different types (such as > > strings or file-like objects). > > The load function will remain the same, API wise. So it'll accept both file objects and filenames. That's overloading it. It's confusing if you can put a filename string into a function *and* a file object. I'd rather have two differently named functions, one for the filename string, one for the file object. Or just the latter; it's trivial to do an open() myself, after all. > For languages like C++, function overloading using different types is common > place. Though these are through seperate functions, in C++, the internal > representation to the user of PySDL isn't overly important. I know C++ allows stuff like this, but that doesn't mean we should apply it here. :) I think it pollutes the API to do this, and it just doesn't seem necessary. I understand it already works like that, so in that case I'm complaining about the current functionality (I haven't experimented with it yet). > > Loading from strings directly doesn't seem necessary to me either; you can > > easily use StringIO or cStringIO to wrap the string up as a file-like > > object after all? > > I agree. Polluting the API isn't worth the hassle, and its use is fairly > limited. But it's already polluted now. :) This is just confusion: f = "foo.bmp" load(f) and this: f = "foo.bmp" f = open(f, "r") load(f) It should just accept one and not the other. It shouldn't be too smart and try to guess what the user meant; Python isn't Perl after all. It should complain as soon as it gets a string. > > From what I understood from the example, it seems 'file like' objects > > are supported already, as I saw StringIO being used, right? > > In my implementation, file objects are supported. This is a direct type check > in the module, so it doesn't support non-file objects with the same relative > API. > Eric Jacob's patch adds "file-like" object support, via inspecting the object > passed to the various load functions, and determining if they have > read/seek/etc methods; this is why StringIO works in his example. That would indeed be an improvement. Regards, Martijn |
|
From: Mark B. <mb...@0x...> - 2000-04-19 16:06:59
|
On Wed, 19 Apr 2000, Martijn Faassen wrote: > I think we shouldn't overload the load function too much. Can't we > instead have two functions, one to load from a file object, and another > to load through a filename? Or perhaps just don't have the last one > at at all; it's not hard to create a file object after all. Generally > it's better to have multiple functions instead of one function which > can receive an argument that can be fundamentally different types (such as > strings or file-like objects). The load function will remain the same, API wise. For languages like C++, function overloading using different types is common place. Though these are through seperate functions, in C++, the internal representation to the user of PySDL isn't overly important. > Loading from strings directly doesn't seem necessary to me either; you can > easily use StringIO or cStringIO to wrap the string up as a file-like > object after all? I agree. Polluting the API isn't worth the hassle, and its use is fairly limited. > From what I understood from the example, it seems 'file like' objects > are supported already, as I saw StringIO being used, right? In my implementation, file objects are supported. This is a direct type check in the module, so it doesn't support non-file objects with the same relative API. Eric Jacob's patch adds "file-like" object support, via inspecting the object passed to the various load functions, and determining if they have read/seek/etc methods; this is why StringIO works in his example. |
|
From: Martijn F. <fa...@ve...> - 2000-04-19 13:09:24
|
Mark Baker wrote: > On Tue, 18 Apr 2000, Eric Jacobs wrote: > > I have a patch for PySDL 0.0.3 to allow any Python > > file-like object to be loaded or saved as an image. > > It also allows strings to be loaded as data. This > > could be useful for games and other programs that > > might not want to store all of their images in > > individual files. > > I'll need to think about the real need of the introspection, but it seems like > it'd be good to not only support file object, but "file-like" objects, as well. > You mention MetaKit, for instance, which could alleviate hassles of back-end > management. > > Using strings as a source of data, though, seems less useful. Flexible, > perhaps, but it's not worth making the API nasty with an optional argument > indicating whether a string is a filename, or a source of data. I think we shouldn't overload the load function too much. Can't we instead have two functions, one to load from a file object, and another to load through a filename? Or perhaps just don't have the last one at at all; it's not hard to create a file object after all. Generally it's better to have multiple functions instead of one function which can receive an argument that can be fundamentally different types (such as strings or file-like objects). Loading from strings directly doesn't seem necessary to me either; you can easily use StringIO or cStringIO to wrap the string up as a file-like object after all? From what I understood from the example, it seems 'file like' objects are supported already, as I saw StringIO being used, right? Regards, Martijn |
|
From: Mark B. <mb...@0x...> - 2000-04-19 04:25:36
|
On Tue, 18 Apr 2000, Eric Jacobs wrote: > I have a patch for PySDL 0.0.3 to allow any Python > file-like object to be loaded or saved as an image. > It also allows strings to be loaded as data. This > could be useful for games and other programs that > might not want to store all of their images in > individual files. I'll need to think about the real need of the introspection, but it seems like it'd be good to not only support file object, but "file-like" objects, as well. You mention MetaKit, for instance, which could alleviate hassles of back-end management. Using strings as a source of data, though, seems less useful. Flexible, perhaps, but it's not worth making the API nasty with an optional argument indicating whether a string is a filename, or a source of data. > And I hope someone's reading this list, because I > didn't see any messages in the archives... ;) PySDL is a fairly new project. The mailing list archives apparently work on a monthly basis, so the contents of the last few weeks won't be archived for a while. Thanks for the contribution. I'll probably work it into the next release, and alter the sound subsystem (which I'm currently working on) to use it as well. |
|
From: Eric J. <ea...@ri...> - 2000-04-19 02:04:51
|
I have a patch for PySDL 0.0.3 to allow any Python
file-like object to be loaded or saved as an image.
It also allows strings to be loaded as data. This
could be useful for games and other programs that
might not want to store all of their images in
individual files.
So an image could be loaded any of these ways:
i = sdl.image_load("test.jpg")
i = sdl.image_load(open("test.jpg"))
i = sdl.image_load(open("test.jpg").read(), 1)
i = sdl.image_load(StringIO(open("test.jpg").read()))
The extra parameter is used to inhibit PySDL from
interpreting the string as a filename.
The functions that can work that way are: image_load,
image_is, image_load_type, and image_save_bmp. It
should be pretty easy to add support to any function
that uses SDL_RWops.
It works with MetaKit and Mk4py, in two ways:
taking the field straight out as a string, and
using the supplied MkMemoIO.py wrapper class as
a file-like object.
bugs/issues:
Saving to a string works, although it's not supposed
to (since strings are immutable.) Use StringIO or
cStringIO instead.
Exceptions are propagated, however the tracebacks are
sometimes a bit confusing because the actual callback
from C isn't traced. (When using native Python
objects.)
It's assumed that upon receiving an I/O error, SDL
will clean itself up and return an error, and not
try to recover or continue.
sure there's other things...
And I hope someone's reading this list, because I
didn't see any messages in the archives... ;)--spruceEVOHCFYNQPCNSDURERGN
Content-Type: application/octet-stream; name="sdl.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="sdl.diff"
KioqIG9yaWcvc2RsbW9kdWxlLmMJVHVlIEFwciAxOCAxNzo1Njo0MiAyMDAwCi0tLSBzZGxtb2R1
bGUuYwlUdWUgQXByIDE4IDIwOjUxOjQxIDIwMDAKKioqKioqKioqKioqKioqCioqKiAyMywyOCAq
KioqCi0tLSAyMywxNjggLS0tLQogICNkZWZpbmUgbWF4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bmFtZV0pIC0+IGludFxuIgogIAkiVGhpcyBm
dW5jdGlvbiBzYXZlcyB0aGUgU3VyZmFjZSBhcyBhIEJNUCBmaWxlLiI7CiAgCiAgLyogc291bmQg
cmVsYXRlZCBwcm90b3R5cGVzIGFuZCBfX2RvY19fIHN0cmluZ3MgKi8K |
|
From: David C. <D. C. <si...@te...> - 2000-04-18 01:20:03
|
Could anyone who received Mark Baker's pySDL status update for April 17 please forward it to me at si...@te...? I received only a mangled header... Thanks. Preliminary pySDL documentation available at: http://www3.telus.net/futility/futility/docs/pysdl/index.html David "Futility [D!]" Clark | Any sufficiently advanced philosophy | si...@te... | is indistinguishable from despair. | ----------------------------------------------------------------------- |
|
From: Mark B. <mb...@0x...> - 2000-04-17 21:58:34
|
Sorry for my lack of response the last few days; I've been working on constructing a vegetable garden, and Vermont soil consists of mostly rock. So, it's been a long and arduous task, that I'm not nearly finished with, but am taking a short reprieve from. I thought I'd indicate our current developmental status: I've fixed the memory leaks Martijn Faassen pointed out. I would like to thank him for pointing these silly mistakes out for me, as well. I've been puttering with the audio system, which is mostly done. All I need to do is finish the construction of the manipulation/mixing routines, and we'll be set. I've also started going through the code and replacing the non-complex Py_BuildValue calls, with the exact copy-constructor functions. This is mostly for single integer or string returns, where it's not a matter of adding complexity to the code, but does turn a very small amount of efficiency. I've not yet looked into the question of Win32, but from the mail I recieved, it seems more like an issue with the compilation of SDL, than PySDL. The initialization routine is a very thin wrapper over SDL's. I'll see about finding a Win32 machine to compile PySDL on, and see what I can turn up. |
|
From: David C. <D. C. <si...@te...> - 2000-04-16 02:20:04
|
I'm about three-quarters done documenting the event subsystem in 0.0.3. Everything but the joystick functions is pretty much complete - I don't know when I'll get to the joystick, since I don't have one to experiment with :) I've written a short program that should let you explore the pySDL events - it's eventtest.pl, and is in the Examples section of the event page. Whew. 72k of documentation so far; that's a lot of typing :D This is a lot of fun :) Preliminary pySDL Documentation: http://www3.telus.net/futility/futility/docs/pysdl/index.html -- "But why Hell for me?" he asked. "And why for all? Was it not to keep it only for a few that Christ redeemed us?" Father Casper laughed like the God of the damned. "Why, when did He redeem you? On what planet, in what universe do you think you are living now?" - Umberto Eco, The Island of the Day Before |
|
From: Martijn F. <fa...@ve...> - 2000-04-15 12:57:15
|
Hi there,
I've discovered a memory leak in sdl_events_poll() and sdl_events_wait(),
and also fixed them. I noticed my python processes becoming enormously
huge very quickly in my event loop, and tracked it down to this:
sdl.init(sdl.INIT_VIDEO)
while 1:
e = sdl.events_poll()
And obviously that shouldn't happen. What I added was this:
Py_Free(s_event_ref);
in both functions, just before the last return statement:
return Py_BuildValue("i", -1);
That fixed it.
PySDL is way cool, by the way. Python too. Amazing how quickly you can
prototype a nice app; I now have objects which draw themselves when
first used, but draw to a buffer and then later on use blit their
pre-drawed contents, and the rest was pretty easy too. I can't do that
in C or C++ so quickly. :)
Regards,
Martijn
|
|
From: Krolours <kro...@fr...> - 2000-04-13 17:35:49
|
Hello, I'm trying to use pysdl in windows. I built it sucessfully with mingw32 but it does not work as expected : Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import sdl >>> sdl.init(sdl.INIT_AUDIO) 0 >>> sdl.init(sdl.INIT_VIDEO) -1 >>> It seems it can create the pysdl types Surface_Type, CD_Type, ... Maybe someone has ideas about what I made wrong. I'll send patches to the author once it works. pysdl rock ! -- --------------------------------------------------------------------- G.Quiniou kro...@fr... --------------------------------------------------------------------- |
|
From: Mark B. <mb...@0x...> - 2000-04-13 14:54:46
|
On Thu, 13 Apr 2000, "David Clark wrote: > Where does USEREVENT belong? Is it one of the types of events that you > can create using event_new()? Is the space between event types QUIT > (decimal representation 12) and USEREVENT (24) intended for future > expansion? I can only imagine the space, which is the product of the SDL people, is there for future expansion. The USEREVENT is there for people to use with event_new(), in that it should be possible to subclass it and do what they will with it. With no mechanism to really pass around other information, the manner of using it may become a bit convoluted, but I'd rather not stand in the way of someone's creative genius. Practically speaking you might consider it useless, unless of course you find it useful ;-) |
|
From: Mark B. <mb...@0x...> - 2000-04-13 14:47:42
|
On Wed, 12 Apr 2000, "David Clark wrote: > Are these two methods identical? Both take a color number / palette > index and return an RGB tuple. Am I missing something here - are color > number and palette index concepts interchangable? Nahh. get_rgb() takes a color, palletized or not, and converts it into the RGB components for the given surface. It's more or less the opposite of map_rgb() pal_get_at() returns the RGB components of the entry at index in the palette. The palette can be changed, where as the values returned by get_rgb() should be constant for the given surface and color. The palette functions are also only valid for 8-bit surfaces, since they're the only ones with palettes. |
|
From: David C. <D. C. <si...@te...> - 2000-04-13 05:24:47
|
Where does USEREVENT belong? Is it one of the types of events that you
can create using event_new()? Is the space between event types QUIT
(decimal representation 12) and USEREVENT (24) intended for future
expansion?
Thanks.
--
----------------------------------------------------------------
David "Futility [D!]" Clark | Everyone's gotta be something.
si...@te... | Me, I'm garbage.
| It's all I've ever wanted to be.
| Shock me again, and I'll say
| anything you want me to. -MGB
|