Commits

Marcus von Appen  committed d4e63dd

- add sdl2.sdlimage.IMG_SavePNG() and sdl2.sdlimage.IMG_SavePNG_RW()
- add sdl2.hints.SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS

  • Participants
  • Parent commits 7decf1e

Comments (0)

Files changed (3)

File sdl2/hints.py

            "SDL_HINT_IDLE_TIMER_DISABLED", "SDL_HINT_ORIENTATIONS",
            "SDL_HINT_XINPUT_ENABLED", "SDL_HINT_GAMECONTROLLERCONFIG",
            "SDL_HINT_ALLOW_TOPMOST", "SDL_HINT_DEFAULT", "SDL_HINT_NORMAL",
-           "SDL_HINT_OVERRIDE", "SDL_HintPriority", "SDL_SetHintWithPriority",
-           "SDL_SetHint", "SDL_GetHint", "SDL_ClearHints"
+           "SDL_HINT_OVERRIDE", "SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS",
+           "SDL_HintPriority", "SDL_SetHintWithPriority", "SDL_SetHint",
+           "SDL_GetHint", "SDL_ClearHints"
            ]
 
 SDL_HINT_FRAMEBUFFER_ACCELERATION = b"SDL_FRAMEBUFFER_ACCELERATION"
 SDL_HINT_XINPUT_ENABLED = b"SDL_XINPUT_ENABLED"
 SDL_HINT_GAMECONTROLLERCONFIG = b"SDL_GAMECONTROLLERCONFIG"
 SDL_HINT_ALLOW_TOPMOST = b"SDL_ALLOW_TOPMOST"
+SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS = b"SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
+
 SDL_HINT_DEFAULT = 0
 SDL_HINT_NORMAL = 1
 SDL_HINT_OVERRIDE = 2

File sdl2/sdlimage.py

            "IMG_InitFlags", "IMG_INIT_JPG", "IMG_INIT_PNG", "IMG_INIT_TIF",
            "IMG_INIT_WEBP", "IMG_Init", "IMG_Quit", "IMG_LoadTyped_RW",
            "IMG_Load", "IMG_Load_RW", "IMG_LoadTexture", "IMG_LoadTexture_RW",
-           "IMG_LoadTextureTyped_RW", "IMG_InvertAlpha", "IMG_isICO",
-           "IMG_isCUR", "IMG_isBMP", "IMG_isGIF", "IMG_isJPG", "IMG_isLBM",
-           "IMG_isPNG", "IMG_isPNM", "IMG_isPCX", "IMG_isTIF", "IMG_isXCF",
-           "IMG_isXV", "IMG_isWEBP", "IMG_LoadBMP_RW", "IMG_LoadCUR_RW",
-           "IMG_LoadCUR_RW", "IMG_LoadGIF_RW", "IMG_LoadICO_RW",
-           "IMG_LoadJPG_RW", "IMG_LoadLBM_RW", "IMG_LoadPCX_RW",
-           "IMG_LoadPNM_RW", "IMG_LoadPNG_RW", "IMG_LoadTGA_RW",
-           "IMG_LoadTIF_RW", "IMG_LoadXCF_RW", "IMG_LoadWEBP_RW",
-           "IMG_LoadXPM_RW", "IMG_LoadXV_RW", "IMG_ReadXPMFromArray",
+           "IMG_LoadTextureTyped_RW", "IMG_isICO", "IMG_isCUR", "IMG_isBMP",
+           "IMG_isGIF", "IMG_isJPG", "IMG_isLBM", "IMG_isPNG", "IMG_isPNM",
+           "IMG_isPCX", "IMG_isTIF", "IMG_isXCF", "IMG_isXV", "IMG_isWEBP",
+           "IMG_LoadBMP_RW", "IMG_LoadCUR_RW", "IMG_LoadCUR_RW",
+           "IMG_LoadGIF_RW", "IMG_LoadICO_RW", "IMG_LoadJPG_RW",
+           "IMG_LoadLBM_RW", "IMG_LoadPCX_RW", "IMG_LoadPNM_RW",
+           "IMG_LoadPNG_RW", "IMG_LoadTGA_RW", "IMG_LoadTIF_RW",
+           "IMG_LoadXCF_RW", "IMG_LoadWEBP_RW", "IMG_LoadXPM_RW",
+           "IMG_LoadXV_RW", "IMG_ReadXPMFromArray",
            "IMG_GetError", "IMG_SetError",
            "get_dll_file"
            ]
 IMG_Quit = _bind("IMG_Quit")
 IMG_LoadTyped_RW = _bind("IMG_LoadTyped_RW", [POINTER(SDL_RWops), c_int, c_char_p], POINTER(SDL_Surface))
 IMG_Load = _bind("IMG_Load", [c_char_p], POINTER(SDL_Surface))
-IMG_Load_RW = _bind("IMG_Load_RW", [POINTER(SDL_RWops), c_int], POINTER(SDL_Surface)) 
+IMG_Load_RW = _bind("IMG_Load_RW", [POINTER(SDL_RWops), c_int], POINTER(SDL_Surface))
 IMG_LoadTexture = _bind("IMG_LoadTexture", [POINTER(SDL_Renderer), c_char_p], POINTER(SDL_Texture))
 IMG_LoadTexture_RW = _bind("IMG_LoadTexture_RW", [POINTER(SDL_Renderer), POINTER(SDL_RWops), c_int], POINTER(SDL_Texture))
 IMG_LoadTextureTyped_RW = _bind("IMG_LoadTextureTyped_RW", [POINTER(SDL_Renderer), POINTER(SDL_RWops), c_int, c_char_p], POINTER(SDL_Texture))
-IMG_InvertAlpha = _bind("IMG_InvertAlpha", [c_int], c_int)
 
 IMG_isICO = _bind("IMG_isICO", [POINTER(SDL_RWops)], c_int)
 IMG_isCUR = _bind("IMG_isCUR", [POINTER(SDL_RWops)], c_int)
 IMG_LoadWEBP_RW = _bind("IMG_LoadWEBP_RW", [POINTER(SDL_RWops)], POINTER(SDL_Surface))
 
 IMG_ReadXPMFromArray = _bind("IMG_ReadXPMFromArray", [POINTER(c_char_p)], POINTER(SDL_Surface))
+
+IMG_SavePNG = _bind("IMG_SavePNG", [POINTER(SDL_Surface), c_char_p], c_int)
+IMG_SavePNG_RW = _bind("IMG_SavePNG_RW", [POINTER(SDL_Surface), POINTER(SDL_RWops), c_int], c_int)
+
 IMG_SetError = SDL_SetError
 IMG_GetError = SDL_GetError

File sdl2/test/sdlimage_test.py

         self.assertIsInstance(sf.contents, surface.SDL_Surface)
         surface.SDL_FreeSurface(sf)
 
+    @unittest.skip("not implemented")
+    def test_IMG_SavePNG(self):
+        pass
+
+    @unittest.skip("not implemented")
+    def test_IMG_SavePNG_RW(self):
+        pass
+
 
 if __name__ == '__main__':
     sys.exit(unittest.main())