PDA

Click to See Complete Forum and Search --> : This can REALLY help out Graphics programmmers who use DOS. Source included


Warmaster199
Mar 6th, 2001, 04:36 PM
This is for DOS and possibly windows programmers who use C/C++.

VESA http://www.VESA.org

You may have heard of VESA(Video Electronics Standards Association) from in games, windows, etc... But what is VESA? VESA is a set of standard functions that will work on most/all VESA compliant video cards(basically, any card after 1995). The most common functions to get/set GFX modes go as follows:

void setvideomode(int mode)
{
union REGS in,out;
in.x.ax = 0x4F02; in.x.bx = mode; /*0x4F02 - VESA set mode.*/
/* I believe non VESA uses 0x00 */
int86(0x10,&in,&out);
}

int getvideomode(void)
{
union REGS in,out;
in.x.ax = 0x4F03; /*0x4F03 - VESA Read mode */
int86(0x10,&in,&out);
return out.x.bx;
}

The above functions use VESA controls as shown. For the mode argument for setvideomode(); you can put in a hex or normal number to set the mode. Almost every card has different values for different modes except for 0x00 to 0x13(VGA modes, all cards), and 0x100 to 0x11B(VESA card specific modes) For non-VESA cards, you would have to ask the vendor what the hex numbers are... VESA makes it easier because ALL VESA cards have the numbers 0x100 to 0x11B. Using VESA, you can forget older modes for your DOS programs such as 320x200x256colors. With VESA, you can select one of the hex mode numbers and switch to better graphics modes such as 1024x768x16.8Million colors(0x118).

I hope this has helped many of the programmers on this site with this sometimes useful information. Another thing, How do you know if you have a VESA card? Run the program in the attached .zip file. The source code is also included. The source shows many useful info, including your VESA version.