On 5 Feb 2000, Marcus Sundberg wrote:

> [EMAIL PROTECTED] (Christoph Egger) writes:
> 
> > > Making it _read_ files does not gain you anything over any other
> > > approach, and is plain wrong.
> > 
> > No. You can easily write a ggiviewer for example (have a look at the
> > attachment).
> 
> If you do what I suggest you can replace the code:
> 
> >     file_vis = ggiOpen("display-file:./author19.bmp");
> > 
> >     ggiCheckMode(file_vis, tm);
> >     ggiSetMode(vis, tm);
> > 
> >     ggiCrossBlit(file_vis, 0,0, tm->virt.x,tm->virt.y, vis,0,0);
> 
> with:
> 
> gflLoadImageToVis(vis, "./author19.bmp");
> 
> and you have not added a bunch of kludgy bloat to the file target.
> (gfl == GGI File Loader)

And what is the sense? (see below too!)

> 
> > > Especially considering that you can't do anything with a visual
> > > until you have set a mode, and ggiSetMode() clears the visual...
> > 
> > I can't follow you here. Please explain it more detailed.
> 
> The ggiCheckMode() and ggiCrossBlit() in your program invokes
> undefined behaviour, because you have not set a mode on file_vis.
> If you did set a mode on file_vis it would be all black.

No. It's not a undefined behaviour. Look:


On Wed, 2 Feb 2000, Andrew Apted wrote:

> Christoph Egger writes:
>
> >  Is anyone here already hacking the file-target?
>
> No, I'm pretty sure no one is working on it.
>
> >  If not, I want to hack it to add support reading some file-formats
> >  (i.e. bmp, tga, pcx).
>
> Go ahead, it would be good.
>
> Semantics wise, you should load the file at init time, & determine the
> properties (width, height, depth).  Then make the CheckMode primitive
> set any GGI_AUTO values to the same as the file, and make the SetMode
> refuse any mode that doesn't match the file (unless you want to
> support scaling/depth conversion... :->).
>
> Make all write primitives (putpixel, drawline, etc) fail, and only
> support the read primitives (you will only need GetPixel_NC to get an
> initial prototype working).
>
> Hope that helps.
>
> Cheers,
> __
> \/   Andrew Apted   <[EMAIL PROTECTED]>
>
>

Christoph Egger
E-Mail: [EMAIL PROTECTED]

Reply via email to