|
|
| Allegro new style??? |
|
Thomas Harte
Member #33
April 2000
|
That article certainly clears up any concern over a busy wait ever being necessary to implement the existing timer spec. I'm a little confused though - have you linked your MsgWaitForSingleObject to a timer object or are you making creative use of the timeout parameter? If the latter, will the (Allegro) timer not be expected to very slightly lose time on account of its own processing overhead? [My site] [Tetrominoes] |
|
Peter Wang
Member #23
April 2000
|
Creative use of the timeout parameter. The MsgWaitForSingleObject is mainly there to wait on a "stop this thread" object, so that another thread can tell the timer thread that it needs to terminate. However, time will not drift because we always check what the current time is (using QueryPerformanceCounter or timeGetTime) after waking up. You'd have to do this regardless of what method you use to do the sleeping.
|
|
Thomas Harte
Member #33
April 2000
|
Quote: You'd have to do this regardless of what method you use to do the sleeping. Only once the question of whether an internal OS object is providing a timer signal is answered in the negative. However I do see that my question was very badly worded, it was merely intended to obtain some sort of assurance to the effect that such matters were being taken into consideration. Anyway, the main point for posting again - if there is to be no official way for a user to produce their own event sources, would it be possible to add a single function allowing messages to be pushed onto event queues? E.g. bool al_post_event(AL_EVENT_QUEUE *queue, AL_EVENT *event) And to obtain an absolute guarantee that queues are thread safe regardless of platform? [My site] [Tetrominoes] |
|
Peter Wang
Member #23
April 2000
|
Yes, that should be fine.
|
|
Thomas Harte
Member #33
April 2000
|
Quote: Yes, that should be fine. Are the future API proposal docs at sourceforge being updated? If not is there somewhere else (presumably wiki flavoured) that hosts the new API? If not would it be beneficial to start it somewhere (Tomasu's server maybe?), and if so would it be acceptable for a non-dev (such as me) to kick it off by transcribing the material on sourceforge? [My site] [Tetrominoes] |
|
Peter Wang
Member #23
April 2000
|
The `future' docs aren't being updated. I think Tomasu's wiki is the best place to do that work now. Go right ahead.
|
|
Thomas Harte
Member #33
April 2000
|
Quote: The `future' docs aren't being updated. I think Tomasu's wiki is the best place to do that work now. Go right ahead. I am doing this now. I have the first of what will probably be several requests for clarification. This concerns al_map_yuv422 and al_unmap_yuv422. Why are the 422 appended? It is my understanding that 422 means "in every 4 pixels Y is sampled 4 times, U twice and V twice". It's therefore nothing whatsoever to do with these functions, which are merely creating single colours suitable for an RGB buffer from YUV sources. I also note that the function description of al_map_yuv422 refers to it purely as al_map_yuv. [My site] [Tetrominoes] |
|
Wil Renczes
Member #5,921
June 2005
|
(Without knowing anything about the code, mind you) I'm guessing that it's probably labelled 422 since there are different types of YUV color spaces - 422, 411 (ie DV), YUVA (for compositing), etc. If it's a color lookup conversion function, it would make sense to specify the source color space precisely. |
|
Bob
Free Market Evangelist
September 2000
|
Quote: This concerns al_map_yuv422 and al_unmap_yuv422. Why are the 422 appended? Where do you see this? I can't find "422" in http://awiki.tomasu.net/bin/view/Main/Graphics -- |
|
Thomas Harte
Member #33
April 2000
|
Quote: I'm guessing that it's probably labelled 422 since there are different types of YUV color spaces Admittedly the 422 suffix appears twice (on map and unmap) whereas the version without 422 suffix appears only once (in the comments for map), so it does seem more likely that there is a reason I'm just ignorant of rather than that there is no reason and someone else was having a bad brain day. Am I also to take it that an AL_DISPLAY * is castable to an AL_BITMAP * with no possible ill side effects? Quote: Where do you see this? I can't find "422" Yes, that'll be my non-perfect transcription. I was waiting to append 422 to those if someone confirmed it was correct, feeling that since the API proposal includes both forms I was not being untrue to the document to pick that one. I naturally intend to double check everything I write and obviously will not deliberately alter anything. 422 occurs in http://alleg.sourceforge.net/future/gfx-api.txt. It seems that the map function once had an x parameter (which would make sense if 422 means what I think it means) but that it has been removed as "useless". EDIT: And another one for the developers - why are hline and vline retained? In the modern world either all line drawing will be accelerated or else the CPU will be doing the work, meaning that memory bandwidth is the bottleneck rather than how quickly the CPU can work out where the next pixel should go. [My site] [Tetrominoes] |
|
Evert
Member #794
November 2000
|
Quote: Am I also to take it that an AL_DISPLAY * is castable to an AL_BITMAP * with no possible ill side effects?
No. I'll post an updated description of the distinction and the current implementation of the graphics API when I have time, for now I can only refer you to the headerfiles with the prototypes: Quote: EDIT: And another one for the developers - why are hline and vline retained? In the modern world either all line drawing will be accelerated or else the CPU will be doing the work, meaning that memory bandwidth is the bottleneck rather than how quickly the CPU can work out where the next pixel should go. Consider it an outdated part of the draft then. As you've seen, none of it was updated recently. If you're transcribing it, don't bother transcribing the part about source clipping surfaces and the complicated interplay between different clipping areas in the draft. According to Bob, it's more trouble than it's worth, and I belief him on that. |
|
Bob
Free Market Evangelist
September 2000
|
Quote: 422 occurs in http://alleg.sourceforge.net/future/gfx-api.txt. It seems that the map function once had an x parameter (which would make sense if 422 means what I think it means) but that it has been removed as "useless". You're right, it shouldn't be there. The YUV mode can be inferred from the bitmap parameter. The "x" parameter was removed because we can form two pixels of data from one call to al_map_yuv(), and have the various drawing routines pick whichever of the two pixels they need from that. -- |
|
Thomas Harte
Member #33
April 2000
|
Quote: No. Then inevitably I have to ask, how do you ever draw anything to an AL_DISPLAY? All the drawing functions only operate on AL_BITMAPs. I know it is much more likely that I'm missing something rather that the spec is deficient, but because I'm missing something I must ask. Quote: don't bother transcribing the part about source clipping surfaces and the complicated interplay between different clipping areas in the draft. According to Bob, it's more trouble than it's worth, and I belief him on that. Okay, thanks for the warning. I'm transcribing very slowly, so please warn me if you think of anything else, even if it isn't for quite a while... Quote: The "x" parameter was removed because we can form two pixels of data from one call to al_map_yuv(), and have the various drawing routines pick whichever of the two pixels they need from that. Clever! [My site] [Tetrominoes] |
|
Evert
Member #794
November 2000
|
Quote: Then inevitably I have to ask, how do you ever draw anything to an AL_DISPLAY? All the drawing functions only operate on AL_BITMAPs. I know it is much more likely that I'm missing something rather that the spec is deficient, but because I'm missing something I must ask.
As I said, there are differences between the draft and the current implementation. It's in the headerfile I linked to, but I can understand you missed it: Have a look at the exupdate using the new display API:
|
|
|
|