From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: fast vbe graphics Date: Mon, 7 Apr 1997 08:19:50 +0100 Organization: None Distribution: world Message-ID: References: <01IHEKLS7NOI92SA7U AT NICKEL DOT LAURENTIAN DOT CA> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 35 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp >I'm trying to get fast vbe 2.0 (with linear frame buffer) graphics >at 640x480x256 yet am having some difficulties. > >for(int i=0; i < 307200; i+=4) >{ > temp = ((unsigned long)(video[i])) << 24\ > + ((unsigned long) (video[i+1])) << 16\ > + ((unsigned long) (video[i+2])) << 8\ > + ((unsigned long) (video[i+3])); Why such a complicated approach? It's possible that gcc might optimise that out to a single 32 bit read, but I rather doubt it! It would be a lot more efficient to write: temp = ((unsigned long *)video)[i/4]; >where temp is a unsigned long and I've already done a >_farsetsel(my_video_ds) but I'm not having much success. Where does the my_video_ds come from? If you aren't getting anything on the screen, I'd be suspicious of the code that sets it up. Look at Allegro for some working LFB routines... >I know univbe can do about 60 fps on my system at 640x480x356 but >it uses multiple pages. Does anyone know how to use multiple pages or Draw to a part of video memory after the initial 640x480 page (obviously only going to work if there is enough video ram in the machine!) and then use the VESA set-display-start function to alter which part of the memory is visible. -- Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ Beauty is a French phonetic corruption of a short cloth neck ornament.