On Wed, 11 Apr 2001, Andreas Beck wrote:
> > When the blitting-operation is done in sync-mode, then it is done
> > immediately. If it is in async-mode, then all blitting-operations
> > that are performed to the given blt-argument to ggiBltFlush() at
> > _once_, when calling ggiBltFlush().
>
> Hmm - what's the sense behind that ? Optimizing ? Do you think it's worth
> the extra effort ?
>
> If I get you right, you would queue the requests in Async-Mode, and then
> batch-execute them - yes ?
>
> Do you think that's worth the bother (allocating memory and taking care that
> it eventually gets deallocated, keeping a chain of blits) ?
>
> I mean you may not modify any source or destination area while such an async
> blit is queued (for sources this can be helped by copying them, but that
> would be real bloat) - won't that be confusing ?
A few mails ago you said:
-----------------------------------------------------------
Basically the idea is that you define a BOB and ask libblit to cache
it for you in some way so that it can be blitted as fast as possible
later on
-----------------------------------------------------------
You can do that very efficiency in that way, no?
CU,
Christoph Egger
E-Mail: [EMAIL PROTECTED]
P.S.: I've attached the latest API of libblt.
/*
******************************************************************************
LibBLT: extension API header file
Copyright (C) 2001 Christoph Egger [[EMAIL PROTECTED]]
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************************
*/
#ifndef _GGI_BLT_H
#define _GGI_BLT_H
#ifndef _GGI_INTERNAL_GII_H
#include <ggi/ggi.h>
#endif
__BEGIN_DECLS
#include <ggi/galloc.h>
/* Extension management
*/
int ggiBltInit(void);
int ggiBltExit(void);
int ggiBltAttach(ggi_visual_t vis, ggiGA_resource_list *reqlist);
int ggiBltDetach(ggi_visual_t vis);
/* Structure
*/
#ifdef HAVE_STRUCT_BLT
typedef struct ggiBlt *ggiBlt_t;
#else
struct ggiBlt { };
typedef struct ggiBlt *ggiBlt_t;
#endif
struct ggiBlt_source {
ggiBlt_t blt;
ggi_visual_t vis;
enum ggiGA_rop rop;
/* 0 means to use vis as blt-source and
* non-zero to use blt as blt-source
*/
int flag;
};
typedef ggiBlt_source *ggiBlt_source_list;
/* SYNC/ASYNC mode. Blits instantly or when thw HW likes to. Default is sync */
#define BLTFLAG_SYNC 0x0000
#define BLTFLAG_ASYNC GGIFLAG_ASYNC
/* API functions
*/
int ggiBltAddBob(ggiGA_resource_list *reqlist,
struct GA_ResourceProperties *props,
ggiGA_resource_handle *handle);
ggiBlt_t ggiBltTie(ggiGA_resource_handle handle);
int ggiBltUntie(ggiBlt_t *blt);
ggiBlt_t ggiBltCreateBob(ggi_visual_t vis,
struct GA_ResourceProperties *props);
int ggiBltDestroyBob(ggiBlt_t *blt);
ggiGA_resource_handle ggiBltGetHandle(ggiBlt_t blt);
/* Set the default base for the coordinates: Either pixels or dots
*/
int ggiBltSetCoordBase(ggiBlt_t blt, enum ggiGA_coord_mode cm);
int ggiBltSetSyncMode(ggiBlt_t blt, ggi_flags sync);
/* Does all blitting operations, if it is in ASYNC -mode */
int ggiBltFlush(ggiBlt_t blt);
/* Set the given image (vis) to the blt-area with grabbing the image
* from a visual at pos (x,y)
*/
int ggiBltSetImage(ggiBlt_t blt, ggi_visual_t vis,
int x, int y, unsigned char *alpha);
int ggiBltCrossBlit(ggiBlt_t src, ggiBlt_t dst,
int width, int height,
enum ggiGA_rop rop);
/* Multi-Source blitting operation. Blits all bobs from
* the source-list into blt using the given rop from the list.
* It performs stretching, if width and height are != 0
*/
int ggiBltMultiCrossBlit(ggiBlt_source_list src, size_t nmemb,
ggiBlt_t blt, int width, int height);
int ggiBltPolyCrossBlit(ggiBlt_source_list src, size_t nmemb,
ggiBlt_t blt, int width, int height);
int ggiBltBlit2Vis(ggiBlt_t blt, ggi_visual_t vis,
int dx, int dy, int width, int height,
enum ggiGA_rop rop, enum ggiGA_coord_mode cm);
int ggiBltVis2Vis(ggi_visual_t src[], size_t nmemb,
ggi_visual_t dst, int dx, int dy, int width, int height,
enum ggiGA_rop rop[], enum ggiGA_coord_mode cm);
__END_DECLS
#endif /* _GGI_BLT_H */