[pypy-svn] r54815 - in pypy/dist/pypy/rlib/rsdl: . test

arigo at codespeak.net arigo at codespeak.net
Sat May 17 12:31:36 CEST 2008


Author: arigo
Date: Sat May 17 12:31:35 2008
New Revision: 54815

Modified:
   pypy/dist/pypy/rlib/rsdl/RSDL.py
   pypy/dist/pypy/rlib/rsdl/test/test_basic.py
Log:
(karlb, cami, arigo)
SetVideoMode works.


Modified: pypy/dist/pypy/rlib/rsdl/RSDL.py
==============================================================================
--- pypy/dist/pypy/rlib/rsdl/RSDL.py	(original)
+++ pypy/dist/pypy/rlib/rsdl/RSDL.py	Sat May 17 12:31:35 2008
@@ -18,8 +18,13 @@
 
     INIT_VIDEO = platform.ConstantInteger('SDL_INIT_VIDEO')
 
+    Surface = platform.Struct('SDL_Surface', [])
+
 globals().update(platform.configure(CConfig))
 
 
 Init = external('SDL_Init', [Uint32], rffi.INT)
 Quit = external('SDL_Quit', [], lltype.Void)
+SetVideoMode = external('SDL_SetVideoMode', [rffi.INT, rffi.INT,
+                                             rffi.INT, Uint32],
+                        lltype.Ptr(Surface))

Modified: pypy/dist/pypy/rlib/rsdl/test/test_basic.py
==============================================================================
--- pypy/dist/pypy/rlib/rsdl/test/test_basic.py	(original)
+++ pypy/dist/pypy/rlib/rsdl/test/test_basic.py	Sat May 17 12:31:35 2008
@@ -5,3 +5,9 @@
 def test_sdl_init():
     assert RSDL.Init(RSDL.INIT_VIDEO) >= 0
     RSDL.Quit()
+
+def test_set_video_mode():
+    assert RSDL.Init(RSDL.INIT_VIDEO) >= 0
+    surface = RSDL.SetVideoMode(640, 480, 32, 0)
+    assert surface
+    RSDL.Quit()



More information about the Pypy-commit mailing list