On Wed, 7 Feb 2001, Brian S. Julin wrote:

> 
> On Tue, 6 Feb 2001, Christoph Egger wrote:
> > ggiOvl_t ggiOvlAllocate(ggi_visual_t vis, int width, int height);
> 
> How about:
> 
> ggiOvl_t ggiOvlAllocate(ggi_visual_t vis, int width, int height, void *props);
> 
> ...The extra arg can be unused (NULL) now but can later be used to specify
> and return properties the VRAM/Ovl must have, which will help when we actually
> get to the point of negotiating with a KGI driver.

I understand, what you mean.


The current form of it is:

ggiOvl_t ggiOvlAllocate(ggi_visual_t vis, enum Overlaytype type,
                        int width, int height);

where Overlaytype is:

enum Overlaytype {
        /* A real sprite - does not affect display memory */
        OVL_SPRITE,

        /* Useful to handle streaming video */
        OVL_VIDEO,

        /* An area somewhere outside of the framebuffer */
        OVL_WINDOW,
};


But to allow to specify the properties of VRAM/Ovl as you suggested I
added this one:

int ggiOvlCheck(ggi_visual_t vis, enum Overlaytype type,
                void *properties, int width, int height);

Its behaviour is similar to ggiCheckMode();

Is this OK?


BTW: The attached file contains the current API


Christoph Egger
E-Mail: [EMAIL PROTECTED]
/*
******************************************************************************

   LibOVL: 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_OVL_H
#define _GGI_OVL_H

#include <ggi/ggi.h>

__BEGIN_DECLS



/* Extension management
 */
int ggiOvlInit(void);
int ggiOvlExit(void);

int ggiOvlAttach(ggi_visual_t vis);
int ggiOvlDetach(ggi_visual_t vis);


/* Structure
 */

#ifdef HAVE_STRUCT_OVL
typedef struct ggiOvl *ggiOvl_t;
#else
typedef void *ggiOvl_t;
#endif


enum Overlaytype {
        /* A real sprite - does not affect display memory */
        OVL_SPRITE,

        /* Useful to handle streaming video */
        OVL_VIDEO,

        /* An area somewhere outside of the framebuffer */
        OVL_WINDOW,
};


enum OverlayOptiontype {

        /* Used for transluency effects */
        OVLOP_ALPHA,

        /* Used for blending-effects */
        OVLOP_BLENDING,

        /* Used for setting up a hw-source for images */
        OVLOP_SRC,
};




/* API functions
 */




/* checks, if a area of VRAM is available. If not, then it fails
 * else it allocates it with the given size.
 */
ggiOvl_t ggiOvlAllocate(ggi_visual_t vis, enum Overlaytype type,
                        int width, int height);


/* checks, if the given type of overlay with the given properties
 * will work. If not, then the modified properties passed back
 * should work. If NULL is passed back, then NOTHING would work
 * on the current target.
 */
int ggiOvlCheck(ggi_visual_t vis, enum Overlaytype type,
                void *properties, int width, int height);


/* free's the allocated area by ggiOvlAllocate
 */
int ggiOvlFree(ggiOvl_t ovl);


/* Set the given image (vis) to the ovl-area with grabbing the image
 * from a visual at pos (x,y)
 */
int ggiOvlSetImage(ggiOvl_t ovl, ggi_visual_t vis,
                        int x, int y, unsigned char *alpha);


/* To control the effects of the overlay, like transparency,
 * setting a hardware source for the image etc.
 */
int ggiOvlSetOption(ggiOvl_t ovl,enum OverlayOptiontype op,void *arg);


/* moves the ovl-area to (x,y), where (x,y) is the top-left corner
 * of the ovl-area.
 */
int ggiOvlMove(ggiOvl_t ovl, int x, int y);


/* shows/hides the ovl-area
 */
int ggiOvlShow(ggiOvl_t ovl);
int ggiOvlHide(ggiOvl_t ovl);
int ggiOvlIsHidden(ggiOvl_t ovl);


__END_DECLS

#endif /* _GGI_OVL_H */

Reply via email to