![]() |
|
Graphics API proposal (take 5) |
Bob
Free Market Evangelist
September 2000
![]() |
Yes, I know it'll destroy all video bitmaps. But keeping memory copies and updating those pretty much halves the speed (or worse) of any operation on video bitmaps... -- |
Thomas Harte
Member #33
April 2000
![]() |
Quote: But keeping memory copies and updating those pretty much halves the speed (or worse) of any operation on video bitmaps... True, but for most people operations on video bitmaps are sub-optimal anyway (compared to most other bitmap types), and the main purpose of them is to enable hardware accelerated (masked) blitting of static images. Perhaps you could offer backup and restore functions for video bitmaps which back them up to main memory and restore them to video space? The main argument for taking this into the API being that not all targets will require the calls to actually do anything, since as you say in Allegro 5 not all targets use the same memory pool for display buffers and video bitmaps. [My site] [Tetrominoes] |
Funklord
Member #467
June 2000
![]() |
My personal opinion would go to have separate functions for all blitting types for optimum speed, but with a common interface. void al_blit(AL_BITMAP* dest, AL_BITMAP* src, int x, int y); void al_blit_section(AL_BITMAP* dest, AL_BITMAP* src, int x, int y, int sx, int sy, int sw, int sh); void al_blit_scaled(AL_BITMAP* dest, AL_BITMAP* src, int dx, int dy, int dw, int dh, int sx, int sy, int sw, int sh); void al_masked_blit(AL_BITMAP* dest, AL_BITMAP* src, int x, int y); void al_masked_blit_section(AL_BITMAP* dest, AL_BITMAP* src, int x, int y, int sx, int sy, int sw, int sh); void al_masked_blit_scaled(AL_BITMAP* dest, AL_BITMAP* src, int dx, int dy, int dw, int dh, int sx, int sy, int sw, int sh);
If many people are looking for a quick search&replace upgrade to allegro 5.0 ---------------------- Age is inversely proportional to how much drink you've had - Funklord |
MindCode
Member #2,031
March 2002
![]() |
This is looking really sweet so far. Gives me high hopes for Allegro 5. I agree with 'al_draw' rather than 'al_blit'. Makes more sense as it has a wider meaning. I also like the state changes via a string. It would really make it easy for a user to edit settings during runtime via a console/scripting system. Hey and that 'al_main' thing Losing the 'screen' global is a great idea and multi windowing is definately an issue i had with allegro4. The only problem I have is with the differentiation between structures and functions. Hungarian is obviously not an option, so I suggest that structures be written as: struct AL_structure_name { Capitol 'AL_'. Good work Bob! ______________________________________ |
Cage
Member #1,277
March 2001
|
I propose that rather than something like:
----- |
Korval
Member #1,538
September 2001
![]() |
Using alDraw is not a good idea compared to alBlit. Blit is an operation that anyone doing anything in 2D should know. If they don't know what a blit is, then they should educate themselves. By the same token, if someone is playing with 3D and they don't know what a matrix is used for, they need to educate themselves. |
MindCode
Member #2,031
March 2002
![]() |
I suggested that function typeing too Cage. Bob didn't go for it.:-[ I also agree with using 'alDraw' instead of 'alBlit'. ______________________________________ |
Richard Phipps
Member #1,632
November 2001
![]() |
See my earlier message in this thread: "hmm.. the problem with al_draw is that doesn't explicitly say that it's for blitting. What I mean is that you could have al_draw_line, al_draw_rectangle, al_draw_circle, and then al_draw.. may be confusing what al_draw actually does to newbies at first. I agree blit is a bit of a technical word for newbies too. I suppose you could call it al_copy_block or al_draw_block, but that's getting a little long winded to type for a very common function name." Rich. |
MindCode
Member #2,031
March 2002
![]() |
I think any newbie would learn quite quickly from the documentation what 'al_draw' is for. And if they don't read the doc's, they should be slapped upside the head. And I had another idea too. Allegro add-on paks should reform their api to conform with the new allegro api. So that paks like AllegroGL having the function name: allegro_gl_blit(); Is quite long winded. It should follow a tighter syntax like the new allegro. agl_blit(); Or as I was saying before: agl_draw(); And this is all arbitrary since I think AllegroGL should be part of mainstream Allegro. ______________________________________ |
23yrold3yrold
Member #1,134
March 2001
![]() |
For the love of all that's holy, call it al_blit -- |
Richard Phipps
Member #1,632
November 2001
![]() |
Thank you very much 23yr3yrold! I am completely in agreement about this idea of using al_draw. It's an unneccessary step backwards to a less descriptive function name as well. hmmm.. let's call load_bmp, al_load.. and while we are at it let's have al_scare and al_unscare too.. Do you get what I mean about al_draw being unclear compared to al_blit yet, when we would already have al_drawline and al_drawcircle? Rich. |
Cage
Member #1,277
March 2001
|
Actually, I'd like to retract my opinion that the new API should have functions like "myFunctionName" instead of "my_function_name". I tried coding with the former and it looks quite messy
----- |
Peter Hull
Member #1,136
March 2001
|
I'm as dumb as toast and I still know what a blit is. It's a BIt Transfer with L in the middle Pete
|
Funklord
Member #467
June 2000
![]() |
Just to make it clear, in C coding, there are unwritten laws that clearly state that Capital and small letters should never be mixed. Only Microsoft code uses AlBlitDrawBitmap style. I agree totally to the opinion that blit should not be changed to draw, which is less descriptive Having flags passed to a blit function adds a huge load to a low level function, we need to have many different ones so you don't need to pass arguments unneccessarily. ---------------------- Age is inversely proportional to how much drink you've had - Funklord |
Bob
Free Market Evangelist
September 2000
![]() |
Blit actually means BLock Transfer, with an 'i' in the middle -- |
MindCode
Member #2,031
March 2002
![]() |
bIt BLock Transfer but the letters are all gobboly goo. ______________________________________ |
Richard Phipps
Member #1,632
November 2001
![]() |
Funklord, I think my code breaks the unwritten capital law! I write my functions roughly like this: AL_block_transfer_blit(); oops..
Rich. |
spellcaster
Member #1,493
September 2001
![]() |
I'd like to propose a new function for text printing: al_textprintf(AL_BITMAP *dst, int x, int y, AL_FONT *font, int color, int align, char *format, ...); Nothing new here but the align paramter. It could be AL_LEFT_ALIGN, AL_CENTER_ALIGN or AL_RIGHT_ALIGN. This way we can avoid having the xxx_center xxx_right versions of the text functions. -- |
Richard Phipps
Member #1,632
November 2001
![]() |
Great idea spellcaster! Why don't you have a look at the thread in this forum I made for a new masked_blit function and tell me what you think? Danke, |
MindCode
Member #2,031
March 2002
![]() |
I suppose if 'align' is non-zero then the 'x' parameter would be ignored. ______________________________________ |
spellcaster
Member #1,493
September 2001
![]() |
Nah. The x parameter should be used the same way as in the current functions. It's either the left-most point, the center point or the right-most point. -- |
Korval
Member #1,538
September 2001
![]() |
Quote: Just to make it clear, in C coding, there are unwritten laws that clearly state that Capital and small letters should never be mixed. Only Microsoft code uses AlBlitDrawBitmap style.
We're programmers. Calling us "insane programmers" is just restating the obvious |
Bob
Free Market Evangelist
September 2000
![]() |
spellcaster: Add to that separate foreground / background colors and you'd be set. -- |
spellcaster
Member #1,493
September 2001
![]() |
Background colors? I see no reason to keep that solid bg textout in the new version. Unless it will fade the antialiased font to the background color, of course -- |
Bob
Free Market Evangelist
September 2000
![]() |
Hmm, actually, that might be a good idea. -- |
|
|