├── examples
├── __init__.py
├── data
│ ├── blue.mpg
│ ├── bomb.gif
│ ├── boom.wav
│ ├── brick.png
│ ├── chimp.bmp
│ ├── city.png
│ ├── fist.bmp
│ ├── punch.wav
│ ├── sans.ttf
│ ├── shot.gif
│ ├── whiff.wav
│ ├── yuv_1.pgm
│ ├── alien1.gif
│ ├── alien1.jpg
│ ├── alien1.png
│ ├── alien2.gif
│ ├── alien2.png
│ ├── alien3.gif
│ ├── alien3.png
│ ├── asprite.bmp
│ ├── danger.gif
│ ├── liquid.bmp
│ ├── player1.gif
│ ├── static.png
│ ├── arraydemo.bmp
│ ├── background.gif
│ ├── car_door.wav
│ ├── explosion1.gif
│ ├── house_lo.mp3
│ ├── house_lo.ogg
│ ├── house_lo.wav
│ ├── midikeys.png
│ ├── oldplayer.gif
│ └── secosmic_lo.wav
├── macosx
│ └── aliens_app_example
│ │ ├── English.lproj
│ │ ├── aliens.icns
│ │ └── MainMenu.nib
│ │ │ ├── keyedobjects.nib
│ │ │ ├── JavaCompiling.plist
│ │ │ ├── classes.nib
│ │ │ └── info.nib
│ │ ├── README.txt
│ │ └── setup.py
├── .editorconfig
├── aacircle.py
├── setmodescale.py
├── sound.py
├── headless_no_windows_needed.py
├── overlay.py
├── audiocapture.py
├── moveit.py
└── dropevent.py
├── src_c
├── cython
│ └── pygame
│ │ ├── __init__.pxd
│ │ └── _sdl2
│ │ ├── __init__.pxd
│ │ ├── mixer.pxd
│ │ ├── sdl2.pxd
│ │ ├── sdl2.pyx
│ │ ├── mixer.pyx
│ │ └── audio.pxd
├── _sdl2
│ └── touch.c
├── doc
│ ├── gfxdraw_doc.h
│ ├── README.rst
│ ├── locals_doc.h
│ ├── tests_doc.h
│ ├── cursors_doc.h
│ ├── overlay_doc.h
│ ├── touch_doc.h
│ ├── bufferproxy_doc.h
│ ├── pixelcopy_doc.h
│ ├── sndarray_doc.h
│ ├── image_doc.h
│ ├── scrap_doc.h
│ ├── mouse_doc.h
│ ├── time_doc.h
│ └── key_doc.h
├── SDL_gfx
│ └── SDL_gfxPrimitives_font.h
├── mask.h
├── pgbufferproxy.h
├── font.h
├── mixer.h
├── pgimport.h
├── .editorconfig
├── pgopengl.h
├── .clang-format
├── _camera.h
├── _surface.h
├── pgplatform.h
├── pgarrinter.h
├── pygame.h
├── pgcompat.c
├── include
│ ├── pgplatform.h
│ ├── pygame.h
│ ├── pygame_mask.h
│ ├── pygame_freetype.h
│ ├── pygame_font.h
│ ├── pygame_bufferproxy.h
│ └── pygame_mixer.h
├── scale_mmx.c
├── fastevents.h
├── scrap_sdl2.c
└── scrap_mac.c
├── test
├── font_tags.py
├── fastevent_tags.py
├── run_tests__tests
│ ├── __init__.py
│ ├── all_ok
│ │ ├── __init__.py
│ │ ├── zero_tests_test.py
│ │ ├── no_assertions__ret_code_of_1__test.py
│ │ ├── fake_2_test.py
│ │ ├── fake_3_test.py
│ │ ├── fake_4_test.py
│ │ ├── fake_5_test.py
│ │ └── fake_6_test.py
│ ├── exclude
│ │ ├── __init__.py
│ │ ├── magic_tag_test.py
│ │ ├── fake_2_test.py
│ │ └── invisible_tag_test.py
│ ├── timeout
│ │ ├── __init__.py
│ │ ├── sleep_test.py
│ │ └── fake_2_test.py
│ ├── everything
│ │ ├── __init__.py
│ │ ├── sleep_test.py
│ │ ├── magic_tag_test.py
│ │ ├── fake_2_test.py
│ │ └── incomplete_todo_test.py
│ ├── failures1
│ │ ├── __init__.py
│ │ ├── fake_2_test.py
│ │ ├── fake_3_test.py
│ │ └── fake_4_test.py
│ ├── incomplete
│ │ ├── __init__.py
│ │ ├── fake_2_test.py
│ │ └── fake_3_test.py
│ ├── print_stderr
│ │ ├── __init__.py
│ │ ├── fake_2_test.py
│ │ ├── fake_3_test.py
│ │ └── fake_4_test.py
│ ├── print_stdout
│ │ ├── __init__.py
│ │ ├── fake_2_test.py
│ │ ├── fake_4_test.py
│ │ └── fake_3_test.py
│ ├── incomplete_todo
│ │ ├── __init__.py
│ │ ├── fake_3_test.py
│ │ └── fake_2_test.py
│ └── infinite_loop
│ │ ├── __init__.py
│ │ ├── fake_2_test.py
│ │ └── fake_1_test.py
├── test_test_.py
├── touch_tags.py
├── cdrom_tags.py
├── overlay_tags.py
├── fixtures
│ ├── fonts
│ │ ├── test_sans.ttf
│ │ ├── PyGameMono.otf
│ │ ├── test_fixed.otf
│ │ ├── A_PyGameMono-8.png
│ │ ├── u13079_PyGameMono-8.png
│ │ ├── PyGameMono-8.bdf
│ │ └── PyGameMono-18-75dpi.bdf
│ └── xbm_cursors
│ │ ├── white_sizing.xbm
│ │ └── white_sizing_mask.xbm
├── image_tags.py
├── mixer_tags.py
├── imageext_tags.py
├── mixer_music_tags.py
├── camera_test.py
├── ftfont_tags.py
├── freetype_tags.py
├── sndarray_tags.py
├── surfarray_tags.py
├── util
│ ├── gen_stubs_test.py
│ └── svn_log_to_whatsnew.py
├── .editorconfig
├── scrap_tags.py
├── test_utils
│ └── endian.py
├── ftfont_test.py
├── sysfont_test.py
├── overlay_test.py
├── touch_test.py
├── image__save_gl_surface_test.py
├── __init__.py
├── version_test.py
└── key_test.py
├── docs
├── reST
│ ├── ext
│ │ ├── __init__.py
│ │ ├── customversion.py
│ │ ├── edit_on_github.py
│ │ └── headers.py
│ ├── ref
│ │ ├── common.txt
│ │ ├── code_examples
│ │ │ ├── joystick_calls.png
│ │ │ └── draw_module_example.png
│ │ ├── locals.rst
│ │ └── touch.rst
│ ├── _static
│ │ ├── pygame.ico
│ │ ├── pygame_tiny.png
│ │ ├── tooltip.css
│ │ └── reset.css
│ ├── tut
│ │ ├── camera_hsv.jpg
│ │ ├── camera_rgb.jpg
│ │ ├── camera_yuv.jpg
│ │ ├── chimpshot.gif
│ │ ├── intro_ball.gif
│ │ ├── surfarray.png
│ │ ├── tom_basic.png
│ │ ├── camera_green.jpg
│ │ ├── camera_mask.jpg
│ │ ├── intro_blade.jpg
│ │ ├── tom_formulae.png
│ │ ├── tom_radians.png
│ │ ├── camera_average.jpg
│ │ ├── camera_thresh.jpg
│ │ ├── intro_freedom.jpg
│ │ ├── surfarray_xfade.png
│ │ ├── camera_background.jpg
│ │ ├── surfarray_flipped.png
│ │ ├── surfarray_redimg.png
│ │ ├── surfarray_scaleup.png
│ │ ├── surfarray_soften.png
│ │ ├── surfarray_striped.png
│ │ ├── camera_thresholded.jpg
│ │ ├── surfarray_allblack.png
│ │ ├── surfarray_rgbarray.png
│ │ ├── surfarray_scaledown.png
│ │ ├── tom_event-flowchart.png
│ │ ├── common.txt
│ │ └── chimp.py.rst
│ ├── themes
│ │ └── classic
│ │ │ ├── page.html
│ │ │ └── theme.conf
│ ├── common.txt
│ ├── c_api.rst
│ ├── c_api
│ │ ├── version.rst
│ │ ├── cdrom.rst
│ │ ├── display.rst
│ │ ├── freetype.rst
│ │ ├── event.rst
│ │ ├── color.rst
│ │ ├── bufferproxy.rst
│ │ ├── surface.rst
│ │ ├── rect.rst
│ │ └── mixer.rst
│ ├── filepaths.rst
│ └── _templates
│ │ └── header.h
├── pygame_logo.gif
├── pygame_tiny.gif
├── pygame_powered.gif
├── pygame_small.gif
├── ref
│ └── docscomments.json
├── __init__.py
├── __main__.py
├── logos.html
└── howto_release_pygame.txt
├── src_py
├── gp2x
│ ├── locals.py
│ ├── __init__.py
│ └── constants.py
├── pygame.ico
├── _sdl2
│ └── __init__.py
├── freesansbold.ttf
├── pygame_icon.bmp
├── pygame_icon.icns
├── pygame_icon.tiff
├── .editorconfig
├── macosx.py
├── _dummybackend.py
├── locals.py
├── freetype.py
├── pkgdata.py
└── _camera_opencv_highgui.py
└── .gitignore
/examples/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src_c/cython/pygame/__init__.pxd:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src_c/cython/pygame/_sdl2/__init__.pxd:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/font_tags.py:
--------------------------------------------------------------------------------
1 | __tags__ = []
2 |
--------------------------------------------------------------------------------
/test/fastevent_tags.py:
--------------------------------------------------------------------------------
1 | __tags__ = []
2 |
--------------------------------------------------------------------------------
/test/run_tests__tests/__init__.py:
--------------------------------------------------------------------------------
1 | # empty
2 |
--------------------------------------------------------------------------------
/test/run_tests__tests/all_ok/__init__.py:
--------------------------------------------------------------------------------
1 | # empty
2 |
--------------------------------------------------------------------------------
/test/run_tests__tests/exclude/__init__.py:
--------------------------------------------------------------------------------
1 | # empty
2 |
--------------------------------------------------------------------------------
/test/run_tests__tests/timeout/__init__.py:
--------------------------------------------------------------------------------
1 | # empty
2 |
--------------------------------------------------------------------------------
/test/test_test_.py:
--------------------------------------------------------------------------------
1 | while True:
2 | pass
3 |
--------------------------------------------------------------------------------
/docs/reST/ext/__init__.py:
--------------------------------------------------------------------------------
1 | # Make this a package
2 |
3 |
--------------------------------------------------------------------------------
/test/run_tests__tests/everything/__init__.py:
--------------------------------------------------------------------------------
1 | # empty
2 |
--------------------------------------------------------------------------------
/test/run_tests__tests/failures1/__init__.py:
--------------------------------------------------------------------------------
1 | # empty
2 |
--------------------------------------------------------------------------------
/test/run_tests__tests/incomplete/__init__.py:
--------------------------------------------------------------------------------
1 | # empty
2 |
--------------------------------------------------------------------------------
/test/run_tests__tests/print_stderr/__init__.py:
--------------------------------------------------------------------------------
1 | # empty
2 |
--------------------------------------------------------------------------------
/test/run_tests__tests/print_stdout/__init__.py:
--------------------------------------------------------------------------------
1 | # empty
2 |
--------------------------------------------------------------------------------
/test/touch_tags.py:
--------------------------------------------------------------------------------
1 | __tags__ = ['SDL1_ignore']
2 |
3 |
--------------------------------------------------------------------------------
/docs/reST/ref/common.txt:
--------------------------------------------------------------------------------
1 | .. include:: ../common.txt
2 |
3 |
--------------------------------------------------------------------------------
/test/run_tests__tests/incomplete_todo/__init__.py:
--------------------------------------------------------------------------------
1 | # empty
2 |
--------------------------------------------------------------------------------
/test/run_tests__tests/infinite_loop/__init__.py:
--------------------------------------------------------------------------------
1 | # empty
2 |
--------------------------------------------------------------------------------
/test/cdrom_tags.py:
--------------------------------------------------------------------------------
1 | __tags__ = ['interactive', 'SDL2_ignore']
2 |
--------------------------------------------------------------------------------
/src_py/gp2x/locals.py:
--------------------------------------------------------------------------------
1 |
2 | from pygame.gp2x.constants import *
3 |
4 |
--------------------------------------------------------------------------------
/src_py/pygame.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/src_py/pygame.ico
--------------------------------------------------------------------------------
/docs/pygame_logo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/pygame_logo.gif
--------------------------------------------------------------------------------
/docs/pygame_tiny.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/pygame_tiny.gif
--------------------------------------------------------------------------------
/src_c/_sdl2/touch.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/src_c/_sdl2/touch.c
--------------------------------------------------------------------------------
/docs/pygame_powered.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/pygame_powered.gif
--------------------------------------------------------------------------------
/docs/pygame_small.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/pygame_small.gif
--------------------------------------------------------------------------------
/examples/data/blue.mpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/blue.mpg
--------------------------------------------------------------------------------
/examples/data/bomb.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/bomb.gif
--------------------------------------------------------------------------------
/examples/data/boom.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/boom.wav
--------------------------------------------------------------------------------
/examples/data/brick.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/brick.png
--------------------------------------------------------------------------------
/examples/data/chimp.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/chimp.bmp
--------------------------------------------------------------------------------
/examples/data/city.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/city.png
--------------------------------------------------------------------------------
/examples/data/fist.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/fist.bmp
--------------------------------------------------------------------------------
/examples/data/punch.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/punch.wav
--------------------------------------------------------------------------------
/examples/data/sans.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/sans.ttf
--------------------------------------------------------------------------------
/examples/data/shot.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/shot.gif
--------------------------------------------------------------------------------
/examples/data/whiff.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/whiff.wav
--------------------------------------------------------------------------------
/examples/data/yuv_1.pgm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/yuv_1.pgm
--------------------------------------------------------------------------------
/src_c/doc/gfxdraw_doc.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/src_c/doc/gfxdraw_doc.h
--------------------------------------------------------------------------------
/src_py/_sdl2/__init__.py:
--------------------------------------------------------------------------------
1 | from .sdl2 import *
2 | from .audio import *
3 | from .video import *
4 |
--------------------------------------------------------------------------------
/src_py/freesansbold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/src_py/freesansbold.ttf
--------------------------------------------------------------------------------
/src_py/pygame_icon.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/src_py/pygame_icon.bmp
--------------------------------------------------------------------------------
/src_py/pygame_icon.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/src_py/pygame_icon.icns
--------------------------------------------------------------------------------
/src_py/pygame_icon.tiff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/src_py/pygame_icon.tiff
--------------------------------------------------------------------------------
/test/overlay_tags.py:
--------------------------------------------------------------------------------
1 | # Overlay support was removed in SDL 2
2 | __tags__ = ['SDL2_ignore']
3 |
--------------------------------------------------------------------------------
/examples/data/alien1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/alien1.gif
--------------------------------------------------------------------------------
/examples/data/alien1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/alien1.jpg
--------------------------------------------------------------------------------
/examples/data/alien1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/alien1.png
--------------------------------------------------------------------------------
/examples/data/alien2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/alien2.gif
--------------------------------------------------------------------------------
/examples/data/alien2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/alien2.png
--------------------------------------------------------------------------------
/examples/data/alien3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/alien3.gif
--------------------------------------------------------------------------------
/examples/data/alien3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/alien3.png
--------------------------------------------------------------------------------
/examples/data/asprite.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/asprite.bmp
--------------------------------------------------------------------------------
/examples/data/danger.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/danger.gif
--------------------------------------------------------------------------------
/examples/data/liquid.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/liquid.bmp
--------------------------------------------------------------------------------
/examples/data/player1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/player1.gif
--------------------------------------------------------------------------------
/examples/data/static.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/static.png
--------------------------------------------------------------------------------
/docs/reST/_static/pygame.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/_static/pygame.ico
--------------------------------------------------------------------------------
/docs/reST/tut/camera_hsv.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/camera_hsv.jpg
--------------------------------------------------------------------------------
/docs/reST/tut/camera_rgb.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/camera_rgb.jpg
--------------------------------------------------------------------------------
/docs/reST/tut/camera_yuv.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/camera_yuv.jpg
--------------------------------------------------------------------------------
/docs/reST/tut/chimpshot.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/chimpshot.gif
--------------------------------------------------------------------------------
/docs/reST/tut/intro_ball.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/intro_ball.gif
--------------------------------------------------------------------------------
/docs/reST/tut/surfarray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/surfarray.png
--------------------------------------------------------------------------------
/docs/reST/tut/tom_basic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/tom_basic.png
--------------------------------------------------------------------------------
/docs/ref/docscomments.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/ref/docscomments.json
--------------------------------------------------------------------------------
/examples/data/arraydemo.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/arraydemo.bmp
--------------------------------------------------------------------------------
/examples/data/background.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/background.gif
--------------------------------------------------------------------------------
/examples/data/car_door.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/car_door.wav
--------------------------------------------------------------------------------
/examples/data/explosion1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/explosion1.gif
--------------------------------------------------------------------------------
/examples/data/house_lo.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/house_lo.mp3
--------------------------------------------------------------------------------
/examples/data/house_lo.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/house_lo.ogg
--------------------------------------------------------------------------------
/examples/data/house_lo.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/house_lo.wav
--------------------------------------------------------------------------------
/examples/data/midikeys.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/midikeys.png
--------------------------------------------------------------------------------
/examples/data/oldplayer.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/oldplayer.gif
--------------------------------------------------------------------------------
/docs/reST/tut/camera_green.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/camera_green.jpg
--------------------------------------------------------------------------------
/docs/reST/tut/camera_mask.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/camera_mask.jpg
--------------------------------------------------------------------------------
/docs/reST/tut/intro_blade.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/intro_blade.jpg
--------------------------------------------------------------------------------
/docs/reST/tut/tom_formulae.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/tom_formulae.png
--------------------------------------------------------------------------------
/docs/reST/tut/tom_radians.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/tom_radians.png
--------------------------------------------------------------------------------
/examples/data/secosmic_lo.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/data/secosmic_lo.wav
--------------------------------------------------------------------------------
/docs/reST/_static/pygame_tiny.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/_static/pygame_tiny.png
--------------------------------------------------------------------------------
/docs/reST/tut/camera_average.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/camera_average.jpg
--------------------------------------------------------------------------------
/docs/reST/tut/camera_thresh.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/camera_thresh.jpg
--------------------------------------------------------------------------------
/docs/reST/tut/intro_freedom.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/intro_freedom.jpg
--------------------------------------------------------------------------------
/docs/reST/tut/surfarray_xfade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/surfarray_xfade.png
--------------------------------------------------------------------------------
/test/fixtures/fonts/test_sans.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/test/fixtures/fonts/test_sans.ttf
--------------------------------------------------------------------------------
/docs/reST/tut/camera_background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/camera_background.jpg
--------------------------------------------------------------------------------
/docs/reST/tut/surfarray_flipped.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/surfarray_flipped.png
--------------------------------------------------------------------------------
/docs/reST/tut/surfarray_redimg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/surfarray_redimg.png
--------------------------------------------------------------------------------
/docs/reST/tut/surfarray_scaleup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/surfarray_scaleup.png
--------------------------------------------------------------------------------
/docs/reST/tut/surfarray_soften.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/surfarray_soften.png
--------------------------------------------------------------------------------
/docs/reST/tut/surfarray_striped.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/surfarray_striped.png
--------------------------------------------------------------------------------
/test/fixtures/fonts/PyGameMono.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/test/fixtures/fonts/PyGameMono.otf
--------------------------------------------------------------------------------
/test/fixtures/fonts/test_fixed.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/test/fixtures/fonts/test_fixed.otf
--------------------------------------------------------------------------------
/docs/reST/tut/camera_thresholded.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/camera_thresholded.jpg
--------------------------------------------------------------------------------
/docs/reST/tut/surfarray_allblack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/surfarray_allblack.png
--------------------------------------------------------------------------------
/docs/reST/tut/surfarray_rgbarray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/surfarray_rgbarray.png
--------------------------------------------------------------------------------
/docs/reST/tut/surfarray_scaledown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/surfarray_scaledown.png
--------------------------------------------------------------------------------
/docs/reST/tut/tom_event-flowchart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/tut/tom_event-flowchart.png
--------------------------------------------------------------------------------
/src_c/SDL_gfx/SDL_gfxPrimitives_font.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/src_c/SDL_gfx/SDL_gfxPrimitives_font.h
--------------------------------------------------------------------------------
/test/fixtures/fonts/A_PyGameMono-8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/test/fixtures/fonts/A_PyGameMono-8.png
--------------------------------------------------------------------------------
/test/fixtures/fonts/u13079_PyGameMono-8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/test/fixtures/fonts/u13079_PyGameMono-8.png
--------------------------------------------------------------------------------
/docs/reST/ref/code_examples/joystick_calls.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/ref/code_examples/joystick_calls.png
--------------------------------------------------------------------------------
/docs/reST/ref/code_examples/draw_module_example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/docs/reST/ref/code_examples/draw_module_example.png
--------------------------------------------------------------------------------
/examples/macosx/aliens_app_example/English.lproj/aliens.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/macosx/aliens_app_example/English.lproj/aliens.icns
--------------------------------------------------------------------------------
/test/image_tags.py:
--------------------------------------------------------------------------------
1 | __tags__ = []
2 |
3 | import pygame
4 | import sys
5 | if 'pygame.image' not in sys.modules:
6 | __tags__.extend(('ignore', 'subprocess_ignore'))
7 |
8 |
--------------------------------------------------------------------------------
/test/mixer_tags.py:
--------------------------------------------------------------------------------
1 | __tags__ = []
2 |
3 | import pygame
4 | import sys
5 | if 'pygame.mixer' not in sys.modules:
6 | __tags__.extend(('ignore', 'subprocess_ignore'))
7 |
8 |
--------------------------------------------------------------------------------
/src_c/mask.h:
--------------------------------------------------------------------------------
1 | #ifndef PGMASK_INTERNAL_H
2 | #define PGMASK_INTERNAL_H
3 |
4 | #include "include/pygame_mask.h"
5 | #define PYGAMEAPI_MASK_NUMSLOTS 1
6 |
7 | #endif /* ~PGMASK_INTERNAL_H */
8 |
--------------------------------------------------------------------------------
/test/imageext_tags.py:
--------------------------------------------------------------------------------
1 | __tags__ = []
2 |
3 | import pygame
4 | import sys
5 | if 'pygame.imageext' not in sys.modules:
6 | __tags__.extend(('ignore', 'subprocess_ignore'))
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test/mixer_music_tags.py:
--------------------------------------------------------------------------------
1 | __tags__ = []
2 |
3 | import pygame
4 | import sys
5 | if 'pygame.mixer_music' not in sys.modules:
6 | __tags__.extend(('ignore', 'subprocess_ignore'))
7 |
8 |
--------------------------------------------------------------------------------
/docs/reST/tut/common.txt:
--------------------------------------------------------------------------------
1 | .. Common definitions for tutorials
2 |
3 | .. include:: ../common.txt
4 |
5 | .. role:: codelineref
6 |
7 | .. role:: clr(codelineref)
8 | :class: codelineref
9 |
--------------------------------------------------------------------------------
/test/camera_test.py:
--------------------------------------------------------------------------------
1 | import unittest
2 | import math
3 |
4 | import pygame
5 | from pygame.compat import long_
6 |
7 |
8 | class CameraModuleTest(unittest.TestCase):
9 | pass
10 |
--------------------------------------------------------------------------------
/examples/macosx/aliens_app_example/English.lproj/MainMenu.nib/keyedobjects.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/0101011/pygame/master/examples/macosx/aliens_app_example/English.lproj/MainMenu.nib/keyedobjects.nib
--------------------------------------------------------------------------------
/src_c/doc/README.rst:
--------------------------------------------------------------------------------
1 | These files are generated from the rst files in docs/reST/ref/
2 |
3 | Both the .rst file and the generated .h file should be committed.
4 |
5 | To generate docs run: python setup.py docs
6 |
--------------------------------------------------------------------------------
/src_c/pgbufferproxy.h:
--------------------------------------------------------------------------------
1 | #ifndef PG_BUFPROXY_INTERNAL_H
2 | #define PG_BUFPROXY_INTERNAL_H
3 |
4 | #include "include/pygame_bufferproxy.h"
5 | #define PYGAMEAPI_BUFPROXY_NUMSLOTS 4
6 |
7 | #endif /* ~PG_BUFPROXY_INTERNAL_H */
8 |
--------------------------------------------------------------------------------
/docs/reST/tut/chimp.py.rst:
--------------------------------------------------------------------------------
1 | .. include:: common.txt
2 |
3 | ****************************
4 | pygame/examples/chimp.py
5 | ****************************
6 |
7 | .. literalinclude:: ../../../examples/chimp.py
8 | :language: python
9 |
--------------------------------------------------------------------------------
/docs/reST/themes/classic/page.html:
--------------------------------------------------------------------------------
1 | {%- extends "elements.html" %}
2 |
3 | {%- block document %}
4 | {{ header() }}
5 | {{ super() }}
6 | {%- endblock %}
7 |
8 | {%- block section %}
9 | {{ body }}
10 | {%- endblock %}
11 |
--------------------------------------------------------------------------------
/test/ftfont_tags.py:
--------------------------------------------------------------------------------
1 | __tags__ = ['development']
2 |
3 | exclude = False
4 |
5 | try:
6 | import pygame.ftfont
7 | except ImportError:
8 | exclude = True
9 |
10 | if exclude:
11 | __tags__.extend(['ignore', 'subprocess_ignore'])
12 |
13 |
--------------------------------------------------------------------------------
/test/freetype_tags.py:
--------------------------------------------------------------------------------
1 | __tags__ = ['development']
2 |
3 | exclude = False
4 |
5 | try:
6 | import pygame.freetype
7 | except ImportError:
8 | exclude = True
9 |
10 | if exclude:
11 | __tags__.extend(['ignore', 'subprocess_ignore'])
12 |
13 |
--------------------------------------------------------------------------------
/test/sndarray_tags.py:
--------------------------------------------------------------------------------
1 | __tags__ = ['array']
2 |
3 | exclude = False
4 |
5 | try:
6 | import pygame.mixer
7 | import numpy
8 | except ImportError:
9 | exclude = True
10 |
11 | if exclude:
12 | __tags__.extend(('ignore', 'subprocess_ignore'))
13 |
--------------------------------------------------------------------------------
/src_c/doc/locals_doc.h:
--------------------------------------------------------------------------------
1 | /* Auto generated file: with makeref.py . Docs go in docs/reST/ref/ . */
2 | #define DOC_PYGAMELOCALS "pygame constants"
3 |
4 |
5 | /* Docs in a comment... slightly easier to read. */
6 |
7 | /*
8 |
9 | pygame.locals
10 | pygame constants
11 |
12 | */
--------------------------------------------------------------------------------
/docs/reST/common.txt:
--------------------------------------------------------------------------------
1 | .. Pygame specific reST elements.
2 |
3 | .. role:: summaryline
4 |
5 | .. role:: sl(summaryline)
6 | :class: summaryline
7 |
8 | .. role:: signature
9 |
10 | .. role:: sg(signature)
11 | :class: signature
12 |
13 | .. role:: small-heading
14 | :class: small-heading
15 |
--------------------------------------------------------------------------------
/docs/reST/c_api.rst:
--------------------------------------------------------------------------------
1 | *********
2 | C API
3 | *********
4 |
5 | pygame C API
6 | ============
7 |
8 | .. toctree::
9 | :maxdepth: 1
10 | :glob:
11 |
12 | c_api/*
13 |
14 | src_c/include/ contains header files for applications
15 | that use the pygame C API, while src_c/ contains
16 | headers used by pygame internally.
17 |
--------------------------------------------------------------------------------
/test/surfarray_tags.py:
--------------------------------------------------------------------------------
1 | __tags__ = ['array']
2 |
3 | exclude = False
4 |
5 | try:
6 | import numpy
7 | except ImportError:
8 | exclude = True
9 | else:
10 | try:
11 | import pygame.pixelcopy
12 | except ImportError:
13 | exclude = True
14 |
15 | if exclude:
16 | __tags__.extend(('ignore', 'subprocess_ignore'))
17 |
--------------------------------------------------------------------------------
/docs/__init__.py:
--------------------------------------------------------------------------------
1 | # Make docs a package that brings up the main page in a web brower when
2 | # executed.
3 | #
4 | # python -m pygame.docs
5 |
6 | if __name__ == '__main__':
7 | import os
8 | pkg_dir = os.path.dirname(os.path.abspath(__file__))
9 | main = os.path.join(pkg_dir, '__main__.py')
10 | exec(open(main).read())
11 |
12 |
13 |
--------------------------------------------------------------------------------
/test/util/gen_stubs_test.py:
--------------------------------------------------------------------------------
1 | ######################### PYGAME UNITTEST STUBBER TESTS ########################
2 | """
3 |
4 | TODO
5 | ====
6 |
7 | tests for new stubber: deleted tests for missing units
8 |
9 | """
10 |
11 | import pygame, unittest, gen_stubs
12 |
13 |
14 | ################################################################################
--------------------------------------------------------------------------------
/examples/macosx/aliens_app_example/English.lproj/MainMenu.nib/JavaCompiling.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | JavaSourceSubpath
6 | _MainMenu_EOArchive_English.java
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src_c/font.h:
--------------------------------------------------------------------------------
1 | #ifndef PGFONT_INTERNAL_H
2 | #define PGFONT_INTERNAL_H
3 |
4 | #include
5 |
6 | /* test font initialization */
7 | #define FONT_INIT_CHECK() \
8 | if(!(*(int*)PyFONT_C_API[2])) \
9 | return RAISE(pgExc_SDLError, "font system not initialized")
10 |
11 | #include "include/pygame_font.h"
12 |
13 | #define PYGAMEAPI_FONT_NUMSLOTS 3
14 |
15 | #endif /* ~PGFONT_INTERNAL_H */
16 |
--------------------------------------------------------------------------------
/src_c/mixer.h:
--------------------------------------------------------------------------------
1 | #ifndef MIXER_INTERNAL_H
2 | #define MIXER_INTERNAL_H
3 |
4 | #include
5 |
6 | /* test mixer initializations */
7 | #define MIXER_INIT_CHECK() \
8 | if(!SDL_WasInit(SDL_INIT_AUDIO)) \
9 | return RAISE(pgExc_SDLError, "mixer not initialized")
10 |
11 | #define PYGAMEAPI_MIXER_NUMSLOTS 7
12 | #include "include/pygame_mixer.h"
13 |
14 | #endif /* ~MIXER_INTERNAL_H */
15 |
--------------------------------------------------------------------------------
/examples/macosx/aliens_app_example/English.lproj/MainMenu.nib/classes.nib:
--------------------------------------------------------------------------------
1 | {
2 | IBClasses = (
3 | {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
4 | {
5 | ACTIONS = {};
6 | CLASS = PygameAppDelegate;
7 | LANGUAGE = ObjC;
8 | OUTLETS = {};
9 | SUPERCLASS = NSObject;
10 | }
11 | );
12 | IBVersion = 1;
13 | }
--------------------------------------------------------------------------------
/test/fixtures/xbm_cursors/white_sizing.xbm:
--------------------------------------------------------------------------------
1 | #define resize_white_width 16
2 | #define resize_white_height 16
3 | #define resize_white_x_hot 7
4 | #define resize_white_y_hot 7
5 | static unsigned char resize_white_bits[] = {
6 | 0xff, 0x03, 0x01, 0x02, 0xfd, 0x03, 0x05, 0x00, 0xf5, 0x0f, 0x15, 0x08,
7 | 0xd5, 0xeb, 0x55, 0xaa, 0x55, 0xaa, 0xd7, 0xab, 0x10, 0xa8, 0xf0, 0xb7,
8 | 0x00, 0xa8, 0xc0, 0x9f, 0x40, 0x80, 0xc0, 0xff};
9 |
--------------------------------------------------------------------------------
/src_c/pgimport.h:
--------------------------------------------------------------------------------
1 | #ifndef PGIMPORT_INTERNAL_H
2 | #define PGIMPORT_INTERNAL_H
3 |
4 | #include "include/pgimport.h"
5 |
6 | #if PG_HAVE_CAPSULE
7 | #define encapsulate_api(ptr, module) \
8 | PyCapsule_New(ptr, PG_CAPSULE_NAME(module), NULL)
9 | #else /* ~PG_HAVE_CAPSULE */
10 | #define encapsulate_api(ptr, module) PyCObject_FromVoidPtr(ptr, NULL)
11 | #endif /* ~PG_HAVE_CAPSULE */
12 |
13 | #endif /* PGIMPORT_INTERNAL_H */
14 |
--------------------------------------------------------------------------------
/test/fixtures/xbm_cursors/white_sizing_mask.xbm:
--------------------------------------------------------------------------------
1 | #define resize_white_mask_width 16
2 | #define resize_white_mask_height 16
3 | #define resize_white_mask_x_hot 7
4 | #define resize_white_mask_y_hot 7
5 | static unsigned char resize_white_mask_bits[] = {
6 | 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0x07, 0x00, 0xf7, 0x0f, 0xf7, 0x0f,
7 | 0xf7, 0xef, 0x77, 0xee, 0x77, 0xee, 0xf7, 0xef, 0xf0, 0xef, 0xf0, 0xff,
8 | 0x00, 0xf8, 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff};
9 |
--------------------------------------------------------------------------------
/src_c/doc/tests_doc.h:
--------------------------------------------------------------------------------
1 | /* Auto generated file: with makeref.py . Docs go in docs/reST/ref/ . */
2 | #define DOC_PYGAMETESTS "Pygame unit test suite package"
3 | #define DOC_PYGAMETESTSRUN "run(*args, **kwds) -> tuple\nRun the pygame unit test suite"
4 |
5 |
6 | /* Docs in a comment... slightly easier to read. */
7 |
8 | /*
9 |
10 | pygame.tests
11 | Pygame unit test suite package
12 |
13 | pygame.tests.run
14 | run(*args, **kwds) -> tuple
15 | Run the pygame unit test suite
16 |
17 | */
--------------------------------------------------------------------------------
/test/.editorconfig:
--------------------------------------------------------------------------------
1 | root=true
2 |
3 | [*]
4 | end_of_line = lf
5 | insert_final_newline = true
6 |
7 | # The settings for C (*.c and *.h) files are mirrored in src_c/.clang-format.
8 | # Keep them in sync.
9 | [*.{c,h}]
10 | indent_style = space
11 | indent_size = 4
12 | tab_width = 4
13 | trim_trailing_whitespace = true
14 | max_line_length = 79
15 |
16 | [*.{py,pyx}]
17 | indent_style = space
18 | indent_size = 4
19 | charset = utf-8
20 | file_type_emacs = python
21 | trim_trailing_whitespace = true
22 | max_line_length = 79
23 |
--------------------------------------------------------------------------------
/examples/.editorconfig:
--------------------------------------------------------------------------------
1 | root=true
2 |
3 | [*]
4 | end_of_line = lf
5 | insert_final_newline = true
6 |
7 | # The settings for C (*.c and *.h) files are mirrored in src_c/.clang-format.
8 | # Keep them in sync.
9 | [*.{c,h}]
10 | indent_style = space
11 | indent_size = 4
12 | tab_width = 4
13 | trim_trailing_whitespace = true
14 | max_line_length = 79
15 |
16 | [*.{py,pyx}]
17 | indent_style = space
18 | indent_size = 4
19 | charset = utf-8
20 | file_type_emacs = python
21 | trim_trailing_whitespace = true
22 | max_line_length = 79
23 |
--------------------------------------------------------------------------------
/src_c/.editorconfig:
--------------------------------------------------------------------------------
1 | root=true
2 |
3 | [*]
4 | end_of_line = lf
5 | insert_final_newline = true
6 |
7 | # The settings for C (*.c and *.h) files are mirrored in src_c/.clang-format.
8 | # Keep them in sync.
9 | [*.{c,h}]
10 | indent_style = space
11 | indent_size = 4
12 | tab_width = 4
13 | trim_trailing_whitespace = true
14 | max_line_length = 79
15 |
16 | [*.{py,pyx}]
17 | indent_style = space
18 | indent_size = 4
19 | charset = utf-8
20 | file_type_emacs = python
21 | trim_trailing_whitespace = true
22 | max_line_length = 79
23 |
--------------------------------------------------------------------------------
/src_py/.editorconfig:
--------------------------------------------------------------------------------
1 | root=true
2 |
3 | [*]
4 | end_of_line = lf
5 | insert_final_newline = true
6 |
7 | # The settings for C (*.c and *.h) files are mirrored in src_c/.clang-format.
8 | # Keep them in sync.
9 | [*.{c,h}]
10 | indent_style = space
11 | indent_size = 4
12 | tab_width = 4
13 | trim_trailing_whitespace = true
14 | max_line_length = 79
15 |
16 | [*.{py,pyx}]
17 | indent_style = space
18 | indent_size = 4
19 | charset = utf-8
20 | file_type_emacs = python
21 | trim_trailing_whitespace = true
22 | max_line_length = 79
23 |
--------------------------------------------------------------------------------
/test/scrap_tags.py:
--------------------------------------------------------------------------------
1 | # For now the scrap module has not been updated for SDL 2
2 | __tags__ = ['SDL2_ignore']
3 |
4 | import sys
5 |
6 | exclude = False
7 |
8 | if sys.platform == 'win32' or sys.platform.startswith('linux'):
9 | try:
10 | import pygame
11 | pygame.scrap._NOT_IMPLEMENTED_
12 | except AttributeError:
13 | pass
14 | else:
15 | exclude = True
16 | else:
17 | exclude = True
18 |
19 | if exclude:
20 | __tags__.extend(['ignore', 'subprocess_ignore'])
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/examples/macosx/aliens_app_example/README.txt:
--------------------------------------------------------------------------------
1 | *********************************************************************
2 | THESE INSTRUCTIONS ARE ONLY FOR MAC OS X 10.3, AND WILL ONLY CREATE
3 | STANDALONE BUNDLES FOR MAC OS X 10.3. THERE IS NO SUPPORT FOR
4 | MAC OS X 10.2.
5 |
6 | Also works on 10.4 and 10.5
7 | *********************************************************************
8 |
9 |
10 | Install py2app and its dependencies.
11 |
12 | easy_install py2app
13 |
14 |
15 |
16 | To create the bundle:
17 | python setup.py py2app
18 |
--------------------------------------------------------------------------------
/src_c/pgopengl.h:
--------------------------------------------------------------------------------
1 | #if !defined(PGOPENGL_H)
2 | #define PGOPENGL_H
3 |
4 | /** This header includes definitions of Opengl functions as pointer types for
5 | ** use with the SDL function SDL_GL_GetProcAddress.
6 | **/
7 |
8 | #if defined(_WIN32)
9 | #define GL_APIENTRY __stdcall
10 | #else
11 | #define GL_APIENTRY
12 | #endif
13 |
14 | typedef void (GL_APIENTRY *GL_glReadPixels_Func)(int, int, int, int, unsigned int, unsigned int, void*);
15 |
16 | typedef void (GL_APIENTRY *GL_glViewport_Func)(int, int, unsigned int, unsigned int);
17 | #endif
18 |
19 |
--------------------------------------------------------------------------------
/src_c/.clang-format:
--------------------------------------------------------------------------------
1 | # PEP 7
2 | BasedOnStyle: Google
3 | AllowShortLoopsOnASingleLine: false
4 | AllowShortIfStatementsOnASingleLine: false
5 | AlwaysBreakAfterReturnType: All
6 | AlignAfterOpenBracket: Align
7 | BreakBeforeBraces: Stroustrup
8 | ColumnLimit: 79
9 | DerivePointerAlignment: false
10 | # These settings are mirrored in .editorconfig. Keep them in sync.
11 | IndentWidth: 4
12 | Language: Cpp
13 | PointerAlignment: Right
14 | ReflowComments: true
15 | SpaceBeforeParens: ControlStatements
16 | SpacesInParentheses: false
17 | TabWidth: 4
18 | UseTab: Never
19 |
--------------------------------------------------------------------------------
/test/test_utils/endian.py:
--------------------------------------------------------------------------------
1 | # Module pygame.tests.test_utils.endian
2 | #
3 | # Machine independent conversion to little-endian and big-endian Python
4 | # integer values.
5 |
6 | import struct
7 |
8 | def little_endian_uint32(i):
9 | """Return the 32 bit unsigned integer little-endian representation of i"""
10 |
11 | s = struct.pack('I', i)
18 | return struct.unpack('=I', s)[0]
19 |
--------------------------------------------------------------------------------
/src_c/cython/pygame/_sdl2/mixer.pxd:
--------------------------------------------------------------------------------
1 | # cython: language_level=2
2 | #
3 |
4 | from sdl2 cimport *
5 |
6 | #https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC79
7 |
8 | ctypedef void (*mixcallback)(void *udata, Uint8 *stream, int len) nogil
9 |
10 | cdef extern from "SDL_mixer.h" nogil:
11 | ctypedef void (*mix_func)(void *udata, Uint8 *stream, int len)
12 | void Mix_SetPostMix(void (*mixcallback)(void *udata, Uint8 *stream, int len), void *arg)
13 |
14 |
15 | cdef class _PostMix:
16 | cdef mixcallback callback
17 | cdef void *userdata
18 | cdef object _callback
19 |
--------------------------------------------------------------------------------
/test/ftfont_test.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import os
3 | import unittest
4 | from pygame.tests import font_test
5 |
6 | import pygame.ftfont
7 |
8 | font_test.pygame_font = pygame.ftfont
9 | # Disable UCS-4 specific tests as this "Font" type does accept UCS-4 codes.
10 | font_test.UCS_4 = False
11 |
12 | for name in dir(font_test):
13 | obj = getattr(font_test, name)
14 | if (isinstance(obj, type) and # conditional and
15 | issubclass(obj, unittest.TestCase)):
16 | new_name = 'Ft%s' % name
17 | globals()[new_name] = type(new_name, (obj, ), {})
18 |
19 | if __name__ == '__main__':
20 | unittest.main()
21 |
--------------------------------------------------------------------------------
/src_py/gp2x/__init__.py:
--------------------------------------------------------------------------------
1 |
2 |
3 | # this lets me know that the module has not been imported.
4 | # we store it so we don't reimport a module each time the isgp2x function is called.
5 | _is_gp2x = -1
6 |
7 | def isgp2x():
8 | """ Returns True if we are running on a gp2x, else False
9 | """
10 |
11 | if _is_gp2x == -1:
12 | #TODO: FIXME: HACK: need to find a good way to do this.
13 | # Use configure to put 'gp2x' in the version string?
14 | import sys
15 |
16 | if "arm" in sys.version:
17 | _is_gp2x = True
18 | else:
19 | _is_gp2x = False
20 |
21 | return _is_gp2x
22 |
23 |
--------------------------------------------------------------------------------
/src_py/gp2x/constants.py:
--------------------------------------------------------------------------------
1 |
2 | # GP2X joystick button mappings
3 | BUTTON_UP = (0)
4 | BUTTON_DOWN = (4)
5 | BUTTON_LEFT = (2)
6 | BUTTON_RIGHT = (6)
7 | BUTTON_UPLEFT = (1)
8 | BUTTON_UPRIGHT = (7)
9 | BUTTON_DOWNLEFT = (3)
10 | BUTTON_DOWNRIGHT = (5)
11 | BUTTON_CLICK = (18)
12 | BUTTON_A = (12)
13 | BUTTON_B = (13)
14 | BUTTON_X = (14)
15 | BUTTON_Y = (15)
16 | BUTTON_L = (10)
17 | BUTTON_R = (11)
18 | BUTTON_START = (8)
19 | BUTTON_SELECT = (9)
20 | BUTTON_VOLUP = (16)
21 | BUTTON_VOLDOWN = (17)
22 |
--------------------------------------------------------------------------------
/examples/macosx/aliens_app_example/English.lproj/MainMenu.nib/info.nib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IBDocumentLocation
6 | 269 494 356 240 0 0 1600 1002
7 | IBEditorPositions
8 |
9 | 29
10 | 125 344 278 44 0 0 1600 1002
11 |
12 | IBFramework Version
13 | 349.0
14 | IBOpenObjects
15 |
16 | 29
17 |
18 | IBSystem Version
19 | 7D24
20 |
21 |
22 |
--------------------------------------------------------------------------------
/examples/macosx/aliens_app_example/setup.py:
--------------------------------------------------------------------------------
1 | """
2 | Script for building the example.
3 |
4 | Usage:
5 | python setup.py py2app
6 | """
7 | from distutils.core import setup
8 | import py2app
9 |
10 | NAME = 'aliens'
11 | VERSION = '0.1'
12 |
13 | plist = dict(
14 | CFBundleIconFile=NAME,
15 | CFBundleName=NAME,
16 | CFBundleShortVersionString=VERSION,
17 | CFBundleGetInfoString=' '.join([NAME, VERSION]),
18 | CFBundleExecutable=NAME,
19 | CFBundleIdentifier='org.pygame.examples.aliens',
20 | )
21 |
22 | setup(
23 | data_files=['English.lproj', '../../data'],
24 | app=[
25 | #dict(script="aliens_bootstrap.py", plist=plist),
26 | dict(script="aliens.py", plist=plist),
27 | ],
28 | )
29 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Pygame build process: config.py setup.py
2 | /Setup
3 | *.pyc
4 | /build/
5 | /src_py/version.py
6 |
7 | # Windows prebuilt external libraries
8 | /prebuilt-x??
9 |
10 | # Sphinx generated files: makeref.py
11 | /docs/\.buildinfo
12 | /docs/objects.inv
13 | /docs/doctrees/
14 | /docs/_sources/
15 | /docs/_static/
16 | /docs/_images/
17 | /docs/genindex.html
18 | /docs/search.html
19 | /docs/searchindex.js
20 | /docs/tut/
21 | /docs/filepaths.html
22 | /docs/index.html
23 | /docs/ref/*.html
24 |
25 | # Emacs temporary files
26 | *~
27 |
28 | # VIM temporary files
29 | *.swp
30 |
31 | # Other
32 | envdev*
33 | .virtualenv*
34 | buildconfig/manylinux-build/wheelhouse/
35 | anenv
36 | dist
37 | .vagrant
38 | *.egg-info/
39 | *.so
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/all_ok/zero_tests_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | pass
20 |
21 | if __name__ == '__main__':
22 | unittest.main()
23 |
--------------------------------------------------------------------------------
/docs/reST/c_api/version.rst:
--------------------------------------------------------------------------------
1 | .. include:: ../common.txt
2 |
3 | .. highlight:: c
4 |
5 | ******************************************
6 | API exported by pygame.version
7 | ******************************************
8 |
9 | src_py/version.py
10 | =================
11 |
12 | Header file: src_c/include/pygame.h
13 |
14 | Version information can be retrieved at compile-time using these macros.
15 |
16 | .. versionadded:: 1.9.5
17 |
18 | .. c:macro:: PG_MAJOR_VERSION
19 |
20 | .. c:macro:: PG_MINOR_VERSION
21 |
22 | .. c:macro:: PG_PATCH_VERSION
23 |
24 | .. c:function:: PG_VERSIONNUM(MAJOR, MINOR, PATCH)
25 |
26 | Returns an integer representing the given version.
27 |
28 | .. c:function:: PG_VERSION_ATLEAST(MAJOR, MINOR, PATCH)
29 |
30 | Returns true if the current version is at least equal
31 | to the specified version.
32 |
--------------------------------------------------------------------------------
/src_py/macosx.py:
--------------------------------------------------------------------------------
1 | import platform
2 | import os
3 | import sys
4 | from pygame.pkgdata import getResource
5 | from pygame import sdlmain_osx
6 |
7 | __all__ = ['Video_AutoInit']
8 |
9 | def Video_AutoInit():
10 | """Called from the base.c just before display module is initialized."""
11 | if 'Darwin' in platform.platform():
12 | if not sdlmain_osx.RunningFromBundleWithNSApplication():
13 | try:
14 | default_icon_data = getResource('pygame_icon.tiff').read()
15 | except IOError:
16 | default_icon_data = None
17 | except NotImplementedError:
18 | default_icon_data = None
19 | sdlmain_osx.InstallNSApplication(default_icon_data)
20 | if (os.getcwd() == '/') and len(sys.argv) > 1:
21 | os.chdir(os.path.dirname(sys.argv[0]))
22 | return True
23 |
--------------------------------------------------------------------------------
/docs/__main__.py:
--------------------------------------------------------------------------------
1 | # python -m pygame.docs
2 |
3 | import os
4 | import webbrowser
5 | try:
6 | from urllib.parse import urlunparse, quote
7 | except ImportError:
8 | from urlparse import urlunparse
9 | from urllib import quote
10 |
11 | def iterpath(path):
12 | path, last = os.path.split(path)
13 | if last:
14 | for p in iterpath(path):
15 | yield p
16 | yield last
17 |
18 | pkg_dir = os.path.dirname(os.path.abspath(__file__))
19 | main_page = os.path.join(pkg_dir, 'index.html')
20 | if os.path.exists(main_page):
21 | url_path = quote('/'.join(iterpath(main_page)))
22 | drive, rest = os.path.splitdrive(__file__)
23 | if drive:
24 | url_path = "%s/%s" % (drive, url_path)
25 | url = urlunparse(('file', '', url_path, '', '', ''))
26 | else:
27 | url = "https://www.pygame.org/docs/"
28 | webbrowser.open(url)
29 |
--------------------------------------------------------------------------------
/src_py/_dummybackend.py:
--------------------------------------------------------------------------------
1 | """dummy Movie class if all else fails """
2 | class Movie:
3 | def __init__(self, filename, surface=None):
4 | self.filename=filename
5 | self.surface = surface
6 | self.process = None
7 | self.loops=0
8 | self.playing = False
9 | self.paused = False
10 | self._backend = "DUMMY"
11 | self.width=0
12 | self.height=0
13 | self.finished = 1
14 | def play(self, loops=0):
15 | self.playing= not self.playing
16 |
17 | def stop(self):
18 | self.playing=not self.playing
19 | self.paused =not self.paused
20 |
21 | def pause(self):
22 | self.paused=not self.paused
23 |
24 | def resize(self, w, h):
25 | self.width=w
26 | self.height=h
27 |
28 | def __repr__(self):
29 | return "(%s 0.0s)"%self.filename
30 |
--------------------------------------------------------------------------------
/src_c/doc/cursors_doc.h:
--------------------------------------------------------------------------------
1 | /* Auto generated file: with makeref.py . Docs go in docs/reST/ref/ . */
2 | #define DOC_PYGAMECURSORS "pygame module for cursor resources"
3 | #define DOC_PYGAMECURSORSCOMPILE "compile(strings, black='X', white='.', xor='o') -> data, mask\ncreate binary cursor data from simple strings"
4 | #define DOC_PYGAMECURSORSLOADXBM "load_xbm(cursorfile) -> cursor_args\nload_xbm(cursorfile, maskfile) -> cursor_args\nload cursor data from an XBM file"
5 |
6 |
7 | /* Docs in a comment... slightly easier to read. */
8 |
9 | /*
10 |
11 | pygame.cursors
12 | pygame module for cursor resources
13 |
14 | pygame.cursors.compile
15 | compile(strings, black='X', white='.', xor='o') -> data, mask
16 | create binary cursor data from simple strings
17 |
18 | pygame.cursors.load_xbm
19 | load_xbm(cursorfile) -> cursor_args
20 | load_xbm(cursorfile, maskfile) -> cursor_args
21 | load cursor data from an XBM file
22 |
23 | */
--------------------------------------------------------------------------------
/test/sysfont_test.py:
--------------------------------------------------------------------------------
1 | import unittest
2 | import platform
3 |
4 | class SysfontModuleTest(unittest.TestCase):
5 | def todo_test_create_aliases(self):
6 | self.fail()
7 |
8 | def todo_test_initsysfonts(self):
9 | self.fail()
10 |
11 | @unittest.skipIf('Darwin' not in platform.platform(), 'Not mac we skip.')
12 | def test_initsysfonts_darwin(self):
13 | import pygame.sysfont
14 | self.assertTrue(len(pygame.sysfont.get_fonts()) > 10)
15 |
16 | def test_sysfont(self):
17 | import pygame.font
18 | pygame.font.init()
19 | arial = pygame.font.SysFont('Arial', 40)
20 |
21 | def todo_test_initsysfonts_unix(self):
22 | self.fail()
23 |
24 | def todo_test_initsysfonts_win32(self):
25 | self.fail()
26 |
27 | ################################################################################
28 |
29 | if __name__ == '__main__':
30 | unittest.main()
31 |
--------------------------------------------------------------------------------
/test/run_tests__tests/everything/sleep_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | import time
19 |
20 | class KeyModuleTest(unittest.TestCase):
21 | def test_get_focused(self):
22 | stop_time = time.time() + 10.0
23 | while time.time() < stop_time:
24 | time.sleep(1)
25 | self.assertTrue(True)
26 |
27 |
28 | if __name__ == '__main__':
29 | unittest.main()
30 |
--------------------------------------------------------------------------------
/src_c/_camera.h:
--------------------------------------------------------------------------------
1 | /*
2 | pygame - Python Game Library
3 |
4 | This library is free software; you can redistribute it and/or
5 | modify it under the terms of the GNU Library General Public
6 | License as published by the Free Software Foundation; either
7 | version 2 of the License, or (at your option) any later version.
8 |
9 | This library is distributed in the hope that it will be useful,
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | Library General Public License for more details.
13 |
14 | You should have received a copy of the GNU Library General Public
15 | License along with this library; if not, write to the Free
16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 |
18 | */
19 |
20 | #ifndef _CAMERA_H
21 | #define _CAMERA_H
22 |
23 | #include "_pygame.h"
24 | #include "camera.h"
25 |
26 | #endif
27 |
28 |
--------------------------------------------------------------------------------
/test/run_tests__tests/timeout/sleep_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | import time
19 |
20 | class KeyModuleTest(unittest.TestCase):
21 | def test_get_focused(self):
22 | stop_time = time.time() + 10.0
23 | while time.time() < stop_time:
24 | time.sleep(1)
25 |
26 | self.assertTrue(True)
27 |
28 |
29 | if __name__ == '__main__':
30 | unittest.main()
31 |
--------------------------------------------------------------------------------
/docs/reST/_static/tooltip.css:
--------------------------------------------------------------------------------
1 | /* Implement hyperlink tooltips
2 | *
3 | * Adapted from "Sexy Tooltips with Just CSS"
4 | * http://sixrevisions.com/css/css-only-tooltips/
5 | */
6 |
7 | .tooltip {
8 | cursor: help; text-decoration: none;
9 | position: relative;
10 | }
11 |
12 | .tooltip span.tooltip-content {
13 | margin-left: -999em;
14 | position: absolute;
15 | }
16 |
17 | .tooltip:hover span.tooltip-content {
18 | position: absolute;
19 | left: 1em;
20 | top: 2em;
21 | z-index: 99;
22 | margin-left: 0;
23 | }
24 |
25 | .tooltip:hover img {
26 | border: 0;
27 | margin: -10px 0 0 -55px;
28 | float: left;
29 | position: absolute;
30 | }
31 |
32 | .tooltip:hover em {
33 | font-family: Candara, Tahoma, Geneva, sans-serif;
34 | font-size: 1.2em;
35 | font-weight: bold;
36 | display: block;
37 | padding: 0.2em 0 0.6em 0;
38 | }
39 |
40 | .classic { padding: 0.8em 1em; }
41 |
42 | .custom { padding: 0.5em 0.8em 0.8em 2em; }
43 |
44 | * html a:hover { background: transparent; }
45 |
--------------------------------------------------------------------------------
/src_c/doc/overlay_doc.h:
--------------------------------------------------------------------------------
1 | /* Auto generated file: with makeref.py . Docs go in docs/reST/ref/ . */
2 | #define DOC_PYGAMEOVERLAY "Overlay(format, (width, height)) -> Overlay\npygame object for video overlay graphics"
3 | #define DOC_OVERLAYDISPLAY "display((y, u, v)) -> None\ndisplay() -> None\nset the overlay pixel data"
4 | #define DOC_OVERLAYSETLOCATION "set_location(rect) -> None\ncontrol where the overlay is displayed"
5 | #define DOC_OVERLAYGETHARDWARE "get_hardware(rect) -> int\ntest if the Overlay is hardware accelerated"
6 |
7 |
8 | /* Docs in a comment... slightly easier to read. */
9 |
10 | /*
11 |
12 | pygame.Overlay
13 | Overlay(format, (width, height)) -> Overlay
14 | pygame object for video overlay graphics
15 |
16 | pygame.Overlay.display
17 | display((y, u, v)) -> None
18 | display() -> None
19 | set the overlay pixel data
20 |
21 | pygame.Overlay.set_location
22 | set_location(rect) -> None
23 | control where the overlay is displayed
24 |
25 | pygame.Overlay.get_hardware
26 | get_hardware(rect) -> int
27 | test if the Overlay is hardware accelerated
28 |
29 | */
--------------------------------------------------------------------------------
/src_c/_surface.h:
--------------------------------------------------------------------------------
1 | /*
2 | pygame - Python Game Library
3 | Copyright (C) 2000-2001 Pete Shinners
4 | Copyright (C) 2007 Marcus von Appen
5 |
6 | This library is free software; you can redistribute it and/or
7 | modify it under the terms of the GNU Library General Public
8 | License as published by the Free Software Foundation; either
9 | version 2 of the License, or (at your option) any later version.
10 |
11 | This library is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | Library General Public License for more details.
15 |
16 | You should have received a copy of the GNU Library General Public
17 | License along with this library; if not, write to the Free
18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 |
20 | Pete Shinners
21 | pete@shinners.org
22 | */
23 |
24 | #ifndef _SURFACE_H
25 | #define _SURFACE_H
26 |
27 | #include "_pygame.h"
28 | #include "surface.h"
29 |
30 | #endif
31 |
32 |
--------------------------------------------------------------------------------
/test/run_tests__tests/all_ok/no_assertions__ret_code_of_1__test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | pass
21 |
22 | def test_get_mods(self):
23 | pass
24 |
25 | def test_get_pressed(self):
26 | pass
27 |
28 | def test_name(self):
29 | pass
30 |
31 | def test_set_mods(self):
32 | pass
33 |
34 | def test_set_repeat(self):
35 | pass
36 |
37 | if __name__ == '__main__':
38 | unittest.main()
39 |
--------------------------------------------------------------------------------
/docs/reST/filepaths.rst:
--------------------------------------------------------------------------------
1 | File Path Function Arguments
2 | ============================
3 |
4 | File Path Function Arguments
5 | ----------------------------
6 |
7 | A pygame function or method which takes a file path argument
8 | will accept either a Unicode or a byte — 8-bit or ASCII character — string.
9 | Unicode strings are translated to Python's default filesystem encoding,
10 | as returned by sys.getfilesystemencoding().
11 | A Unicode code point above U+FFFF — '\uFFFF' — can
12 | be coded directly with a 32-bit escape
13 | sequences — '\Uxxxxxxxx' — ,
14 | even for Python interpreters built with an UCS-2 (16-bit character) Unicode type.
15 | Byte strings are passed to the operating system unchanged.
16 |
17 | Null characters — '\x00' —
18 | are not permitted in the path, raising an exception.
19 | An exception is also raised if an Unicode file path cannot be encoded.
20 | How UTF-16 surrogate codes are handled is Python-interpreter-dependent.
21 | Use UTF-32 code points and 32-bit escape sequences instead.
22 | The exception types are function-dependent.
23 |
--------------------------------------------------------------------------------
/test/overlay_test.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 |
4 | class OverlayTypeTest(unittest.TestCase):
5 | def todo_test_display(self):
6 |
7 | # __doc__ (as of 2008-08-02) for pygame.overlay.overlay.display:
8 |
9 | # Overlay.display((y, u, v)): return None
10 | # Overlay.display(): return None
11 | # set the overlay pixel data
12 |
13 | self.fail()
14 |
15 | def todo_test_get_hardware(self):
16 |
17 | # __doc__ (as of 2008-08-02) for pygame.overlay.overlay.get_hardware:
18 |
19 | # Overlay.get_hardware(rect): return int
20 | # test if the Overlay is hardware accelerated
21 |
22 | self.fail()
23 |
24 | def todo_test_set_location(self):
25 |
26 | # __doc__ (as of 2008-08-02) for pygame.overlay.overlay.set_location:
27 |
28 | # Overlay.set_location(rect): return None
29 | # control where the overlay is displayed
30 |
31 | self.fail()
32 |
33 | ################################################################################
34 |
35 | if __name__ == '__main__':
36 | unittest.main()
37 |
--------------------------------------------------------------------------------
/src_c/pgplatform.h:
--------------------------------------------------------------------------------
1 | /* platform/compiler adjustments (internal) */
2 | #ifndef PG_PLATFORM_INTERNAL_H
3 | #define PG_PLATFORM_INTERNAL_H
4 |
5 | /* This must be before all else */
6 | #if defined(__SYMBIAN32__) && defined(OPENC)
7 | #include
8 | #if defined(__WINS__)
9 | void *
10 | _alloca(size_t size);
11 | #define alloca _alloca
12 | #endif /* __WINS__ */
13 | #endif /* defined(__SYMBIAN32__) && defined(OPENC) */
14 |
15 | #include "include/pgplatform.h"
16 |
17 | #ifndef MIN
18 | #define MIN(a, b) ((a) < (b) ? (a) : (b))
19 | #endif
20 | #ifndef MAX
21 | #define MAX(a, b) ((a) > (b) ? (a) : (b))
22 | #endif
23 | #ifndef ABS
24 | #define ABS(a) (((a) < 0) ? -(a) : (a))
25 | #endif
26 |
27 | #if defined(macintosh) && defined(__MWERKS__) || defined(__SYMBIAN32__)
28 | #define PYGAME_EXPORT __declspec(export)
29 | #else
30 | #define PYGAME_EXPORT
31 | #endif
32 |
33 | /* warnings */
34 | #define PG_STRINGIZE_HELPER(x) #x
35 | #define PG_STRINGIZE(x) PG_STRINGIZE_HELPER(x)
36 | #define PG_WARN(desc) message(__FILE__ "(" PG_STRINGIZE(__LINE__) "): WARNING: " #desc)
37 |
38 | #endif /* ~PG_PLATFORM_INTERNAL_H */
39 |
--------------------------------------------------------------------------------
/test/run_tests__tests/exclude/magic_tag_test.py:
--------------------------------------------------------------------------------
1 | __tags__ = ['magic']
2 |
3 | if __name__ == '__main__':
4 | import sys
5 | import os
6 | pkg_dir = (os.path.split(
7 | os.path.split(
8 | os.path.split(
9 | os.path.abspath(__file__))[0])[0])[0])
10 | parent_dir, pkg_name = os.path.split(pkg_dir)
11 | is_pygame_pkg = (pkg_name == 'tests' and
12 | os.path.split(parent_dir)[1] == 'pygame')
13 | if not is_pygame_pkg:
14 | sys.path.insert(0, parent_dir)
15 | else:
16 | is_pygame_pkg = __name__.startswith('pygame.tests.')
17 |
18 | import unittest
19 |
20 | class KeyModuleTest(unittest.TestCase):
21 | def test_get_focused(self):
22 | self.assertTrue(True)
23 |
24 | def test_get_mods(self):
25 | self.assertTrue(True)
26 |
27 | def test_get_pressed(self):
28 | self.assertTrue(True)
29 |
30 | def test_name(self):
31 | self.assertTrue(True)
32 |
33 | def test_set_mods(self):
34 | self.assertTrue(True)
35 |
36 |
37 | if __name__ == '__main__':
38 | unittest.main()
39 |
--------------------------------------------------------------------------------
/docs/reST/ref/locals.rst:
--------------------------------------------------------------------------------
1 | .. include:: common.txt
2 |
3 | :mod:`pygame.locals`
4 | ====================
5 |
6 | .. module:: pygame.locals
7 | :synopsis: pygame constants
8 |
9 | | :sl:`pygame constants`
10 |
11 | This module contains various constants used by pygame. Its contents are
12 | automatically placed in the pygame module namespace. However, an application
13 | can use ``pygame.locals`` to include only the pygame constants with a ``from
14 | pygame.locals import *``.
15 |
16 | Detailed descriptions of the various constants can be found throughout the
17 | pygame documentation. Here are the locations of some of them.
18 |
19 | - The :mod:`pygame.display` module contains flags like ``HWSURFACE`` used by
20 | :func:`pygame.display.set_mode`.
21 | - The :mod:`pygame.event` module contains the various event types.
22 | - The :mod:`pygame.key` module lists the keyboard constants and modifiers
23 | (``K_``\* and ``MOD_``\*) relating to the ``key`` and ``mod`` attributes of
24 | the ``KEYDOWN`` and ``KEYUP`` events.
25 | - The :mod:`pygame.time` module defines ``TIMER_RESOLUTION``.
26 |
27 | .. ## pygame.locals ##
28 |
--------------------------------------------------------------------------------
/test/run_tests__tests/everything/magic_tag_test.py:
--------------------------------------------------------------------------------
1 | __tags__ = ['magic']
2 |
3 | if __name__ == '__main__':
4 | import sys
5 | import os
6 | pkg_dir = (os.path.split(
7 | os.path.split(
8 | os.path.split(
9 | os.path.abspath(__file__))[0])[0])[0])
10 | parent_dir, pkg_name = os.path.split(pkg_dir)
11 | is_pygame_pkg = (pkg_name == 'tests' and
12 | os.path.split(parent_dir)[1] == 'pygame')
13 | if not is_pygame_pkg:
14 | sys.path.insert(0, parent_dir)
15 | else:
16 | is_pygame_pkg = __name__.startswith('pygame.tests.')
17 |
18 | import unittest
19 |
20 | class KeyModuleTest(unittest.TestCase):
21 | def test_get_focused(self):
22 | self.assertTrue(True)
23 |
24 | def test_get_mods(self):
25 | self.assertTrue(True)
26 |
27 | def test_get_pressed(self):
28 | self.assertTrue(True)
29 |
30 | def test_name(self):
31 | self.assertTrue(True)
32 |
33 | def test_set_mods(self):
34 | self.assertTrue(True)
35 |
36 |
37 | if __name__ == '__main__':
38 | unittest.main()
39 |
--------------------------------------------------------------------------------
/src_c/pgarrinter.h:
--------------------------------------------------------------------------------
1 | /* array structure interface version 3 declarations */
2 |
3 | #if !defined(PG_ARRAYINTER_HEADER)
4 | #define PG_ARRAYINTER_HEADER
5 |
6 | static const int PAI_CONTIGUOUS = 0x01;
7 | static const int PAI_FORTRAN = 0x02;
8 | static const int PAI_ALIGNED = 0x100;
9 | static const int PAI_NOTSWAPPED = 0x200;
10 | static const int PAI_WRITEABLE = 0x400;
11 | static const int PAI_ARR_HAS_DESCR = 0x800;
12 |
13 | typedef struct {
14 | int two; /* contains the integer 2 -- simple sanity check */
15 | int nd; /* number of dimensions */
16 | char typekind; /* kind in array -- character code of typestr */
17 | int itemsize; /* size of each element */
18 | int flags; /* flags indicating how the data should be */
19 | /* interpreted */
20 | Py_intptr_t *shape; /* A length-nd array of shape information */
21 | Py_intptr_t *strides; /* A length-nd array of stride information */
22 | void *data; /* A pointer to the first element of the array */
23 | PyObject *descr; /* NULL or a data-description */
24 | } PyArrayInterface;
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/test/run_tests__tests/incomplete/fake_2_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def todo_test_get_pressed(self):
26 | self.fail()
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def todo_test_set_mods(self):
32 | self.fail()
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/all_ok/fake_2_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/all_ok/fake_3_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/all_ok/fake_4_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/all_ok/fake_5_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/all_ok/fake_6_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/everything/fake_2_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/exclude/fake_2_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/failures1/fake_2_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/failures1/fake_3_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/incomplete/fake_3_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/timeout/fake_2_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/incomplete_todo/fake_3_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/infinite_loop/fake_2_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/print_stderr/fake_2_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/print_stdout/fake_2_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/incomplete_todo/fake_2_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def todo_test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def todo_test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/test/run_tests__tests/infinite_loop/fake_1_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | while True:
24 | pass
25 |
26 | def test_get_pressed(self):
27 | self.assertTrue(True)
28 |
29 | def test_name(self):
30 | self.assertTrue(True)
31 |
32 | def test_set_mods(self):
33 | self.assertTrue(True)
34 |
35 | def test_set_repeat(self):
36 | self.assertTrue(True)
37 |
38 |
39 | if __name__ == '__main__':
40 | unittest.main()
41 |
--------------------------------------------------------------------------------
/test/run_tests__tests/everything/incomplete_todo_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def todo_test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def todo_test_set_mods(self):
32 | self.assertTrue(True)
33 |
34 | def test_set_repeat(self):
35 | self.assertTrue(True)
36 |
37 |
38 | if __name__ == '__main__':
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/docs/reST/ext/customversion.py:
--------------------------------------------------------------------------------
1 | from sphinx.domains.changeset import versionlabels, VersionChange
2 | from sphinx.locale import _ # just to suppress warnings
3 |
4 | try:
5 | from sphinx.domains.changeset import versionlabel_classes
6 | except ImportError:
7 | # versionlabel_classes doesn't exist in old Sphinx versions.
8 | UPDATE_VERIONLABEL_CLASSES = False
9 | else:
10 | UPDATE_VERIONLABEL_CLASSES = True
11 |
12 |
13 | labels = ('versionadded', 'versionchanged', 'deprecated', 'versionextended')
14 |
15 |
16 | def set_version_formats(app, config):
17 | for label in labels:
18 | versionlabels[label] = \
19 | _(getattr(config, '{}_format'.format(label)))
20 |
21 |
22 | def setup(app):
23 | app.add_directive('versionextended', VersionChange)
24 | versionlabels['versionextended'] = 'Extended in pygame %s'
25 |
26 | if UPDATE_VERIONLABEL_CLASSES:
27 | versionlabel_classes['versionextended'] = 'extended'
28 |
29 | for label in ('versionadded', 'versionchanged', 'deprecated', 'versionextended'):
30 | app.add_config_value('{}_format'.format(label), str(versionlabels[label]), 'env')
31 |
32 | app.connect('config-inited', set_version_formats)
33 |
--------------------------------------------------------------------------------
/src_c/pygame.h:
--------------------------------------------------------------------------------
1 | /*
2 | pygame - Python Game Library
3 | Copyright (C) 2000-2001 Pete Shinners
4 |
5 | This library is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU Library General Public
7 | License as published by the Free Software Foundation; either
8 | version 2 of the License, or (at your option) any later version.
9 |
10 | This library is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | Library General Public License for more details.
14 |
15 | You should have received a copy of the GNU Library General Public
16 | License along with this library; if not, write to the Free
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 |
19 | Pete Shinners
20 | pete@shinners.org
21 | */
22 |
23 | /* This will use PYGAMEAPI_DEFINE_SLOTS instead
24 | * of PYGAMEAPI_EXTERN_SLOTS for base modules.
25 | */
26 | #ifndef PYGAME_INTERNAL_H
27 | #define PYGAME_INTERNAL_H
28 |
29 | #define PYGAME_H
30 | #include "_pygame.h"
31 |
32 | #endif /* ~PYGAME_INTERNAL_H */
33 |
--------------------------------------------------------------------------------
/src_c/pgcompat.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #if defined(SDL_VERSION_ATLEAST)
4 | #if !(SDL_VERSION_ATLEAST(2, 0, 5))
5 | /* These functions require SDL 2.0.5 or greater.
6 |
7 | https://wiki.libsdl.org/SDL_SetWindowResizable
8 | */
9 | void
10 | SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable)
11 | {
12 | }
13 | int
14 | SDL_GetWindowOpacity(SDL_Window *window, float *opacity)
15 | {
16 | SDL_SetError("SDL 2.0.5 or greater required");
17 | return -1;
18 | }
19 | int
20 | SDL_SetWindowOpacity(SDL_Window *window, float opacity)
21 | {
22 | SDL_SetError("SDL 2.0.5 or greater required");
23 | return -1;
24 | }
25 |
26 | int
27 | SDL_SetWindowModalFor(SDL_Window *modal_window, SDL_Window *parent_window)
28 | {
29 | SDL_SetError("SDL 2.0.5 or greater required");
30 | return -1;
31 | }
32 | int
33 | SDL_SetWindowInputFocus(SDL_Window *window)
34 | {
35 | SDL_SetError("SDL 2.0.5 or greater required");
36 | return -1;
37 | }
38 | SDL_Surface *
39 | SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth,
40 | Uint32 format)
41 | {
42 | SDL_SetError("SDL 2.0.5 or greater required");
43 | return NULL;
44 | }
45 |
46 | #endif
47 | #endif
--------------------------------------------------------------------------------
/test/run_tests__tests/exclude/invisible_tag_test.py:
--------------------------------------------------------------------------------
1 | __tags__ = ['invisible']
2 |
3 | if __name__ == '__main__':
4 | import sys
5 | import os
6 | pkg_dir = (os.path.split(
7 | os.path.split(
8 | os.path.split(
9 | os.path.abspath(__file__))[0])[0])[0])
10 | parent_dir, pkg_name = os.path.split(pkg_dir)
11 | is_pygame_pkg = (pkg_name == 'tests' and
12 | os.path.split(parent_dir)[1] == 'pygame')
13 | if not is_pygame_pkg:
14 | sys.path.insert(0, parent_dir)
15 | else:
16 | is_pygame_pkg = __name__.startswith('pygame.tests.')
17 |
18 | import unittest
19 |
20 | class KeyModuleTest(unittest.TestCase):
21 | def test_get_focused(self):
22 | self.assertTrue(True)
23 |
24 | def test_get_mods(self):
25 | self.assertTrue(True)
26 |
27 | def test_get_pressed(self):
28 | self.assertTrue(True)
29 |
30 | def test_name(self):
31 | self.assertTrue(True)
32 |
33 | def test_set_mods(self):
34 | self.assertTrue(True)
35 |
36 | def test_set_repeat(self):
37 | self.assertTrue(True)
38 |
39 |
40 | if __name__ == '__main__':
41 | unittest.main()
42 |
--------------------------------------------------------------------------------
/src_py/locals.py:
--------------------------------------------------------------------------------
1 | ## pygame - Python Game Library
2 | ## Copyright (C) 2000-2003 Pete Shinners
3 | ##
4 | ## This library is free software; you can redistribute it and/or
5 | ## modify it under the terms of the GNU Library General Public
6 | ## License as published by the Free Software Foundation; either
7 | ## version 2 of the License, or (at your option) any later version.
8 | ##
9 | ## This library is distributed in the hope that it will be useful,
10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | ## Library General Public License for more details.
13 | ##
14 | ## You should have received a copy of the GNU Library General Public
15 | ## License along with this library; if not, write to the Free
16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 | ##
18 | ## Pete Shinners
19 | ## pete@shinners.org
20 |
21 |
22 |
23 | """Set of functions from PyGame that are handy to have in
24 | the local namespace for your module"""
25 |
26 | from pygame.constants import *
27 | from pygame.rect import Rect
28 | import pygame.color as color
29 | Color = color.Color
30 |
31 |
--------------------------------------------------------------------------------
/test/run_tests__tests/failures1/fake_4_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(False, "Some Jibberish")
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | if 1:
33 | if 1:
34 | assert False
35 |
36 | def test_set_repeat(self):
37 | self.assertTrue(True)
38 |
39 |
40 | if __name__ == '__main__':
41 | unittest.main()
42 |
--------------------------------------------------------------------------------
/examples/aacircle.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | """Proof of concept gfxdraw example"""
4 |
5 | import pygame
6 | import pygame.gfxdraw
7 |
8 |
9 | def main():
10 | pygame.init()
11 | screen = pygame.display.set_mode((500, 500))
12 | screen.fill((255, 0, 0))
13 | s = pygame.Surface(screen.get_size(), pygame.SRCALPHA, 32)
14 | pygame.draw.line(s, (0, 0, 0), (250, 250), (250 + 200, 250))
15 |
16 | width = 1
17 | for a_radius in range(width):
18 | radius = 200
19 | pygame.gfxdraw.aacircle(s, 250, 250, radius - a_radius, (0, 0, 0))
20 |
21 | screen.blit(s, (0, 0))
22 |
23 | pygame.draw.circle(screen, pygame.Color("GREEN"), (50, 100), 10)
24 | pygame.draw.circle(screen, pygame.Color("BLACK"), (50, 100), 10, 1)
25 |
26 | pygame.display.flip()
27 | try:
28 | while 1:
29 | event = pygame.event.wait()
30 | if event.type == pygame.QUIT:
31 | break
32 | if event.type == pygame.KEYDOWN:
33 | if event.key == pygame.K_ESCAPE or event.unicode == "q":
34 | break
35 | pygame.display.flip()
36 | finally:
37 | pygame.quit()
38 |
39 |
40 | if __name__ == "__main__":
41 | main()
42 |
--------------------------------------------------------------------------------
/test/run_tests__tests/print_stderr/fake_3_test.py:
--------------------------------------------------------------------------------
1 | import sys
2 | if __name__ == '__main__':
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(True)
27 |
28 | def test_name(self):
29 | sys.stderr.write("jibberish messes things up\n")
30 | self.assertTrue(False)
31 |
32 | def test_set_mods(self):
33 | self.assertTrue(True)
34 |
35 | def test_set_repeat(self):
36 | self.assertTrue(True)
37 |
38 |
39 | if __name__ == '__main__':
40 | unittest.main()
41 |
--------------------------------------------------------------------------------
/test/run_tests__tests/print_stderr/fake_4_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(False, "Some Jibberish")
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | if 1:
33 | if 1:
34 | assert False
35 |
36 | def test_set_repeat(self):
37 | self.assertTrue(True)
38 |
39 |
40 | if __name__ == '__main__':
41 | unittest.main()
42 |
--------------------------------------------------------------------------------
/test/run_tests__tests/print_stdout/fake_4_test.py:
--------------------------------------------------------------------------------
1 | if __name__ == '__main__':
2 | import sys
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | self.assertTrue(False, "Some Jibberish")
27 |
28 | def test_name(self):
29 | self.assertTrue(True)
30 |
31 | def test_set_mods(self):
32 | if 1:
33 | if 1:
34 | assert False
35 |
36 | def test_set_repeat(self):
37 | self.assertTrue(True)
38 |
39 |
40 | if __name__ == '__main__':
41 | unittest.main()
42 |
--------------------------------------------------------------------------------
/examples/setmodescale.py:
--------------------------------------------------------------------------------
1 | import pygame
2 | from pygame.locals import *
3 |
4 | pygame.init()
5 |
6 | RES = (160, 120)
7 | FPS = 30
8 | clock = pygame.time.Clock()
9 |
10 | screen = pygame.display.set_mode(RES, SCALED | RESIZABLE)
11 |
12 | # MAIN LOOP
13 |
14 | done = False
15 |
16 | i = 0
17 | j = 0
18 |
19 | while not done:
20 | for event in pygame.event.get():
21 | if event.type == KEYDOWN and event.key == K_q:
22 | done = True
23 | if event.type == QUIT:
24 | done = True
25 | if event.type == KEYDOWN and event.key == K_f:
26 | pygame.display.toggle_fullscreen()
27 | if event.type == VIDEORESIZE:
28 | pygame.display.resize_event(event)
29 |
30 | i += 1
31 | i = i % screen.get_width()
32 | j += i % 2
33 | j = j % screen.get_height()
34 |
35 | screen.fill((255, 0, 255))
36 | pygame.draw.circle(screen, (0, 0, 0), (100, 100), 20)
37 | pygame.draw.circle(screen, (0, 0, 200), (0, 0), 10)
38 | pygame.draw.circle(screen, (200, 0, 0), (160, 120), 30)
39 | pygame.draw.line(screen, (250, 250, 0), (0, 120), (160, 0))
40 | pygame.draw.circle(screen, (255, 255, 255), (i, j), 5)
41 |
42 | pygame.display.flip()
43 | clock.tick(FPS)
44 |
--------------------------------------------------------------------------------
/src_c/doc/touch_doc.h:
--------------------------------------------------------------------------------
1 | /* Auto generated file: with makeref.py . Docs go in docs/reST/ref/ . */
2 | #define DOC_PYGAMESDL2TOUCH "pygame module to work with touch input"
3 | #define DOC_PYGAMESDL2TOUCHGETNUMDEVICES "get_num_devices() -> int\nget the number of touch devices"
4 | #define DOC_PYGAMESDL2TOUCHGETDEVICE "get_device(index) -> touchid\nget the a touch device id for a given index"
5 | #define DOC_PYGAMESDL2TOUCHGETNUMFINGERS "get_num_fingers(touchid) -> int\nthe number of active fingers for a given touch device"
6 | #define DOC_PYGAMESDL2TOUCHGETFINGER "get_finger(touchid, index) -> int\nget information about an active finger"
7 |
8 |
9 | /* Docs in a comment... slightly easier to read. */
10 |
11 | /*
12 |
13 | pygame._sdl2.touch
14 | pygame module to work with touch input
15 |
16 | pygame._sdl2.touch.get_num_devices
17 | get_num_devices() -> int
18 | get the number of touch devices
19 |
20 | pygame._sdl2.touch.get_device
21 | get_device(index) -> touchid
22 | get the a touch device id for a given index
23 |
24 | pygame._sdl2.touch.get_num_fingers
25 | get_num_fingers(touchid) -> int
26 | the number of active fingers for a given touch device
27 |
28 | pygame._sdl2.touch.get_finger
29 | get_finger(touchid, index) -> int
30 | get information about an active finger
31 |
32 | */
--------------------------------------------------------------------------------
/docs/reST/c_api/cdrom.rst:
--------------------------------------------------------------------------------
1 | .. include:: ../common.txt
2 |
3 | .. highlight:: c
4 |
5 | ********************************
6 | API exported by pygame.cdrom
7 | ********************************
8 |
9 | src_c/cdrom.c
10 | =============
11 |
12 | The :py:mod:`pygame.cdrom` extension module. Only available for SDL 1.
13 |
14 | Header file: src_c/include/pygame.h
15 |
16 |
17 | .. c:type:: pgCDObject
18 |
19 | The :py:class:`pygame.cdrom.CD` instance C struct.
20 |
21 | .. c:var:: PyTypeObject pgCD_Type
22 |
23 | The :py:class:`pygame.cdrom.CD` Python type.
24 |
25 | .. c:function:: PyObject* pgCD_New(int id)
26 |
27 | Return a new :py:class:`pygame.cdrom.CD` instance for CD drive *id*.
28 | On error raise a Python exception and return ``NULL``.
29 |
30 | .. c:function:: int pgCD_Check(PyObject *x)
31 |
32 | Return true if *x* is a :py:class:`pygame.cdrom.CD` instance.
33 | Will return false for a subclass of :py:class:`CD`.
34 | This is a macro. No check is made that *x* is not ``NULL``.
35 |
36 | .. c:function:: int pgCD_AsID(PyObject *x)
37 |
38 | Return the CD identifier associated with the :py:class:`pygame.cdrom.CD`
39 | instance *x*.
40 | This is a macro. No check is made that *x* is a :py:class:`pygame.cdrom.CD`
41 | instance or is not ``NULL``.
42 |
--------------------------------------------------------------------------------
/docs/reST/_templates/header.h:
--------------------------------------------------------------------------------
1 | {#- Generate an extension module header file of doc strings #}
2 |
3 | {%- set classmembers = ['attribute', 'method', 'staticmethod', 'classmethod'] %}
4 |
5 | {%- macro cmacro(item) %}
6 | {%- if item['desctype'] in classmembers %}
7 | {%- set start_at = -2 %}
8 | {%- else %}
9 | {%- set start_at = 0 %}
10 | {%- endif %}
11 | {%- set name = item['fullname'] %}
12 | {{- 'DOC_' + name.split('.')[start_at:]|join('')|replace('_', '')|upper }}
13 | {%- endmacro %}
14 |
15 | {%- macro join_sigs(item) %}
16 | {%- set sigs = item['signatures'] %}
17 | {%- if sigs %}
18 | {{- sigs|join('\\n') + '\\n' }}
19 | {%- else %}
20 | {{- '' }}
21 | {%- endif %}
22 | {%- endmacro %}
23 |
24 | {#- -#}
25 |
26 |
27 | /* Auto generated file: with makeref.py . Docs go in docs/reST/ref/ . */
28 | {% for item in hdr_items -%}
29 | #define {{ cmacro(item) }} "{{ join_sigs(item) }}{{ item['summary'] }}"
30 | {% endfor %}
31 |
32 | /* Docs in a comment... slightly easier to read. */
33 |
34 | /*
35 |
36 | {% for item in hdr_items -%}
37 | {{ item['fullname'] }}
38 | {% set sigs = item['signatures'] -%}
39 | {% if sigs -%}
40 | {{ ' ' + sigs|join('\n ') }}
41 | {% endif -%}
42 | {{ item['summary'] }}
43 |
44 | {% endfor -%}
45 | */
46 |
--------------------------------------------------------------------------------
/docs/reST/themes/classic/theme.conf:
--------------------------------------------------------------------------------
1 | [theme]
2 | inherit = basic
3 | stylesheet = pygame.css
4 | pygments_style = sphinx
5 |
6 | [options]
7 | home_uri = ''
8 | embedded = true
9 | nosidebar = true
10 | nofooter = true
11 | relbar = false
12 | noheader = false
13 | noheading = false
14 | notableofcontents = false
15 |
16 | footerbgcolor = #11303d
17 | footertextcolor = #000000
18 | sidebarbgcolor = #1c4e63
19 | sidebartextcolor = #ffffff
20 | sidebarlinkcolor = #98dbcc
21 | relbarbgcolor = #6aee28
22 | relbartextcolor = #000000
23 | relbarlinkcolor = #000000
24 | bgcolor = #aaeebb
25 | textcolor = #000000
26 | headbgcolor = #f2f2f2
27 | headtextcolor = #20435c
28 | headlinkcolor = #c60f0f
29 | linkcolor = #000000
30 | codebgcolor = #eeffcc
31 | codetextcolor = #333333
32 | headerbgcolor = #6aee28
33 | logobgcolor = #c2fc20
34 | tooltipbgcolor = #c2fc20
35 | tooltipbdrcolor = #ace01C
36 |
37 | headerborder = 3px solid black
38 |
39 | bodyfont = sans-serif
40 | headfont = sans-serif
41 | sigfont = monospace
42 |
--------------------------------------------------------------------------------
/src_c/doc/bufferproxy_doc.h:
--------------------------------------------------------------------------------
1 | /* Auto generated file: with makeref.py . Docs go in docs/reST/ref/ . */
2 | #define DOC_PYGAMEBUFFERPROXY "BufferProxy() -> BufferProxy\npygame object to export a surface buffer through an array protocol"
3 | #define DOC_BUFFERPROXYPARENT "parent -> Surface\nparent -> \nReturn wrapped exporting object."
4 | #define DOC_BUFFERPROXYLENGTH "length -> int\nThe size, in bytes, of the exported buffer."
5 | #define DOC_BUFFERPROXYRAW "raw -> bytes\nA copy of the exported buffer as a single block of bytes."
6 | #define DOC_BUFFERPROXYWRITE "write(buffer, offset=0)\nWrite raw bytes to object buffer."
7 |
8 |
9 | /* Docs in a comment... slightly easier to read. */
10 |
11 | /*
12 |
13 | pygame.BufferProxy
14 | BufferProxy() -> BufferProxy
15 | pygame object to export a surface buffer through an array protocol
16 |
17 | pygame.BufferProxy.parent
18 | parent -> Surface
19 | parent ->
20 | Return wrapped exporting object.
21 |
22 | pygame.BufferProxy.length
23 | length -> int
24 | The size, in bytes, of the exported buffer.
25 |
26 | pygame.BufferProxy.raw
27 | raw -> bytes
28 | A copy of the exported buffer as a single block of bytes.
29 |
30 | pygame.BufferProxy.write
31 | write(buffer, offset=0)
32 | Write raw bytes to object buffer.
33 |
34 | */
--------------------------------------------------------------------------------
/test/run_tests__tests/print_stdout/fake_3_test.py:
--------------------------------------------------------------------------------
1 | import sys
2 | if __name__ == '__main__':
3 | import os
4 | pkg_dir = (os.path.split(
5 | os.path.split(
6 | os.path.split(
7 | os.path.abspath(__file__))[0])[0])[0])
8 | parent_dir, pkg_name = os.path.split(pkg_dir)
9 | is_pygame_pkg = (pkg_name == 'tests' and
10 | os.path.split(parent_dir)[1] == 'pygame')
11 | if not is_pygame_pkg:
12 | sys.path.insert(0, parent_dir)
13 | else:
14 | is_pygame_pkg = __name__.startswith('pygame.tests.')
15 |
16 | import unittest
17 |
18 | class KeyModuleTest(unittest.TestCase):
19 | def test_get_focused(self):
20 | self.assertTrue(True)
21 |
22 | def test_get_mods(self):
23 | self.assertTrue(True)
24 |
25 | def test_get_pressed(self):
26 | sys.stdout.write("jibberish ruins everything\n")
27 | self.assertTrue(False)
28 |
29 | def test_name(self):
30 | sys.stdout.write("forgot to remove debug crap\n")
31 | self.assertTrue(True)
32 |
33 | def test_set_mods(self):
34 | self.assertTrue(True)
35 |
36 | def test_set_repeat(self):
37 | self.assertTrue(True)
38 |
39 |
40 | if __name__ == '__main__':
41 | unittest.main()
42 |
--------------------------------------------------------------------------------
/docs/reST/_static/reset.css:
--------------------------------------------------------------------------------
1 | /* Set browser to a known state to get around browser incompatibilities.
2 | * Copied from http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/
3 | */
4 | html, body, div, span, applet, object, iframe,
5 | h1, h2, h3, h4, h5, h6, p, blockquote, pre,
6 | a, abbr, acronym, address, big, cite, code,
7 | del, dfn, em, font, img, ins, kbd, q, s, samp,
8 | small, strike, strong, sub, sup, tt, var,
9 | dl, dt, dd, ol, ul, li,
10 | fieldset, form, label, legend,
11 | table, caption, tbody, tfoot, thead, tr, th, td {
12 | margin: 0;
13 | padding: 0;
14 | border: 0;
15 | outline: 0;
16 | font-weight: inherit;
17 | font-style: inherit;
18 | font-size: 100%;
19 | font-family: inherit;
20 | vertical-align: baseline;
21 | }
22 | /* remember to define focus styles! */
23 | :focus {
24 | outline: 0;
25 | }
26 | body {
27 | line-height: 1;
28 | color: black;
29 | background: white;
30 | }
31 | ol, ul {
32 | list-style: none;
33 | }
34 | /* tables still need 'cellspacing="0"' in the markup */
35 | table {
36 | border-collapse: separate;
37 | border-spacing: 0;
38 | }
39 | caption, th, td {
40 | text-align: left;
41 | font-weight: normal;
42 | }
43 | blockquote:before, blockquote:after,
44 | q:before, q:after {
45 | content: "";
46 | }
47 | blockquote, q {
48 | quotes: "" "";
49 | }
50 |
--------------------------------------------------------------------------------
/docs/reST/c_api/display.rst:
--------------------------------------------------------------------------------
1 | .. include:: ../common.txt
2 |
3 | .. highlight:: c
4 |
5 | **********************************
6 | API exported by pygame.display
7 | **********************************
8 |
9 | src_c/display.c
10 | ===============
11 |
12 | This is the :py:mod:`pygame.display` extension module.
13 |
14 | Header file: src_c/include/pygame.h
15 |
16 |
17 | .. c:type:: pgVidInfoObject
18 |
19 | A pygame object that wraps an SDL_VideoInfo struct.
20 | The object returned by :py:func:`pgyame.display.Info()`.
21 |
22 | .. c:var:: PyTypeObject *pgVidInfo_Type
23 |
24 | The pgVidInfoObject object Python type.
25 |
26 | .. c:function:: SDL_VideoInfo pgVidInfo_AsVidInfo(PyObject *obj)
27 |
28 | Return the SDL_VideoInfo field of *obj*, a :c:data:`pgVidInfo_Type` instance.
29 | This macro does not check that *obj* is not ``NULL`` or an actual :c:type:`pgVidInfoObject` object.
30 |
31 | .. c:function:: PyObject* pgVidInfo_New(SDL_VideoInfo *i)
32 |
33 | Return a new :c:type:`pgVidInfoObject` object for the SDL_VideoInfo *i*.
34 | On failure, raise a Python exception and return ``NULL``.
35 |
36 | .. c:function:: int pgVidInfo_Check(PyObject *x)
37 |
38 | Return true if *x* is a :c:data:`pgVidInfo_Type` instance
39 |
40 | Will return false if *x* is a subclass of :c:data:`pgVidInfo_Type`.
41 | This macro does not check that *x* is not ``NULL``.
42 |
--------------------------------------------------------------------------------
/src_c/include/pgplatform.h:
--------------------------------------------------------------------------------
1 | /* platform/compiler adjustments */
2 | #ifndef PG_PLATFORM_H
3 | #define PG_PLATFORM_H
4 |
5 | #if defined(HAVE_SNPRINTF) /* defined in python.h (pyerrors.h) and SDL.h \
6 | (SDL_config.h) */
7 | #undef HAVE_SNPRINTF /* remove GCC redefine warning */
8 | #endif /* HAVE_SNPRINTF */
9 |
10 | #ifndef PG_INLINE
11 | #if defined(__clang__)
12 | #define PG_INLINE __inline__ __attribute__((__unused__))
13 | #elif defined(__GNUC__)
14 | #define PG_INLINE __inline__
15 | #elif defined(_MSC_VER)
16 | #define PG_INLINE __inline
17 | #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
18 | #define PG_INLINE inline
19 | #else
20 | #define PG_INLINE
21 | #endif
22 | #endif /* ~PG_INLINE */
23 |
24 | /* This is unconditionally defined in Python.h */
25 | #if defined(_POSIX_C_SOURCE)
26 | #undef _POSIX_C_SOURCE
27 | #endif
28 |
29 | /* No signal() */
30 | #if defined(__SYMBIAN32__) && defined(HAVE_SIGNAL_H)
31 | #undef HAVE_SIGNAL_H
32 | #endif
33 |
34 | #if defined(HAVE_SNPRINTF)
35 | #undef HAVE_SNPRINTF
36 | #endif
37 |
38 | /* SDL needs WIN32 */
39 | #if !defined(WIN32) && \
40 | (defined(MS_WIN32) || defined(_WIN32) || \
41 | defined(__WIN32) || defined(__WIN32__) || defined(_WINDOWS))
42 | #define WIN32
43 | #endif
44 |
45 | #endif /* ~PG_PLATFORM_H */
46 |
--------------------------------------------------------------------------------
/test/touch_test.py:
--------------------------------------------------------------------------------
1 | import unittest
2 | import pygame
3 | from pygame._sdl2 import touch
4 |
5 |
6 | has_touchdevice = touch.get_num_devices() > 0
7 |
8 |
9 | class TouchTest(unittest.TestCase):
10 |
11 | @classmethod
12 | def setUpClass(cls):
13 | pygame.display.init()
14 |
15 | @classmethod
16 | def tearDownClass(cls):
17 | pygame.display.quit()
18 |
19 | def test_num_devices(self):
20 | touch.get_num_devices()
21 |
22 | @unittest.skipIf(not has_touchdevice, 'no touch devices found')
23 | def test_get_device(self):
24 | touch.get_device(0)
25 |
26 | def test_num_fingers__invalid(self):
27 | self.assertRaises(pygame.error, touch.get_device, -1234)
28 | self.assertRaises(TypeError, touch.get_device, 'test')
29 |
30 | @unittest.skipIf(not has_touchdevice, 'no touch devices found')
31 | def test_num_fingers(self):
32 | touch.get_num_fingers(touch.get_device(0))
33 |
34 | def test_num_fingers__invalid(self):
35 | self.assertRaises(TypeError, touch.get_num_fingers, 'test')
36 | self.assertRaises(pygame.error, touch.get_num_fingers, -1234)
37 |
38 | @unittest.skipIf(not has_touchdevice, 'no touch devices found')
39 | def todo_test_get_finger(self):
40 | """ask for touch input and check the dict"""
41 |
42 |
43 | if __name__ == '__main__':
44 | unittest.main()
45 |
--------------------------------------------------------------------------------
/src_c/include/pygame.h:
--------------------------------------------------------------------------------
1 | /*
2 | pygame - Python Game Library
3 | Copyright (C) 2000-2001 Pete Shinners
4 |
5 | This library is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU Library General Public
7 | License as published by the Free Software Foundation; either
8 | version 2 of the License, or (at your option) any later version.
9 |
10 | This library is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | Library General Public License for more details.
14 |
15 | You should have received a copy of the GNU Library General Public
16 | License along with this library; if not, write to the Free
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 |
19 | Pete Shinners
20 | pete@shinners.org
21 | */
22 |
23 | /* To allow the Pygame C api to be globally shared by all code within an
24 | * extension module built from multiple C files, only include the pygame.h
25 | * header within the top level C file, the one which calls the
26 | * 'import_pygame_*' macros. All other C source files of the module should
27 | * include _pygame.h instead.
28 | */
29 | #ifndef PYGAME_H
30 | #define PYGAME_H
31 |
32 | #include "_pygame.h"
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/test/image__save_gl_surface_test.py:
--------------------------------------------------------------------------------
1 | import os
2 | import unittest
3 |
4 | from pygame.tests import test_utils
5 | import pygame
6 | from pygame.locals import *
7 |
8 |
9 | @unittest.skipIf(os.environ.get('SDL_VIDEODRIVER') == 'dummy',
10 | 'OpenGL requires a non-"dummy" SDL_VIDEODRIVER')
11 | class GL_ImageSave(unittest.TestCase):
12 | def test_image_save_works_with_opengl_surfaces(self):
13 | """
14 | |tags:display,slow,opengl|
15 | """
16 |
17 | pygame.display.init()
18 | screen = pygame.display.set_mode((640,480), OPENGL|DOUBLEBUF)
19 | pygame.display.flip()
20 |
21 | tmp_dir = test_utils.get_tmp_dir()
22 | # Try the imageext module.
23 | tmp_file = os.path.join(tmp_dir, "opengl_save_surface_test.png")
24 | pygame.image.save(screen, tmp_file)
25 |
26 | self.assertTrue(os.path.exists(tmp_file))
27 |
28 | os.remove(tmp_file)
29 |
30 | # Only test the image module.
31 | tmp_file = os.path.join(tmp_dir, "opengl_save_surface_test.bmp")
32 | pygame.image.save(screen, tmp_file)
33 |
34 | self.assertTrue(os.path.exists(tmp_file))
35 |
36 | os.remove(tmp_file)
37 |
38 | # stops tonnes of tmp dirs building up in trunk dir
39 | os.rmdir(tmp_dir)
40 | pygame.display.quit()
41 |
42 |
43 | if __name__ == '__main__':
44 | unittest.main()
45 |
--------------------------------------------------------------------------------
/docs/reST/ext/edit_on_github.py:
--------------------------------------------------------------------------------
1 | """
2 | from: https://gist.github.com/mgedmin/6052926
3 | Sphinx extension to add ReadTheDocs-style "Edit on GitHub" links to the
4 | sidebar.
5 | Loosely based on https://github.com/astropy/astropy/pull/347
6 | """
7 |
8 | import os
9 | import warnings
10 |
11 |
12 | __licence__ = 'BSD (3 clause)'
13 |
14 |
15 | def get_github_url(app, view, path):
16 | return 'https://github.com/{project}/{view}/{branch}/docs/reST/{path}'.format(
17 | project=app.config.edit_on_github_project,
18 | view=view,
19 | branch=app.config.edit_on_github_branch,
20 | path=path)
21 |
22 |
23 | def html_page_context(app, pagename, templatename, context, doctree):
24 | if templatename != 'page.html':
25 | return
26 |
27 | if not app.config.edit_on_github_project:
28 | warnings.warn("edit_on_github_project not specified")
29 | return
30 |
31 | path = os.path.relpath(doctree.get('source'), app.builder.srcdir)
32 | show_url = get_github_url(app, 'blob', path)
33 | edit_url = get_github_url(app, 'edit', path)
34 |
35 | context['show_on_github_url'] = show_url
36 | context['edit_on_github_url'] = edit_url
37 |
38 |
39 | def setup(app):
40 | app.add_config_value('edit_on_github_project', '', True)
41 | app.add_config_value('edit_on_github_branch', 'master', True)
42 | app.connect('html-page-context', html_page_context)
43 |
--------------------------------------------------------------------------------
/test/__init__.py:
--------------------------------------------------------------------------------
1 | """Pygame unit test suite package
2 |
3 | Exports function run()
4 |
5 | A quick way to run the test suite package from the command line
6 | is by importing the go submodule:
7 |
8 | python -m "import pygame.tests" []
9 |
10 | Command line option --help displays a usage message. Available options
11 | correspond to the pygame.tests.run arguments.
12 |
13 | The xxxx_test submodules of the tests package are unit test suites for
14 | individual parts of Pygame. Each can also be run as a main program. This is
15 | useful if the test, such as cdrom_test, is interactive.
16 |
17 | For Pygame development the test suite can be run from a Pygame distribution
18 | root directory using run_tests.py. Alternately, test/__main__.py can be run
19 | directly.
20 |
21 | """
22 |
23 | if __name__ == 'pygame.tests':
24 | from pygame.tests.test_utils.run_tests import run
25 | elif __name__ == '__main__':
26 | import os
27 | import sys
28 | pkg_dir = os.path.split(os.path.abspath(__file__))[0]
29 | parent_dir, pkg_name = os.path.split(pkg_dir)
30 | is_pygame_pkg = (pkg_name == 'tests' and
31 | os.path.split(parent_dir)[1] == 'pygame')
32 | if not is_pygame_pkg:
33 | sys.path.insert(0, parent_dir)
34 |
35 | if is_pygame_pkg:
36 | import pygame.tests.__main__
37 | else:
38 | import test.__main__
39 | else:
40 | from test.test_utils.run_tests import run
41 |
--------------------------------------------------------------------------------
/src_c/cython/pygame/_sdl2/sdl2.pxd:
--------------------------------------------------------------------------------
1 | # cython: language_level=2
2 | #
3 |
4 | from libc.string cimport memset
5 | from libc.stdio cimport *
6 |
7 | cdef extern from "SDL.h" nogil:
8 | # SDL_stdinc.h provides the real ones based on platform.
9 | ctypedef char Sint8
10 | ctypedef unsigned char Uint8
11 | ctypedef signed short Sint16
12 | ctypedef unsigned short Uint16
13 | ctypedef signed long Sint32
14 | ctypedef unsigned long Uint32
15 | ctypedef unsigned long long Uint64
16 | ctypedef signed long long Sint64
17 | ctypedef int SDL_bool
18 |
19 | const char *SDL_GetError()
20 |
21 | # https://wiki.libsdl.org/SDL_InitSubSystem
22 | # https://wiki.libsdl.org/SDL_QuitSubSystem
23 | # https://wiki.libsdl.org/SDL_WasInit
24 | int SDL_InitSubSystem(Uint32 flags)
25 | void SDL_QuitSubSystem(Uint32 flags)
26 | Uint32 SDL_WasInit(Uint32 flags)
27 |
28 | cdef int _SDL_INIT_TIMER "SDL_INIT_TIMER"
29 | cdef int _SDL_INIT_AUDIO "SDL_INIT_AUDIO"
30 | cdef int _SDL_INIT_VIDEO "SDL_INIT_VIDEO"
31 | cdef int _SDL_INIT_JOYSTICK "SDL_INIT_JOYSTICK"
32 | cdef int _SDL_INIT_HAPTIC "SDL_INIT_HAPTIC"
33 | cdef int _SDL_INIT_GAMECONTROLLER "SDL_INIT_GAMECONTROLLER"
34 | cdef int _SDL_INIT_EVENTS "SDL_INIT_EVENTS"
35 | cdef int _SDL_INIT_SENSOR "SDL_INIT_SENSOR"
36 | cdef int _SDL_INIT_NOPARACHUTE "SDL_INIT_NOPARACHUTE"
37 | cdef int _SDL_INIT_EVERYTHING "SDL_INIT_EVERYTHING"
38 |
--------------------------------------------------------------------------------
/src_c/doc/pixelcopy_doc.h:
--------------------------------------------------------------------------------
1 | /* Auto generated file: with makeref.py . Docs go in docs/reST/ref/ . */
2 | #define DOC_PYGAMEPIXELCOPY "pygame module for general pixel array copying"
3 | #define DOC_PYGAMEPIXELCOPYSURFACETOARRAY "surface_to_array(array, surface, kind='P', opaque=255, clear=0) -> None\ncopy surface pixels to an array object"
4 | #define DOC_PYGAMEPIXELCOPYARRAYTOSURFACE "array_to_surface(, ) -> None\ncopy an array object to a surface"
5 | #define DOC_PYGAMEPIXELCOPYMAPARRAY "map_array(, , ) -> None\ncopy an array to another array, using surface format"
6 | #define DOC_PYGAMEPIXELCOPYMAKESURFACE "pygame.pixelcopy.make_surface(array) -> Surface\nCopy an array to a new surface"
7 |
8 |
9 | /* Docs in a comment... slightly easier to read. */
10 |
11 | /*
12 |
13 | pygame.pixelcopy
14 | pygame module for general pixel array copying
15 |
16 | pygame.pixelcopy.surface_to_array
17 | surface_to_array(array, surface, kind='P', opaque=255, clear=0) -> None
18 | copy surface pixels to an array object
19 |
20 | pygame.pixelcopy.array_to_surface
21 | array_to_surface(, ) -> None
22 | copy an array object to a surface
23 |
24 | pygame.pixelcopy.map_array
25 | map_array(, , ) -> None
26 | copy an array to another array, using surface format
27 |
28 | pygame.pixelcopy.make_surface
29 | pygame.pixelcopy.make_surface(array) -> Surface
30 | Copy an array to a new surface
31 |
32 | */
--------------------------------------------------------------------------------
/docs/reST/c_api/freetype.rst:
--------------------------------------------------------------------------------
1 | .. include:: ../common.txt
2 |
3 | .. highlight:: c
4 |
5 | ************************************
6 | API exported by pygame._freetype
7 | ************************************
8 |
9 | src_c/_freetype.c
10 | =================
11 |
12 | This extension module defines Python type :py:class:`pygame.freetype.Font`.
13 |
14 | Header file: src_c/include/pygame_freetype.h
15 |
16 |
17 | .. c:type:: pgFontObject
18 |
19 | The :py:class:`pygame.freetype.Font` instance C struct.
20 |
21 | .. c:type:: pgFont_Type
22 |
23 | The :py:class:`pygame.freetype.Font` Python type.
24 |
25 | .. c:function:: PyObject* pgFont_New(const char *filename, long font_index)
26 |
27 | Open the font file with path *filename* and return a new
28 | new :py:class:`pygame.freetype.Font` instance for that font.
29 | Set *font_index* to ``0`` unless the file contains multiple, indexed, fonts.
30 | On error raise a Python exception and return ``NULL``.
31 |
32 | .. c:function:: int pgFont_Check(PyObject *x)
33 |
34 | Return true if *x* is a :py:class:`pygame.freetype.Font` instance.
35 | Will return false for a subclass of :py:class:`Font`.
36 | This is a macro. No check is made that *x* is not ``NULL``.
37 |
38 | .. c:function:: int pgFont_IS_ALIVE(PyObject *o)
39 |
40 | Return true if :py:class:`pygame.freetype.Font` object ``o``
41 | is an open font file.
42 | This is a macro. No check is made that *o* is not ``NULL``
43 | or not a :py:class:`Font` instance.
44 |
--------------------------------------------------------------------------------
/test/version_test.py:
--------------------------------------------------------------------------------
1 | import os
2 | import unittest
3 |
4 |
5 | pg_header = os.path.join('src_c', 'include', '_pygame.h')
6 |
7 |
8 | class VersionTest(unittest.TestCase):
9 | @unittest.skipIf(not os.path.isfile(pg_header),
10 | "Skipping because we cannot find _pygame.h")
11 | def test_pg_version_consistency(self):
12 | from pygame import version
13 | pgh_major = -1
14 | pgh_minor = -1
15 | pgh_patch = -1
16 | import re
17 | major_exp_search = re.compile(r'define\s+PG_MAJOR_VERSION\s+([0-9]+)').search
18 | minor_exp_search = re.compile(r'define\s+PG_MINOR_VERSION\s+([0-9]+)').search
19 | patch_exp_search = re.compile(r'define\s+PG_PATCH_VERSION\s+([0-9]+)').search
20 | with open(pg_header) as f:
21 | for line in f:
22 | if pgh_major == -1:
23 | m = major_exp_search(line)
24 | if m: pgh_major = int(m.group(1))
25 | if pgh_minor == -1:
26 | m = minor_exp_search(line)
27 | if m: pgh_minor = int(m.group(1))
28 | if pgh_patch == -1:
29 | m = patch_exp_search(line)
30 | if m: pgh_patch = int(m.group(1))
31 | self.assertEqual(pgh_major, version.vernum[0])
32 | self.assertEqual(pgh_minor, version.vernum[1])
33 | self.assertEqual(pgh_patch, version.vernum[2])
34 |
35 | if __name__ == '__main__':
36 | unittest.main()
37 |
--------------------------------------------------------------------------------
/src_c/include/pygame_mask.h:
--------------------------------------------------------------------------------
1 | /*
2 | pygame - Python Game Library
3 |
4 | This library is free software; you can redistribute it and/or
5 | modify it under the terms of the GNU Library General Public
6 | License as published by the Free Software Foundation; either
7 | version 2 of the License, or (at your option) any later version.
8 |
9 | This library is distributed in the hope that it will be useful,
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | Library General Public License for more details.
13 |
14 | You should have received a copy of the GNU Library General Public
15 | License along with this library; if not, write to the Free
16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 | */
18 |
19 | #ifndef PGMASK_H
20 | #define PGMASK_H
21 |
22 | #include
23 | #include "bitmask.h"
24 |
25 | typedef struct {
26 | PyObject_HEAD
27 | bitmask_t *mask;
28 | void *bufdata;
29 | } pgMaskObject;
30 |
31 | #define pgMask_AsBitmap(x) (((pgMaskObject*)x)->mask)
32 |
33 | #ifndef PYGAMEAPI_MASK_INTERNAL
34 |
35 | #include "pgimport.h"
36 |
37 | PYGAMEAPI_DEFINE_SLOTS(mask);
38 |
39 | #define pgMask_Type (*(PyTypeObject*) \
40 | PYGAMEAPI_GET_SLOT(mask, 0))
41 | #define pgMask_Check(x) ((x)->ob_type == &pgMask_Type)
42 |
43 | #define import_pygame_mask() _IMPORT_PYGAME_MODULE(mask)
44 |
45 | #endif /* ~PYGAMEAPI_MASK_INTERNAL */
46 |
47 | #endif /* ~PGMASK_H */
48 |
--------------------------------------------------------------------------------
/examples/sound.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | """extremely simple demonstration playing a soundfile
4 | and waiting for it to finish. you'll need the pygame.mixer
5 | module for this to work. Note how in this simple example we
6 | don't even bother loading all of the pygame package. Just
7 | pick the mixer for sound and time for the delay function.
8 |
9 | Optional command line argument:
10 | the name of an audio file.
11 |
12 |
13 | """
14 |
15 | import os.path, sys
16 | import pygame.mixer, pygame.time
17 |
18 | mixer = pygame.mixer
19 | time = pygame.time
20 |
21 | main_dir = os.path.split(os.path.abspath(__file__))[0]
22 |
23 |
24 | def main(file_path=None):
25 | """Play an audio file as a buffered sound sample
26 |
27 | Option argument:
28 | the name of an audio file (default data/secosmic_low.wav
29 |
30 | """
31 | if file_path is None:
32 | file_path = os.path.join(main_dir, "data", "secosmic_lo.wav")
33 |
34 | # choose a desired audio format
35 | mixer.init(11025) # raises exception on fail
36 |
37 | # load the sound
38 | sound = mixer.Sound(file_path)
39 |
40 | # start playing
41 | print("Playing Sound...")
42 | channel = sound.play()
43 |
44 | # poll until finished
45 | while channel.get_busy(): # still playing
46 | print(" ...still going...")
47 | time.wait(1000)
48 | print("...Finished")
49 |
50 |
51 | if __name__ == "__main__":
52 | if len(sys.argv) > 1:
53 | main(sys.argv[1])
54 | else:
55 | main()
56 |
--------------------------------------------------------------------------------
/src_c/include/pygame_freetype.h:
--------------------------------------------------------------------------------
1 | /*
2 | pygame - Python Game Library
3 | Copyright (C) 2009 Vicent Marti
4 |
5 | This library is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU Library General Public
7 | License as published by the Free Software Foundation; either
8 | version 2 of the License, or (at your option) any later version.
9 |
10 | This library is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | Library General Public License for more details.
14 |
15 | You should have received a copy of the GNU Library General Public
16 | License along with this library; if not, write to the Free
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 |
19 | */
20 | #ifndef PYGAME_FREETYPE_H_
21 | #define PYGAME_FREETYPE_H_
22 |
23 | #include "pgplatform.h"
24 | #include "pgimport.h"
25 | #include "pgcompat.h"
26 |
27 | #ifndef PYGAME_FREETYPE_INTERNAL
28 |
29 | PYGAMEAPI_DEFINE_SLOTS(_freetype);
30 |
31 | #define pgFont_Type (*(PyTypeObject*) \
32 | PYGAMEAPI_GET_SLOT(_freetype, 0))
33 |
34 | #define pgFont_Check(x) ((x)->ob_type == &pgFont_Type)
35 |
36 | #define pgFont_New (*(PyObject*(*)(const char*, long)) \
37 | PYGAMEAPI_GET_SLOT(_freetype, 1))
38 |
39 | #define import_pygame_freetype() _IMPORT_PYGAME_MODULE(_freetype)
40 |
41 | #endif /* PYGAME_FREETYPE_INTERNAL */
42 |
43 | #endif /* PYGAME_FREETYPE_H_ */
44 |
--------------------------------------------------------------------------------
/examples/headless_no_windows_needed.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | """How to use pygame with no windowing system, like on headless servers.
3 |
4 | Thumbnail generation with scaling is an example of what you can do with pygame.
5 | NOTE: the pygame scale function uses mmx/sse if available, and can be run
6 | in multiple threads.
7 |
8 | """
9 | useage = """-scale inputimage outputimage new_width new_height
10 | eg. -scale in.png out.png 50 50
11 |
12 | """
13 |
14 | import os, sys
15 |
16 | # set SDL to use the dummy NULL video driver,
17 | # so it doesn't need a windowing system.
18 | os.environ["SDL_VIDEODRIVER"] = "dummy"
19 |
20 |
21 | import pygame.transform
22 |
23 | # Some platforms need to init the display for some parts of pygame.
24 | import pygame.display
25 |
26 | pygame.display.init()
27 | screen = pygame.display.set_mode((1, 1))
28 |
29 |
30 | def scaleit(fin, fout, w, h):
31 | i = pygame.image.load(fin)
32 |
33 | if hasattr(pygame.transform, "smoothscale"):
34 | scaled_image = pygame.transform.smoothscale(i, (w, h))
35 | else:
36 | scaled_image = pygame.transform.scale(i, (w, h))
37 | pygame.image.save(scaled_image, fout)
38 |
39 |
40 | def main(fin, fout, w, h):
41 | """smoothscale image file named fin as fout with new size (w,h)"""
42 | scaleit(fin, fout, w, h)
43 |
44 |
45 | if __name__ == "__main__":
46 | if "-scale" in sys.argv:
47 | fin, fout, w, h = sys.argv[2:]
48 | w, h = map(int, [w, h])
49 | main(fin, fout, w, h)
50 | else:
51 | print(useage)
52 |
--------------------------------------------------------------------------------
/src_c/scale_mmx.c:
--------------------------------------------------------------------------------
1 | /*
2 | pygame - Python Game Library
3 | Copyright (C) 2000-2001 Pete Shinners
4 | Copyright (C) 2007 Rene Dudfield, Richard Goedeken
5 |
6 | This library is free software; you can redistribute it and/or
7 | modify it under the terms of the GNU Library General Public
8 | License as published by the Free Software Foundation; either
9 | version 2 of the License, or (at your option) any later version.
10 |
11 | This library is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | Library General Public License for more details.
15 |
16 | You should have received a copy of the GNU Library General Public
17 | License along with this library; if not, write to the Free
18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 |
20 | Pete Shinners
21 | pete@shinners.org
22 | */
23 |
24 | /* Pentium MMX/SSE smoothscale routines
25 | * These are only compiled with GCC.
26 | */
27 | #if defined(__GNUC__)
28 | /* Choose between the 32 bit and 64 bit versions.
29 | * Including source code like this may be frowned upon by some,
30 | * but the alternative is ungainly conditionally compiled code.
31 | */
32 | # if defined(__x86_64__)
33 | # include "scale_mmx64.c"
34 | # elif defined(__i386__)
35 | # include "scale_mmx32.c"
36 | # endif
37 | #endif
38 |
39 | #if defined(_M_X64) && !defined(_NO_MMX_FOR_X86_64)
40 | #include "scale_mmx64_msvc.c"
41 | #endif
42 |
--------------------------------------------------------------------------------
/docs/reST/c_api/event.rst:
--------------------------------------------------------------------------------
1 | .. include:: ../common.txt
2 |
3 | .. highlight:: c
4 |
5 | ********************************
6 | API exported by pygame.event
7 | ********************************
8 |
9 | src_c/event.c
10 | =============
11 |
12 | The extsion module :py:mod:`pygame.event`.
13 |
14 | Header file: src_c/include/pygame.h
15 |
16 |
17 | .. c:type:: pgEventObject
18 |
19 | The :py:class:`pygame.event.EventType` object C struct.
20 |
21 | .. c:member:: int type
22 |
23 | The event type code.
24 |
25 | .. c:var:: pgEvent_Type
26 |
27 | The pygame event object type :py:class:`pygame.event.EventType`.
28 |
29 | .. c:function:: int pgEvent_Check(PyObject *x)
30 |
31 | Return true if *x* is a pygame event instance
32 |
33 | Will return false if *x* is a subclass of event.
34 | This is a macro. No check is made that *x* is not ``NULL``.
35 |
36 | .. c:function:: PyObject* pgEvent_New(SDL_Event *event)
37 |
38 | Return a new pygame event instance for the SDL *event*.
39 | If *event* is ``NULL`` then create an empty event object.
40 | On failure raise a Python exception and return ``NULL``.
41 |
42 | .. c:function:: PyObject* pgEvent_New2(int type, PyObject *dict)
43 |
44 | Return a new pygame event instance of SDL *type* and with
45 | attribute dictionary *dict*.
46 | If `dict` is ``NULL`` an empty attribute dictionary is created.
47 | On failure raise a Python exception and return ``NULL``.
48 |
49 | .. c:function:: int pgEvent_FillUserEvent(pgEventObject *e, SDL_Event *event)
50 |
51 | Fill SDL event *event* with information from pygame user event instance *e*.
52 | Return ``0`` on success, ``-1`` otherwise.
53 |
--------------------------------------------------------------------------------
/examples/overlay.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import sys
4 | import pygame
5 | from pygame.compat import xrange_
6 |
7 | SR = (800, 600)
8 | ovl = None
9 |
10 | ########################################################################
11 | # Simple video player
12 | def vPlayer(fName):
13 | global ovl
14 | f = open(fName, "rb")
15 | fmt = f.readline().strip()
16 | res = f.readline().strip()
17 | unused_col = f.readline().strip()
18 | if fmt != "P5":
19 | print("Unknown format( len %d ). Exiting..." % len(fmt))
20 | return
21 |
22 | w, h = [int(x) for x in res.split(" ")]
23 | h = (h * 2) / 3
24 | # Read into strings
25 | y = f.read(w * h)
26 | u = []
27 | v = []
28 | for _ in xrange_(0, h / 2):
29 | u.append(f.read(w / 2))
30 | v.append(f.read(w / 2))
31 |
32 | u = "".join(u)
33 | v = "".join(v)
34 |
35 | # Open overlay with the resolution specified
36 | ovl = pygame.Overlay(pygame.YV12_OVERLAY, (w, h))
37 | ovl.set_location(0, 0, w, h)
38 |
39 | ovl.display((y, u, v))
40 | while 1:
41 | pygame.time.wait(10)
42 | for ev in pygame.event.get():
43 | if ev.type in (pygame.KEYDOWN, pygame.QUIT):
44 | return
45 |
46 |
47 | def main(fname):
48 | """play video file fname"""
49 | pygame.init()
50 | try:
51 | pygame.display.set_mode(SR)
52 | vPlayer(fname)
53 | finally:
54 | pygame.quit()
55 |
56 |
57 | # Test all modules
58 | if __name__ == "__main__":
59 | if len(sys.argv) != 2:
60 | print("Usage: play_file ")
61 | else:
62 | main(sys.argv[1])
63 |
--------------------------------------------------------------------------------
/src_c/doc/sndarray_doc.h:
--------------------------------------------------------------------------------
1 | /* Auto generated file: with makeref.py . Docs go in docs/reST/ref/ . */
2 | #define DOC_PYGAMESNDARRAY "pygame module for accessing sound sample data"
3 | #define DOC_PYGAMESNDARRAYARRAY "array(Sound) -> array\ncopy Sound samples into an array"
4 | #define DOC_PYGAMESNDARRAYSAMPLES "samples(Sound) -> array\nreference Sound samples into an array"
5 | #define DOC_PYGAMESNDARRAYMAKESOUND "make_sound(array) -> Sound\nconvert an array into a Sound object"
6 | #define DOC_PYGAMESNDARRAYUSEARRAYTYPE "use_arraytype (arraytype) -> None\nSets the array system to be used for sound arrays"
7 | #define DOC_PYGAMESNDARRAYGETARRAYTYPE "get_arraytype () -> str\nGets the currently active array type."
8 | #define DOC_PYGAMESNDARRAYGETARRAYTYPES "get_arraytypes () -> tuple\nGets the array system types currently supported."
9 |
10 |
11 | /* Docs in a comment... slightly easier to read. */
12 |
13 | /*
14 |
15 | pygame.sndarray
16 | pygame module for accessing sound sample data
17 |
18 | pygame.sndarray.array
19 | array(Sound) -> array
20 | copy Sound samples into an array
21 |
22 | pygame.sndarray.samples
23 | samples(Sound) -> array
24 | reference Sound samples into an array
25 |
26 | pygame.sndarray.make_sound
27 | make_sound(array) -> Sound
28 | convert an array into a Sound object
29 |
30 | pygame.sndarray.use_arraytype
31 | use_arraytype (arraytype) -> None
32 | Sets the array system to be used for sound arrays
33 |
34 | pygame.sndarray.get_arraytype
35 | get_arraytype () -> str
36 | Gets the currently active array type.
37 |
38 | pygame.sndarray.get_arraytypes
39 | get_arraytypes () -> tuple
40 | Gets the array system types currently supported.
41 |
42 | */
--------------------------------------------------------------------------------
/src_c/include/pygame_font.h:
--------------------------------------------------------------------------------
1 | /*
2 | pygame - Python Game Library
3 | Copyright (C) 2000-2001 Pete Shinners
4 |
5 | This library is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU Library General Public
7 | License as published by the Free Software Foundation; either
8 | version 2 of the License, or (at your option) any later version.
9 |
10 | This library is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | Library General Public License for more details.
14 |
15 | You should have received a copy of the GNU Library General Public
16 | License along with this library; if not, write to the Free
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 |
19 | Pete Shinners
20 | pete@shinners.org
21 | */
22 |
23 | #include
24 | #include "pgplatform.h"
25 |
26 | struct TTF_Font;
27 |
28 | typedef struct {
29 | PyObject_HEAD
30 | TTF_Font* font;
31 | PyObject* weakreflist;
32 | } PyFontObject;
33 | #define PyFont_AsFont(x) (((PyFontObject*)x)->font)
34 |
35 | #ifndef PYGAMEAPI_FONT_INTERNAL
36 |
37 | #include "pgimport.h"
38 |
39 | PYGAMEAPI_DEFINE_SLOTS(font);
40 |
41 | #define PyFont_Type (*(PyTypeObject*) \
42 | PYGAMEAPI_GET_SLOT(font, 0))
43 | #define PyFont_Check(x) ((x)->ob_type == &PyFont_Type)
44 |
45 | #define PyFont_New (*(PyObject*(*)(TTF_Font*))\
46 | PYGAMEAPI_GET_SLOT(font, 1))
47 |
48 | /*slot 2 taken by FONT_INIT_CHECK*/
49 |
50 | #define import_pygame_font() _IMPORT_PYGAME_MODULE(font)
51 |
52 | #endif
53 |
54 |
--------------------------------------------------------------------------------
/docs/reST/c_api/color.rst:
--------------------------------------------------------------------------------
1 | .. include:: ../common.txt
2 |
3 | .. highlight:: c
4 |
5 | ********************************************
6 | Class Color API exported by pygame.color
7 | ********************************************
8 |
9 | src_c/color.c
10 | =============
11 |
12 | This extension module defines the Python type :py:class:`pygame.Color`.
13 |
14 | Header file: src_c/include/pygame.h
15 |
16 |
17 | .. c:var:: PyTypeObject *pgColor_Type
18 |
19 | The Pygame color object type :py:class:`pygame.Color`.
20 |
21 | .. c:function:: int pgColor_Check(PyObject *obj)
22 |
23 | Return true if *obj* is an instance of type pgColor_Type,
24 | but not a pgColor_Type subclass instance.
25 | This macro does not check if *obj* is not ``NULL`` or indeed a Python type.
26 |
27 | .. c:function:: PyObject* pgColor_New(Uint8 rgba[])
28 |
29 | Return a new :py:class:`pygame.Color` instance for the the four element array *rgba*.
30 | On failure, raise a Python exception and return ``NULL``.
31 |
32 | .. c:function:: PyObject* pgColor_NewLength(Uint8 rgba[], Uint8 length)
33 |
34 | Return a :py:class:`new pygame.Color` instance having *length* elements,
35 | with element values taken from the first *length* elements of array *rgba*.
36 | Argument *length* must be between ``1`` and ``4`` inclusive.
37 | On failure, raise a Python exception and return ``NULL``.
38 |
39 | .. c:function int pg_RGBAFromColorObj(PyObject *color, Uint8 rgba[])
40 |
41 | Set the four element array *rgba* to the color represented by object *color*.
42 | Return ``1`` on success, ``0`` otherwise.
43 | No Python exceptions are raised.
44 | This in an extension of :c:func:`pg_RGBAFromObj` optimized for pgColor_Type
45 | instances.
46 |
--------------------------------------------------------------------------------
/src_c/doc/image_doc.h:
--------------------------------------------------------------------------------
1 | /* Auto generated file: with makeref.py . Docs go in docs/reST/ref/ . */
2 | #define DOC_PYGAMEIMAGE "pygame module for image transfer"
3 | #define DOC_PYGAMEIMAGELOAD "load(filename) -> Surface\nload(fileobj, namehint="") -> Surface\nload new image from a file"
4 | #define DOC_PYGAMEIMAGESAVE "save(Surface, filename) -> None\nsave an image to disk"
5 | #define DOC_PYGAMEIMAGEGETEXTENDED "get_extended() -> bool\ntest if extended image formats can be loaded"
6 | #define DOC_PYGAMEIMAGETOSTRING "tostring(Surface, format, flipped=False) -> string\ntransfer image to string buffer"
7 | #define DOC_PYGAMEIMAGEFROMSTRING "fromstring(string, size, format, flipped=False) -> Surface\ncreate new Surface from a string buffer"
8 | #define DOC_PYGAMEIMAGEFROMBUFFER "frombuffer(string, size, format) -> Surface\ncreate a new Surface that shares data inside a string buffer"
9 |
10 |
11 | /* Docs in a comment... slightly easier to read. */
12 |
13 | /*
14 |
15 | pygame.image
16 | pygame module for image transfer
17 |
18 | pygame.image.load
19 | load(filename) -> Surface
20 | load(fileobj, namehint="") -> Surface
21 | load new image from a file
22 |
23 | pygame.image.save
24 | save(Surface, filename) -> None
25 | save an image to disk
26 |
27 | pygame.image.get_extended
28 | get_extended() -> bool
29 | test if extended image formats can be loaded
30 |
31 | pygame.image.tostring
32 | tostring(Surface, format, flipped=False) -> string
33 | transfer image to string buffer
34 |
35 | pygame.image.fromstring
36 | fromstring(string, size, format, flipped=False) -> Surface
37 | create new Surface from a string buffer
38 |
39 | pygame.image.frombuffer
40 | frombuffer(string, size, format) -> Surface
41 | create a new Surface that shares data inside a string buffer
42 |
43 | */
--------------------------------------------------------------------------------
/docs/logos.html:
--------------------------------------------------------------------------------
1 | Pygame Logos
4 |
5 |
6 |
7 |
8 |
pygame logos
9 |
10 |
11 | These logos are available for use in your own game projects.
12 | Please put them up wherever you see fit. The logo was created
13 | by TheCorruptor on July 29, 2001.
14 |
15 |
16 |
17 |
18 |
19 | There is a higher resolution layered photoshop image
20 | available here.
21 | (1.3 MB)