#ifndef	V_GR_H
#define	V_GR_H

typedef struct
{
	u8_t r,g,b,a;
}	colorquad_t, *colorquad_p;

#ifdef	__cplusplus
extern "C" {
#endif
	/*
	 * vgrWinOpen
	 * Input:
	 *   - width, height: resolution of mode (bit depth of backbuffer == 32)
	 * Output:
	 *  'true' if no error, 'false' otherwise.
	 */
	vboolean vgrWinOpen(int width,int height);
	void	vgrWinClose(void);
	/*
	 * This routine returns pointer to the array[0..height-1] filled
	 * with scanlines' addresses
	 */
	colorquad_p	*vgrLock(void);
	/*
	 * When drawing was finished, backbuffer must be unlocked.
	 * This routine also updates display.
	 */
	void	vgrUnlock(void);
	/*
	 * Draws single pixel in the backbuffer.
	 * Assumes that backbuffer already locked.
	 */
	void	vgrSetPixel32(int x,int y,colorquad_t color);
	/*
	 * Clears entire backbuffer.
	 * Assumes that backbuffer already locked.
	 */
	void	vgrClear(colorquad_t color);
	/*
	 * Window and event management
	 */
	vboolean	V_GLOBAL	vgrPending(void);
	vboolean	V_GLOBAL	vgrNextEvent(input_record_t *event_return);
	vboolean	V_GLOBAL	vgrSetFocus(void);
	vboolean	V_GLOBAL	vgrHideWindow(void);
	vboolean	V_GLOBAL	vgrShowWindow(void);
	vboolean	V_GLOBAL	vgrResizeWindow(u32_t width,u32_t height);
	vboolean	V_GLOBAL	vgrMoveWindow(u32_t left,u32_t top);
	
#ifdef	__cplusplus
}
#endif

#endif	/* V_GR_H */
