From 11148f08356f41572684d19355593d5dee4b4b88 Mon Sep 17 00:00:00 2001 From: nick Date: Sun, 4 Nov 2001 16:20:58 +0000 Subject: Double buffering support git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2687 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_vesa.c | 95 +++++++++++++++++++++++++++++++++------------------------ 1 file changed, 55 insertions(+), 40 deletions(-) (limited to 'libvo/vo_vesa.c') diff --git a/libvo/vo_vesa.c b/libvo/vo_vesa.c index 7308af1b81..c3fe248164 100644 --- a/libvo/vo_vesa.c +++ b/libvo/vo_vesa.c @@ -147,9 +147,9 @@ static inline void __vbeSwitchBank(unsigned long offset) if((err=vbeSetWindow(win.idx,new_offset)) != VBE_OK) { show_err: + vesa_term(); PRINT_VBE_ERR("vbeSetWindow",err); printf("vo_vesa: Fatal error occured! Can't continue\n"); - vesa_term(); exit(-1); } win.low = new_offset * gran; @@ -313,14 +313,19 @@ static void flip_page(void) if(!HAS_DGA()) __vbeCopyData(dga_buffer); flip_trigger = 0; } -#if 0 if(vo_doublebuffering && multi_size > 1) { - vbeSetDisplayStart(multi_buff[multi_idx],1); - multi_idx = multi_idx ? 0 : 1; - win.ptr = dga_buffer = video_base + multi_buff[multi_idx]; + int err; + if((err=vbeSetDisplayStart(multi_buff[multi_idx],1)) != VBE_OK) + { + vesa_term(); + PRINT_VBE_ERR("vbeSetDispayStart",err); + printf("vo_vesa: Fatal error occured! Can't continue\n"); + exit(EXIT_FAILURE); + } + multi_idx = multi_idx ? 0 : 1; + win.ptr = dga_buffer = video_base + multi_buff[multi_idx]; } -#endif /* else if(tripple_buffering) @@ -418,6 +423,34 @@ static void vesa_aspect(uint32_t width,uint32_t height, } } +static void paintBkGnd( void ) +{ + int x_res = video_mode_info.XResolution; + int y_res = video_mode_info.YResolution; + int x, y; + + for (y = 0; y < y_res; ++y) + { + for (x = 0; x < x_res; ++x) + { + int r, g, b; + if ((x & 16) ^ (y & 16)) + { + r = x * 255 / x_res; + g = y * 255 / y_res; + b = 255 - x * 255 / x_res; + } + else + { + r = 255 - x * 255 / x_res; + g = y * 255 / y_res; + b = 255 - y * 255 / y_res; + } + __vbeSetPixel(x, y, r, g, b); + } + } +} + static char *model2str(unsigned char type) { char *retval; @@ -796,42 +829,24 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3 printf("vo_vesa: VESA initialization complete\n"); fflush(stdout); } - if(verbose) + if(HAS_DGA()) { - int x_res = video_mode_info.XResolution; - int y_res = video_mode_info.YResolution; - int x, y; - - for (y = 0; y < y_res; ++y) - { - for (x = 0; x < x_res; ++x) - { - int r, g, b; - if ((x & 16) ^ (y & 16)) - { - r = x * 255 / x_res; - g = y * 255 / y_res; - b = 255 - x * 255 / x_res; - } - else - { - r = 255 - x * 255 / x_res; - g = y * 255 / y_res; - b = 255 - y * 255 / y_res; - } - - __vbeSetPixel(x, y, r, g, b); - } - } + int y = 0; + for(i=0;i 2) printf("vo_vesa: uninit was called\n"); - vesa_term(); } -- cgit v1.2.3