|
Screen Update API: final draft |
Richard Phipps
Member #1,632
November 2001
|
In chris's code it's : buffer = create_bitmap(SCREEN_W, SCREEN_H); |
23yrold3yrold
Member #1,134
March 2001
|
Quote: However buffer itself is not being checked to see if it was created properly. Or indeed cleared of any old data.
buffer = create_bitmap(SCREEN_W, SCREEN_H); if(pages[0] && pages[1] && buffer) { clear_bitmap(pages[0]); clear_bitmap(pages[1]); clear_bitmap(buffer); ...
Anyway, I'm going to check this now ... -- |
Richard Phipps
Member #1,632
November 2001
|
In the zip I downloaded it is:
So I must have an earlier version. Sorry about that.. |
23yrold3yrold
Member #1,134
March 2001
|
That's both old, and the triple buffering code. -- |
Richard Phipps
Member #1,632
November 2001
|
But you still have: Your new code looks much better. |
23yrold3yrold
Member #1,134
March 2001
|
I'll be buggered. Steve was right; something I copied and pasted over from PAGE_FLIP to PAGEFLIP_WMB assigned a video bitmap to the buffer (after it had already been assigned the memory buffer) in the drawing code. The main program now reports the type of buffer for any given mode, but now that it's working correctly it's kind of not necessary. Fixed and attached. Page flipping is indeed choppy for me in windowed mode too, but I don't think you can get away from that ... -- |
Richard Phipps
Member #1,632
November 2001
|
I think page flipping in a window is just choppy what ever you do. Glad to see you fixed the code. |
Steve Terry
Member #1,989
March 2002
|
Cool it works now I still suggest doing the #ifndef UPDATE_SCREEN_H part for multiple file projects... otherwise you are going to get errors. Hey do I get to go on the beta tester list now I found and helped fix a bug ___________________________________ |
23yrold3yrold
Member #1,134
March 2001
|
Quote: I still suggest doing the #ifndef UPDATE_SCREEN_H part for multiple file projects ... Right; I forgot that. Added. Quote: Hey do I get to go on the beta tester list now I found and helped fix a bug List? There's a list? -- |
Richard Phipps
Member #1,632
November 2001
|
Chris, would you be prepared to add in a DRS system if Axilmar or someone else was to code it? |
Steve Terry
Member #1,989
March 2002
|
You need at least a README in there for those who wish to use it, not everyone is inclined to dig through .c files to figure out how to use it ___________________________________ |
23yrold3yrold
Member #1,134
March 2001
|
Quote: Chris, would you be prepared to add in a DRS system if Axilmar or someone else was to code it? Depends on how its done. I have no idea what a DRS system entails and I don't know what it'll do to the API. If can be written to work alongside my API, bodacious. I'm definitely open to the idea. Quote: You need at least a README in there for those who wish to use it Well, yeah. But that's when it's ready to be "released", and especially after a bug like you found, it ain't. Plus a DRS might muck up the API, so ... -- |
Richard Phipps
Member #1,632
November 2001
|
It shouldn't mess up the API or your system at all if done right. Maybe Axilmar can help with this. I'm going to be a bit busy setting everything up.. |
axilmar
Member #1,204
April 2001
|
Yes, a DRS system is completely independent from what Chris does. It is only conceptually that they belong together. EDIT: as for me doing it, come on people! activate yourselves! I am busy designing the gui! I can't do it all! |
23yrold3yrold
Member #1,134
March 2001
|
I've had my say. I don't know how and I don't care how. Haven't a few of you guys already made DRS systems? Clean it up and post it ... -- |
Richard Phipps
Member #1,632
November 2001
|
There are plenty of people here who unlike me aren't busy.. cough X-G, cough.. |
Steve Terry
Member #1,989
March 2002
|
I have mine, axilmar has his, both are completely independent of a screen update API, however if you want mine just copy nas_drs.h and nas_drs.c from the NAS library ___________________________________ |
23yrold3yrold
Member #1,134
March 2001
|
DOKUMINTASHUN!!1
Anything to add? -- |
Richard Phipps
Member #1,632
November 2001
|
Excellent! You've been busy. |
Evert
Member #794
November 2000
|
Ah yes, I meant to ask about this: Quote: UPDATE_TRIPLE_WMB and UPDATE_PAGEFLIP_WMB are for times you're using a lot of blending or whatnot What's the advantage over using a plain double buffer for this case? I don't see any, to be honest. I have yet to merge the code with the current Allegro tree and API, although I have integrated it with a start for an improved graphics API (with a few changes - the initialization fails if a mode isn't supported rather than trying another one, for instance). |
23yrold3yrold
Member #1,134
March 2001
|
Quote: What's the advantage over using a plain double buffer for this case? I don't see any, to be honest. Neither do I. I just put it in at the request of others, and the more I think about it the dumber it seems. Quote: the initialization fails if a mode isn't supported rather than trying another one, for instance What?! I was so proud of that! PS: Would it be safe to install shutdown_screen_updating() as one of those atexit() function calls? -- |
Richard Phipps
Member #1,632
November 2001
|
I use it. Trust me it's very good. Especially with a scrolling screen as you have the advantages of a memory bitmap with smooth updating without flickering. |
Evert
Member #794
November 2000
|
Quote: What?! I was so proud of that!
Well, it went into what is basically a replacement for set_gfx_mode(), and it felt a bit too complicated. My take here was to have the function do what it's asked to do and not try to be smart if it can't do it. Quote: Especially with a scrolling screen as you have the advantages of a memory bitmap with smooth updating without flickering. I still don't really see the advantage over a plain double buffer, actually... |
23yrold3yrold
Member #1,134
March 2001
|
Oh, okay. You've made some huge changes there. I'll submit it as is to the code resource then. -- |
Evert
Member #794
November 2000
|
I plan to backport it to 4.1 though. Don't let that stop you anyway. |
|
|