Index: [thread] [date] [subject] [author]
  From: Steve Cheng <elmert@ipoline.com>
  To  : ggi-develop@eskimo.com
  Date: Wed, 9 Sep 1998 23:01:30 -0400 (EDT)

Re: Looked through the CVS ...

Ok, let's hope I get it right this time...

int numbufs = ggiDBGetNumBuffers(vis);

for(i=0; i<numbufs; i++)
{
	ggi_directbuffer *db;
	int frameno;

	db = ggiDBGetBuffer(vis, i);

	if(!(db->type & GGI_DB_SIMPLE_PLB))
	{
		/* We don't handle anything but simple pixel-linear buffers.
		   Fall back to ggiPutBox() or something. */
		continue;
	}

	frameno = db->frame;

	if(readptr[frameno] != NULL &&
		(db->buffer.plb.pixelformat->flags & GGI_PF_REVERSE_ENDIAN))
	{
		continue;
	}

	readptr[frameno] = db->read;
	writeptr[frameno] = db->write;

	/* Stride of framebuffer (in bytes). */
	stride[frameno] = db->buffer.plb.stride;

	/* Check pixel format, be portable.... */



> To answer your question, yes the new system was designed to support
> any number of DBs per frame. If there are multiple ones you check
> the db->type field to find out what it is.

Any ways to determine the 'best' directbuffer for a given frame?  (I'm
thinking applications usually only want to deal with one buffer per frame,
even though libGGI may offer alternatives, as I found out.) The above just
selects one with native endian if possible.  Or please provide another
example...


--
Steve Cheng

email: steve@ggi-project.org
www: <http://shell.ipoline.com/~elmert/>;

Index: [thread] [date] [subject] [author]