[AD] patch-3.9.30-1: Another hook in the X code

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hi,

Looking at the X code, I thought that problems might be caused
with AllegroGL through Allegro catching and responding to the
Expose event as if it owned the window itself.  I'm not totally
sure that this is the case, but I added this hook to allow
AllegroGL to supply its own window repainter.  Even if there
wasn't any risk of problems with Allegro trying to repaint the
screen, it's still a useful thing to be able to hook.  At the
moment in AllegroGL it's just a stub, but at some stage I will
use it more effectively.

George

diff -urN allegro-3.9.30-0/include/xalleg.h allegro-3.9.30-1/include/xalleg.h
--- allegro-3.9.30-0/include/xalleg.h	Mon Dec 20 00:39:28 1999
+++ allegro-3.9.30-1/include/xalleg.h	Sun Jan 16 11:57:50 2000
@@ -128,6 +128,7 @@
 
 AL_METHOD (int, _xwin_window_creator, (void));
 AL_METHOD (void, _xwin_window_defaultor, (void));
+AL_METHOD (void, _xwin_window_redrawer, (int, int, int, int));
 
 
 
diff -urN allegro-3.9.30-0/src/x/xwin.c allegro-3.9.30-1/src/x/xwin.c
--- allegro-3.9.30-0/src/x/xwin.c	Mon Dec 20 00:39:28 1999
+++ allegro-3.9.30-1/src/x/xwin.c	Sun Jan 16 11:57:42 2000
@@ -1797,7 +1797,7 @@
 static void _xwin_private_vsync(void)
 {
 #if 0
-   _xwin_private_redraw_window(0, 0, _xwin.screen_width, _xwin.screen_height);
+   (*_xwin_window_redrawer)(0, 0, _xwin.screen_width, _xwin.screen_height);
 #endif
    _xwin_private_flush_buffers();
 }
@@ -2009,7 +2009,7 @@
 	 break;
       case Expose:
 	 /* Request to redraw part of the window.  */
-	 _xwin_private_redraw_window(event->xexpose.x, event->xexpose.y,
+	 (*_xwin_window_redrawer)(event->xexpose.x, event->xexpose.y,
 				     event->xexpose.width, event->xexpose.height);
 	 break;
       case MappingNotify:
@@ -2148,7 +2148,7 @@
 void _xwin_redraw_window(int x, int y, int w, int h)
 {
    DISABLE();
-   _xwin_private_redraw_window(x, y, w, h);
+   (*_xwin_window_redrawer)(x, y, w, h);
    ENABLE();
 }
 
@@ -2170,7 +2170,7 @@
 
    _xwin.scroll_x = x;
    _xwin.scroll_y = y;
-   _xwin_private_redraw_window(0, 0, _xwin.screen_width, _xwin.screen_height);
+   (*_xwin_window_redrawer)(0, 0, _xwin.screen_width, _xwin.screen_height);
    _xwin_private_flush_buffers();
 
    return 0;
@@ -2220,7 +2220,7 @@
       (*(_xwin.screen_to_buffer))(x, y, w, h);
 
    /* Update window.  */
-   _xwin_private_redraw_window(x - _xwin.scroll_x, y - _xwin.scroll_y, w, h);
+   (*_xwin_window_redrawer)(x - _xwin.scroll_x, y - _xwin.scroll_y, w, h);
 }
 
 void _xwin_update_screen(int x, int y, int w, int h)
@@ -2970,4 +2970,5 @@
 /* Hook functions */
 int (*_xwin_window_creator)(void) = &_xwin_private_create_window;
 void (*_xwin_window_defaultor)(void) = &_xwin_private_set_window_defaults;
+void (*_xwin_window_redrawer)(int, int, int, int) = &_xwin_private_redraw_window;
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/