REALTECH VBE 2.0 CORE Library 

VBE 2.00 Library Reference

INITIALIZATIONS FUNCTIONS

Prototype : VBE_RESULT VBE_Initialize(); 
Description : Initialize VBE engine. You should call RM_Initialize() before. Success if returns VBEERR_NOERR.

Prototype: void VBE_Release(); 
Description: Release VBE engine. Notes that it doesn't release RM Manager.

Prototype: const char * VBE_GetStringErr(VBE_RESULT err); 
Description: Convert a error code to english message string.

Prototype: VBE_MODE VBE_FindDisplayMode(int width, into height, int bitsPerPixel); 
Description: Find a desired display mode according criteria (width, height and screen depth).  if returns 0, then there is no video modes that match criteria.

Prototype: VBE_RESULT VBE_SetDisplayMode(VBE_MODE mode); 
Description: Set desired display mode. Success if returns VBEERR_NOERR. 

Prototype : int VBE_EnumDisplayModes(VBE_ENUMDISPLAYCALLBACK callback, void *context); 
Description: Enumerate all display modes. Each valid, video modes a call to with a custom parameter is called. 
VBE_ENUMDISPLAYCALLBACK function syntax is callback(const VBE_ModeInfoBlock *info, VBE_MODE mode, void *context)

Prototype : void VGA_SetDisplayMode(int vgamode); 
Description: Set VGA mode thru INT10h. For example, passing 0x3 as parameter, set video mode to 80x25 text mode, passing 0x13 set video to 320x200x256 colors.
Always successful.


FRAME BUFFER FEATURES

Prototype : void CALLING_C VBE_Flip(void); 
Description: Flip backbuffer / front buffer. Call this function when flipping between front and back buffer

Prototype : uchar* VBE_LockSurface(void); 
Description: Return the current frame buffer video address (where you can read/write). 
It's return the back buffer which is the buffer that it is no visible until you do a VBE_Flip() call.

Prototype: void VBE_UnlockSurface(void);
Description:  Not really required to unlock the surface (invalid current display video pointer), but it is good to have this policy of Locking/Unlocking surface which is used in some others OS.

Prototype : VBE_RESULT VBE_SetScanlineLength(long new_length); 
Description: Set the scanline length. Useful for horizontal scrolling . For example, settings a ScanlineLength to 1024 in 640x480 display mode enables you to scroll horizontally with VBE_SetDisplayOffset.

Prototype : VBE_RESULT VBE_SetDisplayOffset(long x,long y); 
Description: Set scrolling position. Useful for horizontal/vertical scrolling. x and y are absolute screen offset to apply.

There is an extended LockSurface function for advanced users

Prototype : void VBE_LockSurfaceAlt(uchar **front, uchar **back, long *pitch); 
Description: fill front buffer address, back buffer address, and pitch (number of pixels per lines). Useful if you want to write directly on the visible page (front page). Width VESA 2.0, the write on front buffer is guaranteed to be same as the back buffer.

8BIT-MODE SPECIAL FEATURES

Prototype : VBE_RESULT VBE_SetDac(VBEDACMODE mode); 
Description: Set VGA 8bit DAC precision (6bit or 8bit). This only meaningful in 256 colors modes.

Prototype : VBE_RESULT VBE_GetPalette(int start, int numEntries, void *pal); 
Description:  Get current 8bit palette. Only in 8bit display modes. start : first color entry (0), numEntries : number of colors (256), pal (buffer of RGB values (3 x unsigned char)

Prototype :  void VBE_SetPalette(ulong start, ulong numEntries, const void * pal); 
Description:  Set 8bit palette. Only in 8bit display modes.

 

ADVANCED FEATURES.

Prototype :  void VBE_SetBank(int bank); 
Description: Change video bank (just given if you want to manage VESA 1.2). 

© 1995-1999 realtech VR. All rights reserved.

Microsoft, MS-DOS is a registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries
VESA is a registered trademark or trademark of VESA Org. in the United States and/or other countries