HaikuPorts
  • Login
  • Preferences
  • Help/Guide
  • Wiki
  • Timeline
  • Roadmap
  • View Tickets
  • Search
  • Port Log
  • Blog

Context Navigation

  • Back to Ticket #522

Ticket #522: SDL-1.2-HG-2010-12-27_opengl_cursor_patch.diff

File SDL-1.2-HG-2010-12-27_opengl_cursor_patch.diff, 3.9 KB (added by michaelvoliveira, 4 years ago)

Merging the original patch file with opengl cursor + sa_sigaction correction

  • src/events/SDL_quit.c

    diff -Naur libsdl-1.2-hg/src/events/SDL_quit.c libsdl-1.2-hg-haiku/src/events/SDL_quit.c
    old new  
    4545/* Public functions */ 
    4646int SDL_QuitInit(void) 
    4747{ 
    48 #ifdef HAVE_SIGACTION 
     48#if defined(HAVE_SIGACTION) && !defined(__HAIKU__) 
    4949        struct sigaction action; 
    5050        sigaction(SIGINT, NULL, &action); 
    5151        if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) { 
  • src/video/SDL_cursor.c

    diff -Naur libsdl-1.2-hg/src/video/SDL_cursor.c libsdl-1.2-hg-haiku/src/video/SDL_cursor.c
    old new  
    729729        if ( SDL_MUSTLOCK(screen) ) { 
    730730                SDL_UnlockSurface(screen); 
    731731        } 
     732         
    732733        if ( (screen == SDL_VideoSurface) && 
    733734             ((screen->flags & SDL_HWSURFACE) != SDL_HWSURFACE) ) { 
    734735                SDL_VideoDevice *video = current_video; 
  • src/video/bwindow/SDL_BWin.h

    diff -Naur libsdl-1.2-hg/src/video/bwindow/SDL_BWin.h libsdl-1.2-hg-haiku/src/video/bwindow/SDL_BWin.h
    old new  
    112112                        if ( SDL_GLView == NULL ) { 
    113113                                SDL_GLView = new BGLView(Bounds(), "SDL GLView", 
    114114                                                B_FOLLOW_ALL_SIDES, (B_WILL_DRAW|B_FRAME_EVENTS), 
    115                                                 gl_flags); 
     115                                                gl_flags|BGL_DOUBLE); 
    116116                                SDL_GLView->EnableDirectMode(true); 
    117117                        } 
    118118                        if ( the_view != SDL_GLView ) { 
    … …  
    133133                        } 
    134134                        if ( the_view != SDL_View ) { 
    135135                                if ( the_view ) { 
    136 #if SDL_VIDEO_OPENGL 
    137                                         if ( the_view == SDL_GLView ) { 
    138                                                 SDL_GLView->UnlockGL(); 
    139                                         } 
    140 #endif 
    141136                                        RemoveChild(the_view); 
    142137                                } 
    143138                                AddChild(SDL_View); 
    144139                                the_view = SDL_View; 
    145140                        } 
    146141                } 
     142#if SDL_VIDEO_OPENGL 
     143                if ( the_view == SDL_GLView ) { 
     144                        SDL_GLView->UnlockGL(); 
     145                } 
     146#endif 
    147147                Unlock(); 
    148148                return(retval); 
    149149        } 
    … …  
    191191#if SDL_VIDEO_OPENGL 
    192192        virtual void SwapBuffers(void) { 
    193193                SDL_GLView->UnlockGL(); 
    194                 SDL_GLView->LockGL(); 
    195194                SDL_GLView->SwapBuffers(); 
     195                SDL_GLView->LockGL(); 
    196196        } 
    197197#endif 
    198198        virtual BView *View(void) { 
    … …  
    215215                           the application should respond to the quit request, 
    216216                           or ignore it as desired. 
    217217                         */ 
     218#if SDL_VIDEO_OPENGL 
     219                        if ( SDL_GLView != NULL ) { 
     220                                SDL_GLView->EnableDirectMode(false); 
     221                        } 
     222#endif 
    218223                        return(false); 
    219224                } 
    220225                return(true);   /* Close the app window */ 
  • src/video/bwindow/SDL_sysevents.cc

    diff -Naur libsdl-1.2-hg/src/video/bwindow/SDL_sysevents.cc libsdl-1.2-hg-haiku/src/video/bwindow/SDL_sysevents.cc
    old new  
    3636#include "../../events/SDL_sysevents.h" 
    3737#include "../../events/SDL_events_c.h" 
    3838#include "SDL_sysevents_c.h" 
     39#include "../SDL_cursor_c.h" 
    3940 
    4041void BE_PumpEvents(_THIS) 
    4142{ 
    … …  
    203204                                if (transit == B_EXITED_VIEW) { 
    204205                                        if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) { 
    205206                                                SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS); 
     207#if SDL_VIDEO_OPENGL 
     208                                        // for some reason, SDL_EraseCursor fails for OpenGL 
     209                                        if (this->the_view != this->SDL_GLView) 
     210#endif 
     211                                                        SDL_EraseCursor(SDL_VideoSurface); 
    206212                                                be_app->SetCursor(B_HAND_CURSOR); 
    207213                                        } 
    208214                                } else { 
    209215                                        if ( !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) { 
    210216                                                SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS); 
     217#if SDL_VIDEO_OPENGL 
     218                                        // for some reason, SDL_EraseCursor fails for OpenGL 
     219                                        if (this->the_view != this->SDL_GLView) 
     220#endif 
     221                                                        SDL_EraseCursor(SDL_VideoSurface); 
    211222                                                SDL_SetCursor(NULL); 
    212223                                        } 
    213224 
    … …  
    395406                default: 
    396407                        break; 
    397408        } 
     409#if SDL_VIDEO_OPENGL 
     410        // If it is a BGLView, it is apparently required to 
     411        // call DirectConnected() on it as well 
     412        if (this->the_view == this->SDL_GLView) 
     413                this->SDL_GLView->DirectConnected(info); 
     414#endif   
    398415} 

Download in other formats:

  • Original Format

Trac Powered

Powered by Trac 0.13dev-r10686
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/