Assorted fixes for NaCl. Hat tip to Sylvain Becker
authorGabriel Jacobo <gabomdq@gmail.com>
Mon, 16 Jun 2014 09:54:33 -0300
changeset 8873 77ffe680093f
parent 8872 5a6375d96834
child 8874 48d4f2d74d67
Assorted fixes for NaCl. Hat tip to Sylvain Becker
README-nacl.txt
src/video/nacl/SDL_naclvideo.c
src/video/nacl/SDL_naclwindow.c
--- a/README-nacl.txt	Mon Jun 16 09:47:23 2014 -0300
+++ b/README-nacl.txt	Mon Jun 16 09:54:33 2014 -0300
@@ -90,4 +90,5 @@
 TODO - Known Issues
 ================================================================================
 * Testing of all systems with a real application (something other than SDL's tests)
+* Key events don't seem to work properly
 
--- a/src/video/nacl/SDL_naclvideo.c	Mon Jun 16 09:47:23 2014 -0300
+++ b/src/video/nacl/SDL_naclvideo.c	Mon Jun 16 09:54:33 2014 -0300
@@ -139,6 +139,7 @@
     SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata;
     SDL_DisplayMode mode;
 
+    SDL_zero(mode);
     mode.format = driverdata->format;
     mode.w = driverdata->w;
     mode.h = driverdata->h;
@@ -147,8 +148,7 @@
     if (SDL_AddBasicVideoDisplay(&mode) < 0) {
         return -1;
     }
-    
-    SDL_zero(mode);
+
     SDL_AddDisplayMode(&_this->displays[0], &mode);
     
     PSInterfaceInit();
--- a/src/video/nacl/SDL_naclwindow.c	Mon Jun 16 09:47:23 2014 -0300
+++ b/src/video/nacl/SDL_naclwindow.c	Mon Jun 16 09:54:33 2014 -0300
@@ -51,6 +51,9 @@
     window->flags |= SDL_WINDOW_INPUT_FOCUS;    /* always has input focus */    
     window->flags |= SDL_WINDOW_OPENGL;
   
+    SDL_SetMouseFocus(window);
+    SDL_SetKeyboardFocus(window);
+    
     return 0;
 }