Mail Archives: djgpp/1998/08/14/18:16:48
Endlisnis wrote:
> Bjorn Hansen wrote:
>
> > void set_mode(int mode)
> > {
> > __dpmi_regs r;
> > r.x.ax = mode;
> > __dpmi_int(0x10, &r);
> > };
> >
> > void main()
> > {
> > char smiley[320*200];
> > FILE *pict= fopen("C:\\Cstuff\\smibm.bmp","rb");
> > set_mode(VGA_13h);
> >
> > dosmemput(pict+128,320*200,0xA0000);
> > while(!kbhit());
> > set_mode(TEXT);
> > }
>
> 1] Your set_mode function should have a line like:
> memset(&r, 0, sizeof(r));
> or you might get unexpected (and undesired) results occationally.
Why? what does this do?
>
>
> 2] All you've done is open the file, you never read any data from it.
ok how is this done?
> 3] Bitmap files are not just a series of pixel values, they have many
> different possible styles (and bit-depths), and some are even
> run-length
> encoded and stuff like that. You can't just read it directly to the
> screen,
> you have to interpret the data. And you also have to worry about palettes.
So where can I find out how bmps are stored or maybe a pcx or rle file would be
easier?why should I worry about the palette yet. if it is not the right palette
won't the colors just be wrong but hte same image will come up? the thing I am
trying to display is very simple and only has 3 colors.
Bjorn
- Raw text -