delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/07/20:49:25

From: Larry Swanson <laswanson AT mwci DOT net>
Newsgroups: comp.os.msdos.djgpp,rec.games.programmer
Subject: weirdd32 bit lines in VESA 2.0
Date: Fri, 30 May 1997 21:08:23 -0500
Organization: MidWest Communications, Inc.
Lines: 49
Message-ID: <338F8816.43DF28C6@mwci.net>
NNTP-Posting-Host: dial-33.man.mwci.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

    I finally figured out how to access the linear frame buffer in VESA
using DJGPP.(I'm using 640x480x16M and far pointers)   I am trying to
make a short little demo that will make lines start from the corner and
converging in the center.
    I could do it start at black and fading to red so I copied my code
and changed it so it would start at black and fade to blue.  When I plot
lines from (639,0) to (640-loop,320) and from (639,479) to
(640-loop,320) it will plot the Line but then the line to rhe right of
it will be black, which is not what I want.

I have tested my put pixel code at all corners of the screen and with
all 3 primary colors and it always worked right.
I have no idea what else to check for(it works when my lines go from the
left side of the screen to the middle) and I would really aprreciate
someon looking at this and hopefully pointing ou a blatant error or
assumption.

PS-It makes no difference to me if you respond by email or by newsgroup.

PPS Thank you

my code is here:
     color_add=0x00010000l;
     color=0x00000000;
     for(loop=0;loop<80;loop++){
        Line(0,0,loop,240,color);
        Line(0,479,loop,240,color);
        Line(639,0,640-loop,240,color);
        Line(639,479,640-loop,240,color);
        color+=color_add;
     }
     for(loop=80;loop<321;loop++){
        Line(0,0,loop,240,color);
        Line(0,479,loop,240,color);
        Line(639,479,640-loop,240,color);
        Line(639,0,640-loop,240,color);

        Line(0,0,320,loop-80,color);
        Line(639,0,320,loop-80,color);
        Line(0,479,320,560-loop,color);
        Line(639,479,320,560-loop,color);

        if(color>=0x00ff0000) color_add=  - 0x00010000l;//when i try
blue it is -0x1;
        if(color<=0x00010000) color_add= 0x00010000l;//when i try blue
it is 0x1;
        color+=color_add;
     }

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019