Coder Social home page Coder Social logo

renpy / pygame_sdl2 Goto Github PK

View Code? Open in Web Editor NEW
318.0 29.0 62.0 1.41 MB

Reimplementation of portions of the pygame API using SDL2.

License: GNU Lesser General Public License v2.1

Python 64.56% Shell 0.25% C 18.29% PHP 0.27% CSS 0.06% Batchfile 0.01% Cython 16.57%

pygame_sdl2's Introduction

Pygame_sdl2

Pygame_sdl2 is a reimplementation of the Pygame API using SDL2 and related libraries. While in the past it was meant to support multiple applications, it only saw adoption as technology underlying Ren'Py, and is currently being supported for that purpose.

The original pygame now runs on SDL2, and should be used for most applications.

License

New code written for pygame_sdl2 is licensed under the Zlib license. Some code - including compiled code - is taken wholesale from Pygame, and is licensed under the LGPL2. Please check each module to determine its licensing status.

See the COPYING.ZLIB and COPYING.LGPL21 files for details - you'll need to comply with both to distribute software containing pygame_sdl2.

Current Status

Pygame_sdl2 builds and runs on Windows, Mac OS X, and Linux, with a useful subset of the pygame API working. While not as well documented, it has also run on Android, iOS, and inside the Chrome browser. The following modules have at least some implementation:

  • pygame_sdl2.color
  • pygame_sdl2.display
  • pygame_sdl2.draw
  • pygame_sdl2.event
  • pygame_sdl2.font
  • pygame_sdl2.gfxdraw
  • pygame_sdl2.image
  • pygame_sdl2.joystick
  • pygame_sdl2.key
  • pygame_sdl2.locals
  • pygame_sdl2.mixer (including mixer.music)
  • pygame_sdl2.mouse
  • pygame_sdl2.scrap
  • pygame_sdl2.sprite
  • pygame_sdl2.surface
  • pygame_sdl2.sysfont
  • pygame_sdl2.time
  • pygame_sdl2.transform
  • pygame_sdl2.version

Experimental new modules include:

  • pygame_sdl2.render
  • pygame_sdl2.controller

Current omissions include:

  • Modules not listed above.
  • APIs that expose pygame data as buffers or arrays.
  • Support for non-32-bit surface depths. Our thinking is that 8, 16, and (to some extent) 24-bit surfaces are legacy formats, and not worth duplicating code four or more times to support. This only applies to in-memory formats - when an image of lesser color depth is loaded, it is converted to a 32-bit image.
  • Support for palette functions, which only apply to 8-bit surfaces.

Building

Building pygame_sdl2 requires the ability to build python modules; the ability to link against the SDL2, SDL2_gfx, SDL2_image, SDL2_mixer, and SDL2_ttf libraries; and the ability to compile cython code.

To build pygame_sdl2, install the build dependencies:

Linux

Ubuntu:

sudo apt-get install build-essential python-dev libsdl2-dev \
    libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev \
    libjpeg-dev libpng12-dev virtualenvwrapper

Fedora:

sudo dnf install SDL2 SDL2-devel SDL2_gfx-devel SDL2_image-devel \
    SDL2_sound-devel SDL2_ttf-devel SDL2_mixer-devel SDL2_net-devel \
    libjpeg-turbo-devel libjpeg-turbo python-devel

Darwin

macOS (with brew):

brew install sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_ttf
sudo pip install virtualenvwrapper

Open a new shell to ensure virtualenvwrapper is running, then run:

mkvirtualenv pygame_sdl2
pip install cython

Change into a clone of this project, and run the following command to modify the virtualenv so pygame_sdl2 header files can be installed in it:

python fix_virtualenv.py

Finally, build and install pygame_sdl2 by running:

python setup.py install

Windows

These instructions are likely out of date.

To build on windows, change into the pygame_sdl2 checkout, clone renpy/pygame_sdl2_windeps using a command like:

git clone https://github.com/renpy/pygame_sdl2_windeps

and then build and install using:

python setup.py install

This assumes you have installed a version of Visual Studio that is appropriate for the version of Python you are using.

If you also want to install the python headers in a standard fashion to make an IDE's autocomplete work then you should try creating a python wheel. First grab the wheel package:

pip install wheel

Then use this command to build your wheel:

python setup.py sdist bdist_wheel

Finally, you will need to install your wheel from the dist sub-directory with pip. What it is called will depend on your version of python, the current version of the library and your platform. For example, here is a command to install a python 3.6 wheel, on 32bit windows:

pip install dist\pygame_sdl2-2.1.0-cp36-cp36m-win32.whl

You will also need to delete any currently installed version of pygame_sdl2 from your Lib/site-packages directory to re-install this way.

C Headers

A small number of C headers can be installed using the command:

python setup.py install_headers

These headers export functions statically, and must be initialized by including "pygame_sdl2/pygame_sdl2.h" and calling the (C-language) import_pygame_sdl2() function from each C file in which a function will be called. The following functions are exposed:

  • PySurface_AsSurface - Returns the SDL_Surface underlying a pygame_sdl2.Surface.
  • PySurface_New - Wraps an SDL_Surface in a new pygame_sdl2.Surface.

Pygame incompatibility

Pygame_sdl2 is designed as a complete replacement for pygame.

If you try to use both the pygame_sdl2 and pygame libraries in the same program you may encounter errors; such as library import failures in frozen programs.

Credits

Pygame_sdl2 was written by:

It includes some code from Pygame, and is inspired by the hundreds of contributors to the Pygame, Python, and SDL2 projects.

pygame_sdl2's People

Contributors

andykl avatar arve0 avatar beuc avatar eshikafe avatar hsandt avatar jsfehler avatar kne avatar mal avatar mic92 avatar molasseslover avatar myremylar avatar neurone avatar nickvdp avatar nneonneo avatar orochimarufan avatar pkdawson avatar renpy-bot avatar renpytom avatar tey avatar uyjulian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pygame_sdl2's Issues

Mix_ChannelFinished(channel_callback) causes segfaults

Looks like this line in pygame.mixer.init() leads to segfaults

Mix_ChannelFinished(channel_callback)

If I disable it everything works fine.

According to SDL_Mixer docs, SDL_Mixer functions shouldn't be used in a callback. On the other hand, I've tried modifying the function to just print a line to the console and it still segfaults as a callback.

Segfault playing a WAV file

The following code produces a "Python Quit Unexpectedly" error in OSX and a Segmentation fault (core dumped) error in Linux. I'm not sure where to find the segmentation fault report for Linux. The program didn't generate any logs after the crash. I've included the OSX crash log below.

The sound file 'shoot1.wav' can be found here.

The issue appears to have been introduced after commit 0a1d0dc since I had no problems with sound in that version.

Push down any keys to play sound. Playing a single sound causes the program to crash.

# Comment out these two lines to go back to old Pygame version
import pygame_sdl2
pygame_sdl2.import_as_pygame()

import pygame
from pygame import KEYDOWN, QUIT
import sys


def main():

    pygame.init()
    tilesize = 35
    size_x = 24
    size_y = 18
    screen_size = (tilesize * size_x, tilesize * size_y)
    screen = pygame.display.set_mode(screen_size, 0, 32)
    clock = pygame.time.Clock()

    stop_flag = False

    test_sound = pygame.mixer.Sound('shoot1.wav')


    while not stop_flag:

        for event in pygame.event.get():
            if event.type == QUIT:
                sys.exit()
            if event.type == KEYDOWN:
                print "AAAA"
                test_sound.play()

        screen.fill((200,200,200))


        pygame.display.flip()
        clock.tick(60)


if __name__ == '__main__':
    main()

Error thing from OSX:

Process:               python2.7 [2819]
Path:                  /Users/USER/Documents/*/python
Identifier:            python2.7
Version:               0
Code Type:             X86-64 (Native)
Parent Process:        pycharm [465]
Responsible:           python2.7 [2819]
User ID:               501

Date/Time:             2016-01-24 15:07:10.125 -0700
OS Version:            Mac OS X 10.11.2 (15C50)
Report Version:        11
Anonymous UUID:        9FC81B41-A28A-0029-D354-E82315E8AFCF

Sleep/Wake UUID:       8E4114AB-14CC-4553-86E3-9468C9CE8CCF

Time Awake Since Boot: 2600 seconds
Time Since Wake:       2500 seconds

System Integrity Protection: enabled

Crashed Thread:        9  com.apple.audio.IOThread.client

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000038
Exception Note:        EXC_CORPSE_NOTIFY

VM Regions Near 0x38:
--> 
    __TEXT                 0000000100a53000-0000000100a55000 [    8K] r-x/rwx SM=COW  /Users/USER/Documents/*/*.7

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff95fa8206 __semwait_signal + 10
1   libsystem_c.dylib               0x00007fff83b9cd17 nanosleep + 199
2   libSDL2-2.0.0.dylib             0x0000000100fd287f SDL_Delay_REAL + 84
3   pygame_time.so                  0x00000001012711ed __pyx_pw_11pygame_sdl2_11pygame_time_7wait + 61 (pygame_sdl2.pygame_time.c:1269)
4   pygame_time.so                  0x0000000101270484 __Pyx_PyObject_CallOneArg + 132 (pygame_sdl2.pygame_time.c:3443)
5   pygame_time.so                  0x000000010127148e __pyx_pw_11pygame_sdl2_11pygame_time_9delay + 78 (pygame_sdl2.pygame_time.c:1365)
6   pygame_time.so                  0x0000000101270484 __Pyx_PyObject_CallOneArg + 132 (pygame_sdl2.pygame_time.c:3443)
7   pygame_time.so                  0x0000000101273036 __pyx_pw_11pygame_sdl2_11pygame_time_5Clock_3tick + 2630 (pygame_sdl2.pygame_time.c:2116)
8   org.python.python               0x0000000100a63eb0 PyObject_Call + 99
9   org.python.python               0x0000000100ae3a27 PyEval_EvalFrameEx + 26436
10  org.python.python               0x0000000100ae772d fast_function + 264
11  org.python.python               0x0000000100ae3af3 PyEval_EvalFrameEx + 26640
12  org.python.python               0x0000000100add0f1 PyEval_EvalCodeEx + 1583
13  org.python.python               0x0000000100adcabc PyEval_EvalCode + 54
14  org.python.python               0x0000000100b00ea1 run_mod + 53
15  org.python.python               0x0000000100b00f44 PyRun_FileExFlags + 133
16  org.python.python               0x0000000100b00a93 PyRun_SimpleFileExFlags + 698
17  org.python.python               0x0000000100b12445 Py_Main + 3137
18  libdyld.dylib                   0x00007fff8d8355ad start + 1

Thread 1:
0   libsystem_kernel.dylib          0x00007fff95fa86de __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8e72f729 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff8e72d365 start_wqthread + 13

Thread 2:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x00007fff95fa8ff6 kevent_qos + 10
1   libdispatch.dylib               0x00007fff83bf3099 _dispatch_mgr_invoke + 216
2   libdispatch.dylib               0x00007fff83bf2d01 _dispatch_mgr_thread + 52

Thread 3:
0   libsystem_kernel.dylib          0x00007fff95fa86de __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8e72f729 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff8e72d365 start_wqthread + 13

Thread 4:
0   libsystem_kernel.dylib          0x00007fff95fa86de __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8e72f729 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff8e72d365 start_wqthread + 13

Thread 5:
0   libsystem_kernel.dylib          0x00007fff95fa86de __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8e72f729 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff8e72d365 start_wqthread + 13

Thread 6:
0   libsystem_kernel.dylib          0x00007fff95fa86de __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8e72f729 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff8e72d365 start_wqthread + 13

Thread 7:: SDLTimer
0   libsystem_kernel.dylib          0x00007fff95fa7eb2 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff8e730150 _pthread_cond_wait + 767
2   libSDL2-2.0.0.dylib             0x0000000100fce4de SDL_CondWaitTimeout_REAL + 141
3   libSDL2-2.0.0.dylib             0x0000000100fce13c SDL_SemWaitTimeout_REAL + 75
4   libSDL2-2.0.0.dylib             0x0000000100f94260 SDL_TimerThread + 79
5   libSDL2-2.0.0.dylib             0x0000000100f93eae SDL_RunThread + 60
6   libSDL2-2.0.0.dylib             0x0000000100fcdebe RunThread + 9
7   libsystem_pthread.dylib         0x00007fff8e72fc13 _pthread_body + 131
8   libsystem_pthread.dylib         0x00007fff8e72fb90 _pthread_start + 168
9   libsystem_pthread.dylib         0x00007fff8e72d375 thread_start + 13

Thread 8:
0   libsystem_kernel.dylib          0x00007fff95fa23da semaphore_timedwait_trap + 10
1   libdispatch.dylib               0x00007fff83bf8b9b _dispatch_semaphore_wait_slow + 149
2   libdispatch.dylib               0x00007fff83bf2c4f _dispatch_worker_thread + 148
3   libsystem_pthread.dylib         0x00007fff8e72fc13 _pthread_body + 131
4   libsystem_pthread.dylib         0x00007fff8e72fb90 _pthread_start + 168
5   libsystem_pthread.dylib         0x00007fff8e72d375 thread_start + 13

Thread 9 Crashed:: com.apple.audio.IOThread.client
0   libsystem_pthread.dylib         0x00007fff8e72d434 pthread_mutex_lock + 0
1   org.python.python               0x0000000100b105fd PyThread_release_lock + 22
2   mixer.so                        0x000000010153099c __pyx_f_11pygame_sdl2_5mixer_channel_callback + 4732 (pygame_sdl2.mixer.c:1812)
3   libSDL2_mixer-2.0.0.dylib       0x000000010154ffbe _Mix_channel_done_playing + 24
4   libSDL2_mixer-2.0.0.dylib       0x000000010154f473 mix_channels + 648
5   libSDL2-2.0.0.dylib             0x0000000100fcee64 outputCallback + 199
6   com.apple.audio.units.Components    0x000000010659cd73 AUInputElement::PullInput(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) + 181
7   com.apple.audio.units.Components    0x000000010659ca02 AUInputFormatConverter2::InputProc(OpaqueAudioConverter*, unsigned int*, AudioBufferList*, AudioStreamPacketDescription**, void*) + 196
8   com.apple.audio.toolbox.AudioToolbox    0x00007fff9057d182 AudioConverterChain::CallInputProc(unsigned int) + 358
9   com.apple.audio.toolbox.AudioToolbox    0x00007fff9057cf18 AudioConverterChain::FillBufferFromInputProc(unsigned int*, CABufferList*) + 130
10  com.apple.audio.toolbox.AudioToolbox    0x00007fff9057ce87 BufferedAudioConverter::GetInputBytes(unsigned int, unsigned int&, CABufferList const*&) + 179
11  com.apple.audio.toolbox.AudioToolbox    0x00007fff9057cd48 CBRConverter::RenderOutput(CABufferList*, unsigned int, unsigned int&, AudioStreamPacketDescription*) + 104
12  com.apple.audio.toolbox.AudioToolbox    0x00007fff905750ab BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 281
13  com.apple.audio.toolbox.AudioToolbox    0x00007fff9057ce5c BufferedAudioConverter::GetInputBytes(unsigned int, unsigned int&, CABufferList const*&) + 136
14  com.apple.audio.toolbox.AudioToolbox    0x00007fff905cb274 Resampler2Wrapper::RenderOutput(CABufferList*, unsigned int, unsigned int&) + 182
15  com.apple.audio.toolbox.AudioToolbox    0x00007fff905750ab BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 281
16  com.apple.audio.toolbox.AudioToolbox    0x00007fff90575291 AudioConverterChain::RenderOutput(CABufferList*, unsigned int, unsigned int&, AudioStreamPacketDescription*) + 99
17  com.apple.audio.toolbox.AudioToolbox    0x00007fff905750ab BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 281
18  com.apple.audio.toolbox.AudioToolbox    0x00007fff90574dbf AudioConverterFillComplexBuffer + 287
19  com.apple.audio.units.Components    0x000000010659c3b5 AUInputFormatConverter2::PullAndConvertInput(AudioTimeStamp const&, unsigned int&, AudioBufferList&, AudioStreamPacketDescription*, bool&) + 107
20  com.apple.audio.units.Components    0x000000010659bc7a AUConverterBase::RenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) + 212
21  com.apple.audio.units.Components    0x000000010659a034 AUBase::DoRenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, AUOutputElement*, unsigned int, AudioBufferList&) + 154
22  com.apple.audio.units.Components    0x0000000106598a1e AUBase::DoRender(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int, AudioBufferList&) + 504
23  com.apple.audio.units.Components    0x000000010659f5de AUHAL::AUIOProc(unsigned int, AudioTimeStamp const*, AudioBufferList const*, AudioTimeStamp const*, AudioBufferList*, AudioTimeStamp const*, void*) + 1778
24  com.apple.audio.CoreAudio       0x00007fff83d7eea3 HALC_ProxyIOContext::IOWorkLoop() + 2535
25  com.apple.audio.CoreAudio       0x00007fff83d7e3ee HALC_ProxyIOContext::IOThreadEntry(void*) + 88
26  com.apple.audio.CoreAudio       0x00007fff83d7e2c3 HALB_IOThread::Entry(void*) + 75
27  libsystem_pthread.dylib         0x00007fff8e72fc13 _pthread_body + 131
28  libsystem_pthread.dylib         0x00007fff8e72fb90 _pthread_start + 168
29  libsystem_pthread.dylib         0x00007fff8e72d375 thread_start + 13

Thread 10:: com.apple.NSEventThread
0   libsystem_kernel.dylib          0x00007fff95fa2386 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff95fa17c7 mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff8625e624 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff8625daec __CFRunLoopRun + 1356
4   com.apple.CoreFoundation        0x00007fff8625d338 CFRunLoopRunSpecific + 296
5   com.apple.AppKit                0x00007fff84508065 _NSEventThread + 149
6   libsystem_pthread.dylib         0x00007fff8e72fc13 _pthread_body + 131
7   libsystem_pthread.dylib         0x00007fff8e72fb90 _pthread_start + 168
8   libsystem_pthread.dylib         0x00007fff8e72d375 thread_start + 13

Thread 9 crashed with X86 Thread State (64-bit):
  rax: 0x00007fff737ab420  rbx: 0x0000000000000000  rcx: 0x00000000000fc080  rdx: 0x0000000000062a50
  rdi: 0x0000000000000038  rsi: 0x0000000100bd2a00  rbp: 0x0000700000428400  rsp: 0x00007000004283e8
   r8: 0x0000000000000002   r9: 0x00007fe2e045cde0  r10: 0x0000000079b86567  r11: 0x00007fe2e0400000
  r12: 0x0000000100b8a338  r13: 0x0000000100b64e68  r14: 0x0000000000000038  r15: 0x0000000100a92a6f
  rip: 0x00007fff8e72d434  rfl: 0x0000000000010202  cr2: 0x0000000000000038

Logical CPU:     0
Error Code:      0x00000004
Trap Number:     14


Binary Images:
       0x100a53000 -        0x100a54fff +python (0) <6BAE76DA-21F3-361A-9D58-50D270E8B694> /Users/USER/Documents/*/python
       0x100a59000 -        0x100b4fff7 +org.python.python (2.7.11, [c] 2001-2015 Python Software Foundation. - 2.7.11) <D98307D3-1D56-3484-B9A8-3D24FC849364> /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/Python
       0x100f30000 -        0x100f33ff7 +error.so (0) <D6AF713B-DD82-347E-945C-A55B00E8AA36> /Users/USER/Documents/*/error.so
       0x100f39000 -        0x100fe2fff +libSDL2-2.0.0.dylib (0) <2F1FFFE7-4554-3F00-8DFA-3DDB90B5CFFC> /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib
       0x101017000 -        0x101019fff  com.apple.ForceFeedback (1.0.6 - 1.0.6) <FE9C703D-5886-3F07-AAA2-49D695F625D2> /System/Library/Frameworks/ForceFeedback.framework/Versions/A/ForceFeedback
       0x10104f000 -        0x101089ff7 +surface.so (0) <13B6824F-168A-3D6E-8344-BB9E7F1F9340> /Users/USER/Documents/*/surface.so
       0x101096000 -        0x1010bcff7 +color.so (0) <081183D5-D6FE-368D-A415-DD9E384B2459> /Users/USER/Documents/*/color.so
       0x1010f8000 -        0x1010fbfff +binascii.so (0) <B1E5D3DE-8D0D-34F1-AF46-E919C8287FE1> /Users/USER/Documents/*/binascii.so
       0x10113e000 -        0x101141fff +_struct.so (0) <C59B80C0-A517-3859-82B5-97A920B7B06C> /Users/USER/Documents/*/_struct.so
       0x101147000 -        0x10115ffff +rect.so (0) <F409797C-137F-3ADF-9353-7B44F3D0AC70> /Users/USER/Documents/*/rect.so
       0x10116a000 -        0x10116dfff +_collections.so (0) <7008439C-6500-3A96-B0A0-CC9FC6F1442C> /Users/USER/Documents/*/_collections.so
       0x101172000 -        0x101175fff +operator.so (0) <61859B66-8F74-3D0C-B077-DFFFF4E87173> /Users/USER/Documents/*/operator.so
       0x10117b000 -        0x101180fff +itertools.so (0) <8A084173-5061-3EFF-8670-E2558DAE3A0A> /Users/USER/Documents/*/itertools.so
       0x101189000 -        0x10118afff +_heapq.so (0) <797F412F-245E-3662-B274-054C39E4AFBD> /Users/USER/Documents/*/_heapq.so
       0x10118e000 -        0x10119dfff +locals.so (0) <3C59B8E4-EB0B-37F8-A355-ED2DB14ECB06> /Users/USER/Documents/*/locals.so
       0x1011b7000 -        0x1011d0fff +display.so (0) <8D6B176F-9955-3569-A64E-DFEC91D6C372> /Users/USER/Documents/*/display.so
       0x1011e4000 -        0x101200fff +event.so (0) <DECF3827-A3F1-3475-B9AA-DCAEF9A4D50C> /Users/USER/Documents/*/event.so
       0x101213000 -        0x101215ff7 +time.so (0) <7157EF24-2AEF-3926-8D81-CA87C4593587> /Users/USER/Documents/*/time.so
       0x10125b000 -        0x10125dfff +_locale.so (0) <107BD336-C75C-38DF-B1E6-62A46B0D1ED2> /Users/USER/Documents/*/_locale.so
       0x101260000 -        0x101264ff7 +key.so (0) <BF604F92-C0B2-37F9-8F15-99FEC8D07306> /Users/USER/Documents/*/key.so
       0x10126d000 -        0x101275fff +pygame_time.so (0) <86338B75-94CE-3B89-8EC9-98AD15DD1261> /Users/USER/Documents/*/pygame_time.so
       0x10127f000 -        0x101282ff7 +math.so (0) <00F67A27-1E1C-364E-9109-F368C5116343> /Users/USER/Documents/*/math.so
       0x101287000 -        0x10128cff7 +controller.so (0) <CDEDF076-F740-3FED-99A4-69E3AF1E887B> /Users/USER/Documents/*/controller.so
       0x101295000 -        0x10129dfff +rwobject.so (0) <B97726DC-C689-34A5-8BF6-5E928EBBBA53> /Users/USER/Documents/*/rwobject.so
       0x1012a3000 -        0x1012b6fff +draw.so (0) <0C00FB0C-0809-323D-9757-0782D6E91B6F> /Users/USER/Documents/*/draw.so
       0x1012be000 -        0x1012e3ff7 +gfxdraw.so (0) <CC73B8A3-522B-3E4F-8AD3-4BBEEF3B5723> /Users/USER/Documents/*/gfxdraw.so
       0x1012f2000 -        0x1012fafff +font.so (0) <3E10C20F-E562-338D-B464-8E7E24EF4634> /Users/USER/Documents/*/font.so
       0x101303000 -        0x101307fff +libSDL2_ttf-2.0.0.dylib (0) <EB36A954-13FF-3350-9FA7-4EC2BF1665CF> /usr/local/opt/sdl2_ttf/lib/libSDL2_ttf-2.0.0.dylib
       0x10130b000 -        0x10137aff7 +libfreetype.6.dylib (0) <EDC231A4-C0F7-3893-9CB0-4FE805264A67> /usr/local/opt/freetype/lib/libfreetype.6.dylib
       0x101391000 -        0x1013b4fff +libpng16.16.dylib (0) <F51DA6EF-EFC9-316A-9DF5-F22AF489012F> /usr/local/lib/libpng16.16.dylib
       0x1013fd000 -        0x101404ff7 +image.so (0) <3FF56864-17EE-3E4B-88C5-FE893991FD9F> /Users/USER/Documents/*/image.so
       0x10140d000 -        0x10141afff +libSDL2_image-2.0.0.dylib (0) <08FDFE47-6267-3A25-BD4E-44F0BC68E48D> /usr/local/opt/sdl2_image/lib/libSDL2_image-2.0.0.dylib
       0x10142f000 -        0x10145bff7 +libjpeg.8.dylib (0) <5DDAB24B-59F9-3E62-9905-39876B715B6A> /usr/local/opt/jpeg/lib/libjpeg.8.dylib
       0x101462000 -        0x1014bbff7 +libtiff.dylib (0) <D6706BD6-3B31-31A1-AB2B-A871196214B3> /usr/local/lib/libtiff.dylib
       0x1014c9000 -        0x10150dff7 +libwebp.dylib (0) <4529EA17-FCF6-3051-B212-00F66892BD36> /usr/local/lib/libwebp.dylib
       0x101519000 -        0x10151eff7 +joystick.so (0) <03415A4B-1A63-32E0-86C7-26E0396C0BDB> /Users/USER/Documents/*/joystick.so
       0x101524000 -        0x101538ff7 +mixer.so (0) <0B076F7B-6AA0-35FB-BA30-FDC58597AD2B> /Users/USER/Documents/*/mixer.so
       0x101548000 -        0x10155fff7 +libSDL2_mixer-2.0.0.dylib (0) <660B51BC-725C-344B-99E2-2CBB703E76E9> /usr/local/opt/sdl2_mixer/lib/libSDL2_mixer-2.0.0.dylib
       0x101592000 -        0x101596fff +mixer_music.so (0) <437246BC-2C0B-3BEC-A65E-3AD9E90A0C2E> /Users/USER/Documents/*/mixer_music.so
       0x10159d000 -        0x10159ffff +mouse.so (0) <22C30FCB-6DC2-375F-AB15-C07A0D831DA2> /Users/USER/Documents/*/mouse.so
       0x1015a5000 -        0x1015b0ff7 +transform.so (0) <52CF0713-F495-31FD-9685-EA5DBB6D4EB4> /Users/USER/Documents/*/transform.so
       0x1015b9000 -        0x1015bcfff +scrap.so (0) <CE0A000F-70D3-3D80-89FC-22FDDAE3FBF8> /Users/USER/Documents/*/scrap.so
       0x104b50000 -        0x104b50fe7 +cl_kernels (???) <031C7048-4D7C-41AD-9867-97B4F983ADFE> cl_kernels
       0x106527000 -        0x10652cfff +libvorbisfile.dylib (0) <0E942679-E6DE-3154-B31F-E8CF37C0F2CB> /usr/local/lib/libvorbisfile.dylib
       0x106530000 -        0x106554fff +libvorbis.0.dylib (0) <137712A7-9E52-3B1C-AC00-F470A20C4C29> /usr/local/Cellar/libvorbis/1.3.5/lib/libvorbis.0.dylib
       0x106559000 -        0x10655cfff +libogg.0.dylib (0) <A3D6D749-3CD7-3E5B-A3A2-CC6E41A50E84> /usr/local/lib/libogg.0.dylib
       0x106560000 -        0x106564fff  com.apple.audio.AppleHDAHALPlugIn (272.51.3 - 272.51.3) <7E9DC6D6-CB61-3EA1-94AD-5C6F20D3EDBF> /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn
       0x106594000 -        0x1066c4ffb  com.apple.audio.units.Components (1.13 - 1.13) <31056DB7-E93B-342A-8717-3313B2CE86A1> /System/Library/Components/CoreAudio.component/Contents/MacOS/CoreAudio
       0x106764000 -        0x106caaff7  com.apple.driver.AppleIntelBDWGraphicsGLDriver (10.12.13 - 10.1.2) <335EDCFD-9D34-3480-8B27-282E65CB9AAB> /System/Library/Extensions/AppleIntelBDWGraphicsGLDriver.bundle/Contents/MacOS/AppleIntelBDWGraphicsGLDriver
       0x108089000 -        0x1080f4ff7  com.apple.driver.AppleIntelBDWGraphicsMTLDriver (10.12.13 - 10.1.2) <1BE8B60E-CAA7-36CE-A645-F85AE94ED1B3> /System/Library/Extensions/AppleIntelBDWGraphicsMTLDriver.bundle/Contents/MacOS/AppleIntelBDWGraphicsMTLDriver
    0x7fff62711000 -     0x7fff62747fa7  dyld (360.18) <1A7F8274-FC32-3B86-9979-66B8F2B7B5E2> /usr/lib/dyld
    0x7fff837c0000 -     0x7fff83867fff  com.apple.LanguageModeling (1.0 - 1) <E1E4091D-6CAB-36E0-A206-AAADE69791DC> /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling
    0x7fff838a8000 -     0x7fff838bffff  libmarisa.dylib (4) <E4919B03-D9BD-3AF8-B436-C415C98E3F0A> /usr/lib/libmarisa.dylib
    0x7fff838c0000 -     0x7fff83acbfff  libFosl_dynamic.dylib (16.24) <363B7CEE-B662-32F3-9D7B-245E64927C35> /usr/lib/libFosl_dynamic.dylib
    0x7fff83ad0000 -     0x7fff83ad0ff7  libunc.dylib (29) <1D0F8265-F026-3CBD-93D3-F8DF14FFCE68> /usr/lib/system/libunc.dylib
    0x7fff83aea000 -     0x7fff83b06ff7  libsystem_malloc.dylib (67) <9EECAB18-F025-34C4-8E32-7EFFA6720EFC> /usr/lib/system/libsystem_malloc.dylib
    0x7fff83b07000 -     0x7fff83b09fff  libCVMSPluginSupport.dylib (12.0.40.6) <8E97A929-0E60-3F6D-ACF7-67F700BE2530> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib
    0x7fff83b0a000 -     0x7fff83b18ff7  libbz2.1.0.dylib (38) <28E54258-C0FE-38D4-AB76-1734CACCB344> /usr/lib/libbz2.1.0.dylib
    0x7fff83b19000 -     0x7fff83b1cff7  com.apple.help (1.3.3 - 46) <62056D9B-A87C-3E4D-B4E2-7E1CDB74CE68> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help
    0x7fff83b1d000 -     0x7fff83baafff  libsystem_c.dylib (1082.20.4) <EAB38A6C-8671-3B13-B500-90EC1B912063> /usr/lib/system/libsystem_c.dylib
    0x7fff83be2000 -     0x7fff83beafe7  libsystem_platform.dylib (74.10.3) <D3A27E10-7F08-3603-ACC8-7A92B2C04BAB> /usr/lib/system/libsystem_platform.dylib
    0x7fff83beb000 -     0x7fff83c18fff  libdispatch.dylib (501.20.1) <324C9189-2AF3-3356-847F-6F4CE1C6E901> /usr/lib/system/libdispatch.dylib
    0x7fff83c19000 -     0x7fff83d09fff  libJP2.dylib (1442) <50DD1F07-6517-372B-8244-2AD19702385C> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib
    0x7fff83d27000 -     0x7fff83d32ff7  libChineseTokenizer.dylib (16) <998637AB-DC37-3A7C-A85C-F10FD98CAAD7> /usr/lib/libChineseTokenizer.dylib
    0x7fff83d33000 -     0x7fff83d3bff7  libcldcpuengine.dylib (2.6.4.1) <A065D1E1-ECCE-3AD0-9B90-7515318FA4CF> /System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/libcldcpuengine.dylib
    0x7fff83d56000 -     0x7fff83da7ff7  com.apple.audio.CoreAudio (4.3.0 - 4.3.0) <BB7C0F61-E39B-382C-AF03-1650C054BFE1> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
    0x7fff83eb1000 -     0x7fff83eb4ffb  libScreenReader.dylib (425.102) <BDC46586-4925-38F2-85D3-BD23DB6E6D43> /usr/lib/libScreenReader.dylib
    0x7fff83eb5000 -     0x7fff83ed9fff  libJPEG.dylib (1442) <9616E8A5-60BA-3C70-8F37-A33055D227C8> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
    0x7fff83ee7000 -     0x7fff83ee7fff  com.apple.Cocoa (6.11 - 22) <0A634D46-B468-3CBC-B2A0-16C381C11BF2> /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
    0x7fff83ee8000 -     0x7fff842e4fff  libLAPACK.dylib (1159) <7618C270-D895-345C-B08B-102286A05A55> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
    0x7fff84388000 -     0x7fff8438dfff  com.apple.ImageCapture (9.0 - 9.0) <33F7822F-1124-3D73-AF66-515EA32A4A47> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture
    0x7fff8438e000 -     0x7fff84399fff  libkxld.dylib (3248.20.55) <3B8A19A8-7B41-3322-BDEC-9A2461E76423> /usr/lib/system/libkxld.dylib
    0x7fff8439a000 -     0x7fff843acfff  libsasl2.2.dylib (209) <02BF4226-23E9-34EC-A727-CF0E205395F8> /usr/lib/libsasl2.2.dylib
    0x7fff843ae000 -     0x7fff843aefff  com.apple.Carbon (154 - 157) <34263101-328D-3FE4-B212-14BD3CFF6965> /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
    0x7fff843b2000 -     0x7fff843b3fff  com.apple.TrustEvaluationAgent (2.0 - 25) <0239494E-FEFE-39BC-9FC7-E251BA5128F1> /System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/TrustEvaluationAgent
    0x7fff843b4000 -     0x7fff843befff  com.apple.NetAuth (6.0 - 6.0) <19E44307-6F9F-3DEC-8C1A-4685BC252A35> /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth
    0x7fff843bf000 -     0x7fff84fe2ff7  com.apple.AppKit (6.9 - 1404.34) <FB9C0E8D-8E07-35CD-91D8-7A3869B8EB03> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
    0x7fff84fe3000 -     0x7fff85087fff  com.apple.Bluetooth (4.4.3 - 4.4.3f4) <FF130A90-AB16-33C8-B0D6-1FFE38BFFD30> /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth
    0x7fff85088000 -     0x7fff85295ff7  com.apple.CoreImage (11.2.0 - 366.2.7) <344F1067-5F52-3626-8F6C-2B678DEB80A1> /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage
    0x7fff852b9000 -     0x7fff852bffff  com.apple.IOAccelerator (203.14 - 203.14) <D632883D-7A42-38C4-BF31-BD597BD31FAA> /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator
    0x7fff852c0000 -     0x7fff85370fe7  libvMisc.dylib (563.4) <621D84AA-C752-34EE-8B16-CF0C2DE722FA> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
    0x7fff856f1000 -     0x7fff8571cffb  libarchive.2.dylib (33.20.2) <6C370A21-63FD-3A68-B4B3-5333F24B770B> /usr/lib/libarchive.2.dylib
    0x7fff8571d000 -     0x7fff85734fff  libsystem_asl.dylib (322) <3C2D3ACD-0DD1-337A-8247-44A910D67A65> /usr/lib/system/libsystem_asl.dylib
    0x7fff85f38000 -     0x7fff85f38fff  com.apple.CoreServices (728.6 - 728.6) <1FC9300C-6D3D-330C-829C-C8F094BC38C6> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
    0x7fff85f39000 -     0x7fff86048fe7  libvDSP.dylib (563.4) <A95572FF-D40C-32A8-9F36-5B1FD297A0EC> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
    0x7fff861ee000 -     0x7fff86664fff  com.apple.CoreFoundation (6.9 - 1256.14) <068D1BA9-3859-34C7-986A-97EDF739C5C8> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff8667b000 -     0x7fff86826ffb  GLEngine (12.0.40.6) <CFA83347-B042-35C1-B92C-D636294EF831> /System/Library/Frameworks/OpenGL.framework/Versions/A/Resources/GLEngine.bundle/GLEngine
    0x7fff86853000 -     0x7fff86856ff7  libCoreFSCache.dylib (119.5) <C7008E64-0AFB-3446-929E-BC3F76DEF049> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib
    0x7fff86859000 -     0x7fff8685dfff  libGIF.dylib (1442) <39FA0286-1616-3474-8215-7CD07109C9E5> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
    0x7fff87112000 -     0x7fff88363fff  com.apple.CoreGraphics (1.600.0 - 948) <5C9D3150-55FF-3C12-806C-D74837E12B1A> /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
    0x7fff88501000 -     0x7fff88590ff7  libCoreStorage.dylib (517.20.1) <EC540EAA-089C-36D9-BBAA-0684EDE098AB> /usr/lib/libCoreStorage.dylib
    0x7fff887d2000 -     0x7fff88b26ff7  com.apple.Foundation (6.9 - 1256.1) <66106CC9-9D97-3846-88D8-4BF6BB508296> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
    0x7fff88e10000 -     0x7fff88e14fff  com.apple.CommonPanels (1.2.6 - 96) <61E9D84F-435A-3C7B-A065-047B80775777> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels
    0x7fff88e82000 -     0x7fff88eb0ff7  com.apple.CoreServicesInternal (248.2 - 248.2) <7D0D2C65-C4C4-3FBD-89A7-12302EA444AA> /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal
    0x7fff88eb5000 -     0x7fff8901cfff  libBLAS.dylib (1159) <8C24B8BC-E7D9-386D-97C8-929728AFE10B> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
    0x7fff890d5000 -     0x7fff8913fff7  com.apple.framework.CoreWLAN (11.0 - 1101.20) <6A535459-6A8A-3D60-986B-EE7ED833A9C3> /System/Library/Frameworks/CoreWLAN.framework/Versions/A/CoreWLAN
    0x7fff89142000 -     0x7fff8928cfc7  com.apple.coreui (2.1 - 365.2) <727C55D3-503A-3EC4-8A23-C984E320F65F> /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI
    0x7fff8928d000 -     0x7fff8928fff7  libRadiance.dylib (1442) <1E42E394-4CD2-3E10-8591-9BB234829AC6> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
    0x7fff89290000 -     0x7fff89298fff  com.apple.frameworks.CoreDaemon (1.3 - 1.3) <D44F75E7-C679-3C21-AD76-8FA8A2B898F1> /System/Library/PrivateFrameworks/CoreDaemon.framework/Versions/B/CoreDaemon
    0x7fff892fd000 -     0x7fff89326fff  libxpc.dylib (756.20.4) <61AB4610-9304-354C-9E9B-D57198AE9866> /usr/lib/system/libxpc.dylib
    0x7fff893a4000 -     0x7fff893eaff7  libauto.dylib (186) <999E610F-41FC-32A3-ADCA-5EC049B65DFB> /usr/lib/libauto.dylib
    0x7fff896b7000 -     0x7fff896f8ff7  libGLU.dylib (12.0.40.6) <D51C3497-7EC6-37F4-9E8D-B9BFED23974D> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
    0x7fff896f9000 -     0x7fff89722fff  libsystem_info.dylib (477.20.1) <6513635B-4ADE-3B45-BF63-ED7AC565B0C9> /usr/lib/system/libsystem_info.dylib
    0x7fff89772000 -     0x7fff89776fff  libcache.dylib (75) <6B245C0A-F3EA-383B-A542-5B0D0456A41B> /usr/lib/system/libcache.dylib
    0x7fff899fc000 -     0x7fff89a12ff7  libsystem_coretls.dylib (83.20.8) <30AF7134-6CA7-3582-B9D3-507D6ED19A88> /usr/lib/system/libsystem_coretls.dylib
    0x7fff89a16000 -     0x7fff89a4efff  com.apple.RemoteViewServices (2.0 - 99) <596153FD-3CB9-3FED-9D63-1B73B01AC6DB> /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices
    0x7fff89a4f000 -     0x7fff89a57fff  libsystem_networkextension.dylib (385.20.6) <DC8A102A-BF02-31A4-8914-65C34DF6B592> /usr/lib/system/libsystem_networkextension.dylib
    0x7fff89a58000 -     0x7fff89a5afff  com.apple.loginsupport (1.0 - 1) <9B2F5F9B-ED38-313F-B798-D2B667BCD6B5> /System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport
    0x7fff89c71000 -     0x7fff89c72ffb  libremovefile.dylib (41) <B8D1A5FC-CFD5-3AAB-8A10-14DDC129710A> /usr/lib/system/libremovefile.dylib
    0x7fff89d36000 -     0x7fff89dcbfff  com.apple.ink.framework (10.9 - 214) <6B573126-A6E9-357F-B36A-AA5BDC0BEAF8> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink
    0x7fff89dd2000 -     0x7fff89dd5fff  com.apple.IOSurface (108.0.1 - 108.0.1) <7B05B27A-5CC4-30D4-8A10-ED444A2807A2> /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface
    0x7fff89dde000 -     0x7fff89decfff  com.apple.opengl (12.0.40 - 12.0.40) <4D469B19-F5B3-3A2F-93D5-31E3AA3B14BF> /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
    0x7fff8a25a000 -     0x7fff8a269ffb  com.apple.LangAnalysis (1.7.0 - 1.7.0) <0D1BCC13-76B9-3C19-85AA-D8DD8299F007> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
    0x7fff8a26a000 -     0x7fff8a26aff7  libkeymgr.dylib (28) <09397E01-6066-3179-A50C-2CE666FDA929> /usr/lib/system/libkeymgr.dylib
    0x7fff8ab8d000 -     0x7fff8ab90ff7  libsystem_sandbox.dylib (460.20.9) <1C891336-1B25-365D-B43E-96D5B3BE66B0> /usr/lib/system/libsystem_sandbox.dylib
    0x7fff8ab91000 -     0x7fff8ac05ff3  com.apple.securityfoundation (6.0 - 55126) <943934A2-EC53-330F-BEB9-8A718A18F9FC> /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation
    0x7fff8affb000 -     0x7fff8affbfff  libenergytrace.dylib (10) <A4AE7CBD-CF0A-3A74-8098-B642CE496611> /usr/lib/libenergytrace.dylib
    0x7fff8b2ed000 -     0x7fff8b383fff  com.apple.ColorSync (4.9.0 - 4.9.0) <8BB8DF19-C24F-39F8-8B90-AD186D74587C> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync
    0x7fff8b3ac000 -     0x7fff8b3dbffb  libsystem_m.dylib (3105) <26655445-CA97-321E-B221-801CB378D1AA> /usr/lib/system/libsystem_m.dylib
    0x7fff8b3dc000 -     0x7fff8b3e7fff  com.apple.CrashReporterSupport (10.11 - 717) <474544AD-1199-3ECC-90E5-071847BA72C6> /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport
    0x7fff8bb4c000 -     0x7fff8bdf2ff7  com.apple.CoreData (120 - 641.3) <A29A5491-6169-372B-828F-84EE0CFD4BC4> /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
    0x7fff8be86000 -     0x7fff8bf5cff7  com.apple.DiskImagesFramework (10.11.2 - 417.1) <4A510EE1-893E-38A8-AD09-5ACC9F2BE86F> /System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages
    0x7fff8bf5d000 -     0x7fff8bf65fff  com.apple.CoreServices.FSEvents (1223.10.1 - 1223.10.1) <7F5B7A23-BC1D-3FA9-A9B8-D534F1E1979A> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents
    0x7fff8bf66000 -     0x7fff8bf66fff  com.apple.ApplicationServices (48 - 48) <DD9C4070-C0FC-3984-BCED-72E6E99838FC> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
    0x7fff8bf8e000 -     0x7fff8bf9fff7  libsystem_trace.dylib (201.10.3) <F0B7622B-FB6B-31E1-8703-38F57BE84553> /usr/lib/system/libsystem_trace.dylib
    0x7fff8bfa9000 -     0x7fff8bfebff7  com.apple.Metal (55.2.8 - 55.2.8) <4EC5571C-8A19-3774-BDA0-CB15DB04D06A> /System/Library/Frameworks/Metal.framework/Versions/A/Metal
    0x7fff8bfec000 -     0x7fff8bfedfff  liblangid.dylib (122) <9CC4F0D1-5C51-3B69-BC8F-EE3A51FD0822> /usr/lib/liblangid.dylib
    0x7fff8bfee000 -     0x7fff8bfeffff  libsystem_secinit.dylib (20) <FD6ECF2C-1489-32CA-981B-9045B5EB1FAA> /usr/lib/system/libsystem_secinit.dylib
    0x7fff8bff0000 -     0x7fff8c03cfff  com.apple.print.framework.PrintCore (11.2 - 472.2) <449D8AB5-7891-32D0-9DC5-C90FE10DC0BF> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
    0x7fff8c047000 -     0x7fff8c052fff  libGPUSupportMercury.dylib (12.0.40.6) <1BE26EAA-370D-3DFF-A4DF-E4A6427B8962> /System/Library/PrivateFrameworks/GPUSupport.framework/Versions/A/Libraries/libGPUSupportMercury.dylib
    0x7fff8c0ab000 -     0x7fff8c390ff3  com.apple.CoreServices.CarbonCore (1136 - 1136) <FFBDE3BF-0BB3-37A2-8A44-6E25284CC348> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
    0x7fff8c3c9000 -     0x7fff8c3e5ff3  libresolv.9.dylib (60) <A650B5C8-1950-36A0-86D1-0B2465318BFA> /usr/lib/libresolv.9.dylib
    0x7fff8c3e6000 -     0x7fff8c66cff7  com.apple.CFNetwork (760.2.6 - 760.2.6) <DDE325B9-7F6F-3933-8F86-8D031E400DD5> /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
    0x7fff8c76c000 -     0x7fff8c76cfff  com.apple.audio.units.AudioUnit (1.13 - 1.13) <D2E8EA94-3828-3D7C-87E2-97E4CD00269D> /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
    0x7fff8c85d000 -     0x7fff8c8b0ff7  libc++.1.dylib (120.1) <8FC3D139-8055-3498-9AC5-6467CB7F4D14> /usr/lib/libc++.1.dylib
    0x7fff8c8b1000 -     0x7fff8c9d6ff7  com.apple.LaunchServices (728.6 - 728.6) <8658230B-5894-3244-BDBA-A6C9DD347219> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
    0x7fff8c9d7000 -     0x7fff8cc6dfff  libmecabra.dylib (696.4) <0A1574F0-3222-3856-A1C6-D8BE20DC4C48> /usr/lib/libmecabra.dylib
    0x7fff8d3c9000 -     0x7fff8d3d5ff7  com.apple.SpeechRecognitionCore (2.2.7 - 2.2.7) <8B6C0DB6-8744-3AEB-BD00-9FA6967E7125> /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore
    0x7fff8d3dc000 -     0x7fff8d3edfff  libcmph.dylib (6) <BA4BF2C6-7F4E-33B8-9DD7-619C9EB83ECF> /usr/lib/libcmph.dylib
    0x7fff8d579000 -     0x7fff8d581ffb  libsystem_dnssd.dylib (625.20.4) <945B5FB1-DA91-3D45-A961-A8FAD53C1E7E> /usr/lib/system/libsystem_dnssd.dylib
    0x7fff8d582000 -     0x7fff8d58afff  libcopyfile.dylib (127) <F5133269-0B22-388C-A57C-079667B6291E> /usr/lib/system/libcopyfile.dylib
    0x7fff8d5a1000 -     0x7fff8d5a3fff  com.apple.EFILogin (2.0 - 2) <38150198-DD7F-3C73-BCAA-C74BB376393A> /System/Library/PrivateFrameworks/EFILogin.framework/Versions/A/EFILogin
    0x7fff8d5a4000 -     0x7fff8d5e9ff3  libFontRegistry.dylib (155.1) <593CC743-3785-3CC5-A229-D3846C51E054> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib
    0x7fff8d75c000 -     0x7fff8d78fff7  com.apple.MediaKit (16 - 809) <BF8032FE-6645-37F6-A622-BC7EEE3EAABF> /System/Library/PrivateFrameworks/MediaKit.framework/Versions/A/MediaKit
    0x7fff8d790000 -     0x7fff8d791ffb  libSystem.B.dylib (1226.10.1) <54388DF0-3813-33E4-BE8D-7743A81ACF4D> /usr/lib/libSystem.B.dylib
    0x7fff8d832000 -     0x7fff8d835ffb  libdyld.dylib (360.18) <5F3777A7-F07E-3D5F-BFA3-A920FF4170ED> /usr/lib/system/libdyld.dylib
    0x7fff8d83e000 -     0x7fff8d85aff7  libextension.dylib (78) <589FA312-F17C-3A8D-986F-FD995D0065D5> /usr/lib/libextension.dylib
    0x7fff8dc57000 -     0x7fff8dc60ff3  libsystem_notify.dylib (150.20.3) <243FADE1-255A-3B78-8033-F336CD64B817> /usr/lib/system/libsystem_notify.dylib
    0x7fff8dcbb000 -     0x7fff8dcc7ff7  com.apple.OpenDirectory (10.11 - 194) <5409AC27-3B83-3F35-8EB5-51228B4604AE> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory
    0x7fff8dcc8000 -     0x7fff8dd25fff  com.apple.CoreServices.OSServices (728.6 - 728.6) <E86385ED-70AA-3371-8E58-8FFDEF81C854> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
    0x7fff8dd2f000 -     0x7fff8dd30ff3  com.apple.print.framework.Print (10.0 - 266) <BF573614-5666-3D16-9D45-4690911F030A> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print
    0x7fff8dd7c000 -     0x7fff8dda1ff7  libPng.dylib (1442) <C13F5341-C342-3733-AF4C-434F2D8FF0A8> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
    0x7fff8dda2000 -     0x7fff8ddfefff  libTIFF.dylib (1442) <28DF1565-3705-3ED3-B570-C9CB12376D2E> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
    0x7fff8ddff000 -     0x7fff8de39fff  com.apple.QD (3.12 - 302) <3F36A108-C557-353A-A3F7-80DDCB82BB37> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
    0x7fff8de3a000 -     0x7fff8de59ff7  com.apple.framework.Apple80211 (11.0 - 1110.33) <EC583C00-9073-39C3-B613-96D5BA0FDD32> /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Apple80211
    0x7fff8de5a000 -     0x7fff8de8eff7  com.apple.CoreVideo (1.8 - 191.2) <88D903C8-E608-320E-8ACD-11E5B3003C18> /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
    0x7fff8df9c000 -     0x7fff8e025ff7  com.apple.PerformanceAnalysis (1.0 - 1) <67DE6CD9-AA72-3664-9594-0161D03D4919> /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis
    0x7fff8e72c000 -     0x7fff8e735ff7  libsystem_pthread.dylib (138.10.4) <327CECD0-B881-3153-8FCC-4FD4818B7F16> /usr/lib/system/libsystem_pthread.dylib
    0x7fff8e8f1000 -     0x7fff8eab7fff  com.apple.ImageIO.framework (3.3.0 - 1442) <1AE1EF1A-EA91-3453-A6F4-C11BD91B8D66> /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
    0x7fff8eac5000 -     0x7fff8eacaff7  libmacho.dylib (875.1) <CB745E1F-4885-3F96-B38B-2093DF488FD5> /usr/lib/system/libmacho.dylib
    0x7fff8ead5000 -     0x7fff8eca3ffb  com.apple.QuartzCore (1.11 - 410.14) <DB552FA2-D2D1-37F9-A1D4-C77D7EA82ECD> /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
    0x7fff8ed40000 -     0x7fff8ed6eff7  com.apple.DictionaryServices (1.2 - 250) <D9AB6B92-CAF5-3EC2-8D07-639B42DA1CB9> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
    0x7fff90478000 -     0x7fff90484ff7  com.apple.speech.synthesis.framework (5.4.12 - 5.4.12) <E507D438-517D-32AE-8609-02ACD2F0D692> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
    0x7fff9053f000 -     0x7fff906e5ff7  com.apple.audio.toolbox.AudioToolbox (1.13 - 1.13) <F912765D-88ED-3324-B512-3778A8CE878B> /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
    0x7fff906e6000 -     0x7fff906efff7  com.apple.CommonAuth (4.0 - 2.0) <B2CEE6B5-9464-35F2-9339-9F52001C8A27> /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth
    0x7fff906ff000 -     0x7fff9078cdd7  com.apple.AppleJPEG (1.0 - 1) <9F0E8564-FCC4-33BE-9C6A-2BA926A33F6F> /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG
    0x7fff9093e000 -     0x7fff909b2fff  com.apple.Heimdal (4.0 - 2.0) <009F223D-B89B-376B-94F5-6D982CBEF771> /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal
    0x7fff90cb3000 -     0x7fff90cedff7  com.apple.DebugSymbols (132 - 132) <BDF57386-2881-35BD-9310-36904C764E93> /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols
    0x7fff90d85000 -     0x7fff90d86fff  libsystem_blocks.dylib (65) <49D42329-7DE9-3413-92C3-A473A7E9CF35> /usr/lib/system/libsystem_blocks.dylib
    0x7fff90d8a000 -     0x7fff90d8fff7  libheimdal-asn1.dylib (453.20.2) <EE3DD8E9-E543-3849-ADC9-EDBF2379C97C> /usr/lib/libheimdal-asn1.dylib
    0x7fff90d90000 -     0x7fff90da9fff  com.apple.CFOpenDirectory (10.11 - 194) <C21F33AA-CD06-3163-A1F3-1D116F788A11> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory
    0x7fff90e17000 -     0x7fff90e19ff7  com.apple.securityhi (9.0 - 55006) <516B018C-177A-3FAD-8487-97B50FB67DD1> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI
    0x7fff91218000 -     0x7fff9157af3f  libobjc.A.dylib (680) <9F45830D-F1D5-3CDF-9461-1A5477ED7D1E> /usr/lib/libobjc.A.dylib
    0x7fff91580000 -     0x7fff915ccff3  com.apple.HIServices (1.22 - 549) <14FB5BB6-8456-39F9-A694-8A1C12426880> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
    0x7fff91c5c000 -     0x7fff91ccbfff  com.apple.datadetectorscore (7.0 - 460) <CDBB7D7D-B189-37B0-AA4B-DC79090D0D71> /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore
    0x7fff91d09000 -     0x7fff91f89ff3  com.apple.security (7.0 - 57337.20.44) <6D1EFB27-3B0F-39EE-B491-6A697A12E98A> /System/Library/Frameworks/Security.framework/Versions/A/Security
    0x7fff91f8a000 -     0x7fff91fcfff7  com.apple.coreservices.SharedFileList (24.4 - 24.5) <72156BE7-0804-3F90-9AF9-14C4739430C2> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList
    0x7fff91fd0000 -     0x7fff91fe1ff7  libz.1.dylib (61.20.1) <B3EBB42F-48E3-3287-9F0D-308E04D407AC> /usr/lib/libz.1.dylib
    0x7fff91fe9000 -     0x7fff92038ff7  com.apple.opencl (2.6.9 - 2.6.9) <DFB196DD-1863-3E1F-A2CB-41559E898F50> /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL
    0x7fff934b2000 -     0x7fff934b6fff  libpam.2.dylib (20) <CFCD19BD-87BC-3F2B-BB1C-4C23E8E55F1A> /usr/lib/libpam.2.dylib
    0x7fff934b7000 -     0x7fff93643ff7  libGLProgrammability.dylib (12.0.40.6) <FEFAFD3E-D2A1-3ECA-BD45-61546C294F0B> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLProgrammability.dylib
    0x7fff936f0000 -     0x7fff93721fff  com.apple.GSS (4.0 - 2.0) <25DECD44-0905-3E53-9480-DE7BEB84DB83> /System/Library/Frameworks/GSS.framework/Versions/A/GSS
    0x7fff937e6000 -     0x7fff9381dff7  com.apple.LDAPFramework (2.4.28 - 194.5) <79D981F2-F70C-3E47-B124-DC0C90D45563> /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP
    0x7fff93ae2000 -     0x7fff93ae5fff  libCoreVMClient.dylib (119.5) <CD7DE25C-D7AD-3ECD-BEEC-F57992A4A08E> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib
    0x7fff93f5e000 -     0x7fff93f5efff  com.apple.Accelerate (1.10 - Accelerate 1.10) <DA5F3EA8-A06B-328A-B22C-9EE29916FD74> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
    0x7fff93f5f000 -     0x7fff93f79fff  com.apple.Kerberos (3.0 - 1) <836358DE-2731-3ACD-98E3-E5FA48917728> /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
    0x7fff93fd6000 -     0x7fff93fdffff  com.apple.icloud.FindMyDevice (1.0 - 1) <BB049D2D-9789-39E8-A09D-D300E7AA94D2> /System/Library/PrivateFrameworks/FindMyDevice.framework/Versions/A/FindMyDevice
    0x7fff93fe6000 -     0x7fff94047ff7  libsystem_network.dylib (583.20.10) <1C0410F3-F66E-3B0D-B8AD-0D49AB15A529> /usr/lib/system/libsystem_network.dylib
    0x7fff94147000 -     0x7fff9414cfff  com.apple.TCC (1.0 - 1) <C53628CA-0C75-34B6-AE6E-8BCF8A3ED099> /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC
    0x7fff9414d000 -     0x7fff94177ff7  GLRendererFloat (12.0.40.6) <805456A3-3352-340B-881A-E6E656A33645> /System/Library/Frameworks/OpenGL.framework/Versions/A/Resources/GLRendererFloat.bundle/GLRendererFloat
    0x7fff94265000 -     0x7fff9434bfef  unorm8_bgra.dylib (2.6.4.1) <F2A325FF-D55F-3091-88E2-5EBF3648274A> /System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/ImageFormats/unorm8_bgra.dylib
    0x7fff94a86000 -     0x7fff94a91fff  libcsfde.dylib (517.20.1) <42376761-F1B3-3086-AFBC-231507582BBE> /usr/lib/libcsfde.dylib
    0x7fff94ad7000 -     0x7fff94b25fff  libcurl.4.dylib (90) <FF42FAA6-E71B-3D0D-B5C9-B05BD2460C9A> /usr/lib/libcurl.4.dylib
    0x7fff94b26000 -     0x7fff94b9dfe7  libcorecrypto.dylib (335.20.1) <C6BD205F-4ECE-37EE-BCAB-A76F39CDCFFA> /usr/lib/system/libcorecrypto.dylib
    0x7fff94bde000 -     0x7fff94beefff  libbsm.0.dylib (34) <7E14504C-A8B0-3574-B6EB-5D5FABC72926> /usr/lib/libbsm.0.dylib
    0x7fff94bef000 -     0x7fff94d13fff  libsqlite3.dylib (216.4) <280D67B8-F93D-3587-A146-19F36C817548> /usr/lib/libsqlite3.dylib
    0x7fff94d14000 -     0x7fff94d69ff7  com.apple.AE (701 - 701) <FB22BE84-9CB8-36BF-8061-F93D716C0A84> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
    0x7fff94d6a000 -     0x7fff94d72fff  com.apple.AppleSRP (5.0 - 1) <25775E90-1DBB-3BFA-B4B4-F8F262B9EC1F> /System/Library/PrivateFrameworks/AppleSRP.framework/Versions/A/AppleSRP
    0x7fff94d73000 -     0x7fff94d81fff  libxar.1.dylib (302) <03207F66-2C4A-3DBD-8D81-70F4C85903C4> /usr/lib/libxar.1.dylib
    0x7fff94f68000 -     0x7fff94fcffff  com.apple.framework.CoreWiFi (11.0 - 1101.20) <BEC7B27E-8CE8-3DAB-BFDF-6C240C6A4B12> /System/Library/PrivateFrameworks/CoreWiFi.framework/Versions/A/CoreWiFi
    0x7fff94fd0000 -     0x7fff94feaff3  liblzma.5.dylib (10) <CC03591B-FA57-3CA5-AC81-0D76033AC0CE> /usr/lib/liblzma.5.dylib
    0x7fff94feb000 -     0x7fff9508bff7  com.apple.Metadata (10.7.0 - 972.16) <98CA1355-3E2C-364C-9C4F-3CA286DB08A7> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
    0x7fff95129000 -     0x7fff95131fff  com.apple.NetFS (6.0 - 4.0) <BDD59EC5-D399-31EA-9B2A-60E3A859FC42> /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
    0x7fff95132000 -     0x7fff95132ff7  liblaunch.dylib (756.20.4) <EDF719D6-D2BB-38DD-8C94-4272BEFDA2CD> /usr/lib/system/liblaunch.dylib
    0x7fff95133000 -     0x7fff951bbfff  com.apple.CoreSymbolication (3.1 - 58048.1) <2DFAF855-0528-370D-B4B0-EE0236766D9D> /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication
    0x7fff951bc000 -     0x7fff951bcfff  com.apple.Accelerate.vecLib (3.10 - vecLib 3.10) <F450DC3F-837D-35CB-97F3-5835E789EF02> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
    0x7fff951dc000 -     0x7fff951f2ff7  libLinearAlgebra.dylib (1159) <FA316609-9851-3C5C-AF46-685A25768D45> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib
    0x7fff95224000 -     0x7fff95248fff  com.apple.MultitouchSupport.framework (304.10 - 304.10) <CE5E8A54-180B-39FD-B57A-97E02B599B69> /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport
    0x7fff95249000 -     0x7fff9524bfff  libsystem_coreservices.dylib (19.2) <1B3F5AFC-FFCD-3ECB-8B9A-5538366FB20D> /usr/lib/system/libsystem_coreservices.dylib
    0x7fff952b2000 -     0x7fff952cbffb  com.apple.openscripting (1.7 - 169) <DB62452B-3C83-3B7A-8349-7536F4E1532B> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting
    0x7fff95370000 -     0x7fff95399ff7  libxslt.1.dylib (14) <CF5C6F5F-75D6-3C00-B6B2-1032D2799FBC> /usr/lib/libxslt.1.dylib
    0x7fff953ab000 -     0x7fff953c6ff7  libCRFSuite.dylib (34) <078B4CD8-6A8C-3067-B2BA-0C2A0BAB8AC3> /usr/lib/libCRFSuite.dylib
    0x7fff953fb000 -     0x7fff9546ffff  com.apple.framework.IOKit (2.0.2 - 1179.20.6) <BA27E459-85E8-3393-BEAA-BF67FE74F5F4> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    0x7fff9549c000 -     0x7fff9561afff  com.apple.UIFoundation (1.0 - 436.1) <8C254BB0-1DED-36A2-AAAF-786EB19CCE39> /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation
    0x7fff9561f000 -     0x7fff95627fff  libGFXShared.dylib (12.0.40.6) <05770D51-DB02-3ACD-86EF-D3A475A83D4D> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib
    0x7fff95628000 -     0x7fff95697fff  com.apple.SearchKit (1.4.0 - 1.4.0) <CA50106F-F45A-36AC-AD2B-C3B19F5DD52F> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
    0x7fff95698000 -     0x7fff956abfff  com.apple.CoreBluetooth (1.0 - 1) <BF5F87E3-6AAA-3B1F-9979-7A03D77937C8> /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth
    0x7fff956c6000 -     0x7fff956d1ff7  libcommonCrypto.dylib (60075.20.1) <766BC3F5-41F3-3315-BABC-72718A98EA92> /usr/lib/system/libcommonCrypto.dylib
    0x7fff956d2000 -     0x7fff956d9ff7  libcompiler_rt.dylib (62) <D3C4AB40-23B4-3BC6-8C38-5B8758D14E80> /usr/lib/system/libcompiler_rt.dylib
    0x7fff95747000 -     0x7fff95785ff7  libGLImage.dylib (12.0.40.6) <7A41B04A-8282-3530-809F-FAC4AC953CD2> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib
    0x7fff95992000 -     0x7fff959e2fff  libcups.2.dylib (435) <28A05475-9DBF-35EA-B218-3432B69EA18B> /usr/lib/libcups.2.dylib
    0x7fff95edb000 -     0x7fff95eddffb  libutil.dylib (43) <4C9BFE8B-563B-3EEA-A323-8F4F14E0A46C> /usr/lib/libutil.dylib
    0x7fff95f40000 -     0x7fff95f90ff7  com.apple.Symbolication (1.4 - 58044) <2EC9F04A-4370-39C8-8549-FC6411D87463> /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication
    0x7fff95f91000 -     0x7fff95faffff  libsystem_kernel.dylib (3248.20.55) <0E688457-4915-36DD-8798-5C2EDEE3F1A3> /usr/lib/system/libsystem_kernel.dylib
    0x7fff95fb0000 -     0x7fff9606afff  com.apple.DiscRecording (9.0.1 - 9010.4.3) <C4EC1EA7-E2AA-30F7-83CC-79171CDD50AA> /System/Library/Frameworks/DiscRecording.framework/Versions/A/DiscRecording
    0x7fff960f4000 -     0x7fff963e9fff  com.apple.HIToolbox (2.1.1 - 807.2) <D9338BEF-CA84-3085-B6CB-4E93B3B9A2E1> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
    0x7fff963ea000 -     0x7fff963fefe3  libCGInterfaces.dylib (317.9) <5079DE4F-3717-32FF-B76A-77F53236D17D> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/Libraries/libCGInterfaces.dylib
    0x7fff96d34000 -     0x7fff96f41ffb  libicucore.A.dylib (551.41) <CFFD7342-A7D6-323A-AC14-B9EECF6EFFED> /usr/lib/libicucore.A.dylib
    0x7fff96f42000 -     0x7fff96f6bfff  libc++abi.dylib (125) <DCCC8177-3D09-35BC-9784-2A04FEC4C71B> /usr/lib/libc++abi.dylib
    0x7fff96f6c000 -     0x7fff96f71fff  com.apple.DiskArbitration (2.7 - 2.7) <B7FAE647-156A-30C8-BA8B-69D188D02602> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
    0x7fff96fa4000 -     0x7fff96fc5fff  com.apple.Sharing (442.9.1 - 442.9.1) <672DE6DF-98E0-30A4-BA25-44BDE188D0BE> /System/Library/PrivateFrameworks/Sharing.framework/Versions/A/Sharing
    0x7fff970b9000 -     0x7fff974e7fff  com.apple.vision.FaceCore (3.3.1 - 3.3.1) <B8482831-77BD-3FBC-A0B1-12502353AA57> /System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/FaceCore
    0x7fff978bb000 -     0x7fff9799bff7  unorm8_rgba.dylib (2.6.4.1) <6970FC46-0D13-3614-929D-9504AB54C740> /System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/ImageFormats/unorm8_rgba.dylib
    0x7fff97d95000 -     0x7fff97d97fff  libCGXType.A.dylib (948) <C3D473CF-7261-3E0D-A161-E9B642B75D6A> /System/Library/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCGXType.A.dylib
    0x7fff97da0000 -     0x7fff97e8ffff  libxml2.2.dylib (29.2) <F70308DF-313F-334F-8F0E-82E79821583D> /usr/lib/libxml2.2.dylib
    0x7fff97f56000 -     0x7fff97f7dfff  com.apple.ProtectedCloudStorage (1.0 - 1) <F9E1BDE2-16AF-34B5-B7FE-127D511BDC9E> /System/Library/PrivateFrameworks/ProtectedCloudStorage.framework/Versions/A/ProtectedCloudStorage
    0x7fff97f7e000 -     0x7fff97f7ffff  libDiagnosticMessagesClient.dylib (100) <4243B6B4-21E9-355B-9C5A-95A216233B96> /usr/lib/libDiagnosticMessagesClient.dylib
    0x7fff97f80000 -     0x7fff97f80fff  libOpenScriptingUtil.dylib (169) <5CE2080C-398C-34C2-8D65-B9C627AACA19> /usr/lib/libOpenScriptingUtil.dylib
    0x7fff97f81000 -     0x7fff9808fff3  com.apple.desktopservices (1.10 - 1.10) <0BAED9FA-EFA5-3DA0-8715-043FD2400B77> /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
    0x7fff9809b000 -     0x7fff9809dff7  libsystem_configuration.dylib (802.20.7) <5FD79070-36CC-3D02-BEA7-BB5D2AE97D5D> /usr/lib/system/libsystem_configuration.dylib
    0x7fff98205000 -     0x7fff98331ff7  com.apple.CoreText (352.0 - 494.10) <9FD834B1-FF8E-3EB0-BB11-6E9120969086> /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText
    0x7fff983ea000 -     0x7fff98402fd7  libcompression.dylib (25) <202CE8A7-3D5B-347A-BD22-F0CB589B29AF> /usr/lib/libcompression.dylib
    0x7fff9840f000 -     0x7fff9850bff7  libFontParser.dylib (158.4) <BF7F82EB-7820-364A-865E-442F42BFDFA4> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontParser.dylib
    0x7fff98668000 -     0x7fff9868ffff  com.apple.ChunkingLibrary (167 - 167) <508861C9-F5E6-343B-8DD0-D71DFE49ECFD> /System/Library/PrivateFrameworks/ChunkingLibrary.framework/Versions/A/ChunkingLibrary
    0x7fff986f3000 -     0x7fff986f3fff  libmetal_timestamp.dylib (600.0.43.5) <A2B1C6F9-50D0-336B-A057-A7FBE2D7BDE2> /System/Library/PrivateFrameworks/GPUCompiler.framework/libmetal_timestamp.dylib
    0x7fff9876b000 -     0x7fff98b00fdb  com.apple.vImage (8.0 - 8.0) <4BAC9B6F-7482-3580-8787-AB0A5B4D331B> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
    0x7fff98b01000 -     0x7fff98b06ff3  libunwind.dylib (35.3) <124E0F05-2350-3774-A32C-7F5BF38EDE73> /usr/lib/system/libunwind.dylib
    0x7fff991d6000 -     0x7fff99286fff  com.apple.backup.framework (1.7.2 - 1.7.2) <890AF1EE-CFC9-3DAB-B236-88E203B4ADBC> /System/Library/PrivateFrameworks/Backup.framework/Versions/A/Backup
    0x7fff992bb000 -     0x7fff992bdff7  com.apple.xpc.ServiceManagement (1.0 - 1) <3777FD15-B6F3-32A2-A8E3-3E8CE3B8D5E7> /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement
    0x7fff99816000 -     0x7fff99874fff  com.apple.SystemConfiguration (1.14 - 1.14) <A6ABDEA0-88BB-3EA2-8C97-FC1A33ABB1D7> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
    0x7fff99875000 -     0x7fff9995cff7  libcrypto.0.9.8.dylib (59) <ED1C2A26-8FFC-30FF-8726-FF952EF94ADF> /usr/lib/libcrypto.0.9.8.dylib
    0x7fff99a18000 -     0x7fff99a3afff  com.apple.IconServices (68.1 - 68.1) <3ECAA762-1193-3D76-A25F-7680DB3A957E> /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices
    0x7fff99a3b000 -     0x7fff99a3dff7  libquarantine.dylib (80) <163CF63A-7455-3D1F-AE57-8C4475A9204C> /usr/lib/system/libquarantine.dylib
    0x7fff99a3e000 -     0x7fff99a49fff  libGL.dylib (12.0.40.6) <3F719CC4-8024-33B5-A49D-15FAE1955A12> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
    0x7fff99a5c000 -     0x7fff99acaff7  com.apple.ApplicationServices.ATS (377 - 394.3) <66E581EE-67E2-39E9-97A7-0614F334B9B3> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
    0x7fff99ad8000 -     0x7fff99bcaff7  libiconv.2.dylib (44) <F05A0A5A-92A9-3668-8F20-F27CBDA26BE9> /usr/lib/libiconv.2.dylib
    0x7fff99c9a000 -     0x7fff99cb7ff7  com.apple.AppleVPAFramework (2.1.2 - 2.1.2) <25691042-E51E-3A47-A908-E2F6D35451FC> /System/Library/PrivateFrameworks/AppleVPA.framework/Versions/A/AppleVPA
    0x7fff99cc8000 -     0x7fff99cceff7  com.apple.speech.recognition.framework (5.1.1 - 5.1.1) <FA5CB89A-2BFE-38CC-B1A3-E48792CD898C> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
    0x7fff99ccf000 -     0x7fff99cf8ffb  libRIP.A.dylib (948) <96E8F983-A8BA-3B0F-9035-E09642A63F6E> /System/Library/Frameworks/CoreGraphics.framework/Versions/A/Resources/libRIP.A.dylib
    0x7fff99d55000 -     0x7fff99d66fff  libSparseBLAS.dylib (1159) <3C520738-8F54-36E4-B966-97D1F886F59E> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib
    0x7fff99e13000 -     0x7fff99e2ffff  com.apple.GenerationalStorage (2.0 - 239) <EE667C63-3ADF-34D3-A8A7-316B66C7E290> /System/Library/PrivateFrameworks/GenerationalStorage.framework/Versions/A/GenerationalStorage

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 1
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 1262
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=234.5M resident=0K(0%) swapped_out_or_unallocated=234.5M(100%)
Writable regions: Total=136.8M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=136.8M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Accelerate.framework               128K        2 
Activity Tracing                  2048K        2 
CG backing stores                 9720K        4 
CG image                            76K        8 
CG shared images                   240K        8 
CoreAnimation                      120K       13 
CoreUI image data                 1808K       12 
CoreUI image file                  192K        4 
Dispatch continuations            8192K        2 
IOKit                             7940K        2 
Kernel Alloc Once                    8K        3 
MALLOC                            82.1M       25 
MALLOC guard page                   32K        7 
Memory Tag 242                      12K        2 
Memory Tag 249                     156K        2 
OpenCL                               8K        2 
OpenGL GLSL                        256K        4 
Process Corpse Info               2048K        2 
STACK GUARD                       56.0M       12 
Stack                             12.6M       13 
VM_ALLOCATE                       2164K       18 
VM_ALLOCATE (reserved)              36K        2         reserved VM address space (unallocated)
__DATA                            19.2M      266 
__GLSLBUILTINS                    2588K        2 
__IMAGE                            528K        2 
__LINKEDIT                        94.7M       53 
__TEXT                           139.9M      262 
__UNICODE                          552K        2 
mapped file                       40.5M       10 
shared memory                     16.4M       11 
===========                     =======  ======= 
TOTAL                            499.4M      727 
TOTAL, minus reserved VM space   499.3M      727 

Model: MacBookPro12,1, BootROM MBP121.0167.B15, 2 processors, Intel Core i5, 2.7 GHz, 8 GB, SMC 2.28f7
Graphics: Intel Iris Graphics 6100, Intel Iris Graphics 6100, Built-In
Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1867 MHz, 0x02FE, 0x4544464132333241324D412D4A442D460000
Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1867 MHz, 0x02FE, 0x4544464132333241324D412D4A442D460000
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x133), Broadcom BCM43xx 1.0 (7.21.94.136.1a1)
Bluetooth: Version 4.4.3f4 16616, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SM0256G, 251 GB
USB Device: USB 3.0 Bus
USB Device: Bluetooth USB Host Controller
Thunderbolt Bus: MacBook Pro, Apple Inc., 27.1

Compiling error

When i try to compile:

pygame_sdl2.color is out of date.
Error compiling Cython file:
------------------------------------------------------------
...
        self.r = r
        self.g = g
        self.b = b
        self.a = a

    cdef from_hex(self, c):
        ^
------------------------------------------------------------

src/pygame_sdl2/color.pyx:70:9: closures inside cdef functions not yet supported

Command '['cython', '-2', '-Iinclude', '-Igen', '-a', 'src/pygame_sdl2/color.pyx', '-o', 'gen/pygame_sdl2.color.c']' returned non-zero exit status 1

Pygame_SDL2 runs slower when large quantity of sprites are drawn

Introduction

I noticed that Pygame SDL2 seems to be slower when many sprites are drawn on the screen. I created a program a while ago called bullet stress test in order to test the limits of the number of sprites that can be drawn while keeping the framerate up. In this program, a set of bullet images are drawn on the screen at random positions. Periodically 20 more are added, and the framerate is recorded until 2000 bullets are present. CProfile was used to track which function calls are the most costly.

Experimental Procedure

The test was run on the following system. I'm having some difficulty getting Pygame to run properly due to problems that OSX 10.11 introduced but the same behavior is seen in Pygame_SDL2 on OSX.

Python version:

  • Python 2.7.11
  • Pygame 1.9.1 and Pygame_SDL2 Nightly (2016-02-08)
  • Command: python -m cProfile -o outputfile.cprof -s cumtime sprites.py
  • Program: The current version of bullet stress test on the Bitbucket page. In sprites.py, if the variable sdl2_mode is set to False, the program uses Pygame instead of Pygame_SDL2:
#Sprite Test

sdl2_mode = True 

if sdl2_mode:
    try:
        import pygame_sdl2
        pygame_sdl2.import_as_pygame()

    except ImportError:
        print "OOPS Pygame SDL2 not available"

[... rest of program ...]

OS and Hardware:

  • Windows 10 - 64 bit
  • MacBook Pro (Early 2015 Edition, Retina)
  • CPU: 2.7 GHz Intel Core i5
  • RAM: 8 GB
  • GPU: Intel Iris Graphics 6100 1536 MB

Results and Discussion

Figure 1 shows the results of the recorded FPS as a function of number of bullets drawn to the screen. For Pygame 1.9.1 we are able to keep 60 FPS for up to 1000 bullets, dropping to 30 FPS once 2000 bullets are on the screen and the experiment is ended. However, for Pygame_SDL2, the FPS declines starting at roughly 250 bullets, and decreases to below 10 FPS by 2000 bullets.

figure_1
Figure 1. FPS as a function of number of bullets on the screen. While Pygame can maintain 60 FPS up to over 1000+ sprites, Pygame_SDL2's frame rate drops precipitously above 250 bullets.

Cprofile stats are shown in Table 1 and Table 2 for Pygame and Pygame_SDL2 respectively. For over 12 million calls to blit, the cumulative time is less than 40 seconds. In contrast, the cumulative time spent in blit for Pygame_SDL2 is on the order of 400 seconds, representing an order of magnitude increase in time spent in this function.

As for the specific implementation details, I do not know why this occurs in Pygame vs. Pygame_SDL2 but I hope this data will help you be able to make the library run faster.

Tue Feb 09 21:14:43 2016    pygame191.cprof

         36564382 function calls (36562557 primitive calls) in 126.736 seconds

   Ordered by: cumulative time
   List reduced from 896 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.005    0.005  126.737  126.737 sprites.py:3(<module>)
        1    0.443    0.443  126.625  126.625 sprites.py:30(main)
     6061   52.406    0.009   52.406    0.009 {pygame.display.update}
 12122020   36.185    0.000   36.185    0.000 {method 'blit' of 'pygame.Surface' objects}
     6061   24.674    0.004   24.674    0.004 {method 'tick' of 'Clock' objects}
     6061    1.512    0.000   23.238    0.004 sprite.py:478(clear)
     6061    6.469    0.001   22.851    0.004 sprite.py:566(draw)
     6061    2.077    0.000    2.574    0.000 sprite.py:452(update)
  6060000    0.691    0.000    0.691    0.000 {method 'union' of 'pygame.Rect' objects}
  6060000    0.474    0.000    0.474    0.000 {method 'colliderect' of 'pygame.Rect' objects}

Table 1. Cprofile results of the script for Pygame 1.9.1. Note the total time spent in blit is less than 1 minute.


Tue Feb 09 21:23:10 2016    pygamesdl2.cprof

         36571201 function calls in 455.481 seconds

   Ordered by: cumulative time
   List reduced from 212 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.005    0.005  455.481  455.481 sprites.py:3(<module>)
        1    6.541    6.541  455.453  455.453 sprites.py:30(main)
 12122020  419.963    0.000  419.963    0.000 {method 'blit' of 'pygame_sdl2.surface.Surface' objects}
     6061    6.467    0.001  252.535    0.042 sprite.py:566(draw)
     6061    1.506    0.000  184.180    0.030 sprite.py:478(clear)
     6061    8.444    0.001    8.444    0.001 {pygame_sdl2.display.update}
  6060000    4.636    0.000    4.636    0.000 {method 'union' of 'pygame_sdl2.rect.Rect' objects}
  6060000    3.411    0.000    3.411    0.000 {method 'colliderect' of 'pygame_sdl2.rect.Rect' objects}
     6061    1.957    0.000    2.429    0.000 sprite.py:452(update)
     6061    0.876    0.000    0.981    0.000 {pygame_sdl2.event.get}

Table 2. Cprofile results of the same script for Pygame_SDL2. The total time spent in blit time is over an order of magnitude greater than in Pygame.

Python3 GCC 5.3.1 build fails

building 'pygame_sdl2.error' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -Isrc -I/usr/include/SDL2 -I/usr/include/python3.5m -I/home/elia/Progetti/Python/pygame-sdl2/include/python3.5m -c gen3/pygame_sdl2.error.c -o build/temp.linux-x86_64-3.5/gen3/pygame_sdl2.error.o -D_REENTRANT
gen3/pygame_sdl2.error.c: In function โ€˜__pyx_pf_11pygame_sdl2_5error_2set_errorโ€™:
gen3/pygame_sdl2.error.c:1072:3: error: format not a string literal and no format arguments [-Werror=format-security]
   SDL_SetError(__pyx_t_3);
   ^
cc1: some warnings being treated as errors
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

draw.rect() draws 1 pixel wider and taller boxes in Pygame_SDL2 than Pygame

Noticed this since some of Lost Sky's UI elements looked a little off.

The image "black.png" used in this script is here:

black

The following code fills the screen with black, draws a white 64x64 square and then blits black.png, a 64x64 pixel image on top of it.

# Comment out these two lines to go back to old Pygame version
import pygame_sdl2
pygame_sdl2.import_as_pygame()

import pygame
from pygame import KEYDOWN, QUIT
import sys

def main():

    pygame.init()
    tilesize = 35
    size_x = 24
    size_y = 18
    screen_size = (tilesize * size_x, tilesize * size_y)
    screen = pygame.display.set_mode(screen_size, 0, 32)
    clock = pygame.time.Clock()

    black_square = pygame.image.load('black.png')

    stop_flag = False

    while not stop_flag:

        for event in pygame.event.get():
            if event.type == QUIT:
                sys.exit()


        screen.fill((0,0, 0))

        pygame.draw.rect(screen, (255, 255, 255), (100, 100, 64, 64))
        screen.blit(black_square, (100,100))

        pygame.display.flip()

        clock.tick(60)

if __name__ == '__main__':
    main()

In Pygame, we get as expected a completely black screen.

screen shot 2016-01-25 at 9 50 37 pm

But in Pygame_SDL2, there is a 1 pixel think _| shaped thing where the rect is drawn one pixel too big.

screen shot 2016-01-25 at 9 49 57 pm

Package pygame_sdl2 as python wheels.

The wheels should include SDL2 and the various other libraries it will use.

Key to getting this to work will be adding a module that calls SetDllDirectory on windows, ensuring that the package directory is in the DLL search path before anything that links to SDL2 is loaded.

Fullscreen doesn't work.

When I run a game in full screen, nothing happens. This is no hang - there is just nothing to see.

This was working with pygame.

doesn't work with python3

Old pygame (at least the 1.9.2 pre-releases) compiled fine with python3. pygame_sdl2 currently doesn't. The first error I get is invalid syntax for "print".

LayeredDirty rect attribute problem?

Hello, the following example crashes on pygame_sdl2 but works fine on pygame.

Traceback (most recent call last):
  File "C:/Users/Kristjan/Documents/Kristjan/urbancity/rect_test.py", line 48, in <module>
    main()
  File "C:/Users/Kristjan/Documents/Kristjan/urbancity/rect_test.py", line 44, in main
    dirtyrects = allsprites.draw(screen)
  File "C:\Users\Kristjan\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pygame_sdl2\sprite.py", line 1075, in draw
    _update_append(_union_rect.clip(_clip))
  File "src/pygame_sdl2/rect.pyx", line 259, in pygame_sdl2.rect.Rect.clip (gen3\pygame_sdl2.rect.c:6822)
AttributeError: 'tuple' object has no attribute 'left'
# Comment out these two lines to go back to old Pygame version
import pygame_sdl2
pygame_sdl2.import_as_pygame()

import pygame
from pygame import QUIT
import sys


class WhiteSquare(pygame.sprite.DirtySprite):
    def __init__(self):
        pygame.sprite.DirtySprite.__init__(self)
        self.dirty = 2
        self.image = pygame.Surface((10, 10))
        self.image.fill((255, 255, 255))
        self.rect = self.image.get_rect()

    def update(self):
        self.rect.x += 1


def main():
    pygame.init()
    screen = pygame.display.set_mode((500, 50))
    clock = pygame.time.Clock()

    allsprites = pygame.sprite.LayeredDirty()
    allsprites.add(WhiteSquare())

    background = pygame.Surface((500, 50))
    screen.blit(background, (0, 0))
    pygame.display.flip()
    allsprites.clear(screen, background)

    while True:
        clock.tick(60)
        for event in pygame.event.get():
            if event.type == QUIT:
                sys.exit()

        allsprites.update()
        dirtyrects = allsprites.draw(screen)
        pygame.display.update(dirtyrects)

if __name__ == '__main__':
    main()

Compiling Error

Hi!

I pulled the latest version (997b463) and am not able to compile. Tried on both OSX and Linux and both gave the same error:

(pygame_sdl2)AkaneSenri:pgsdl2 rune_devros$ python setup.py install
pygame_sdl2.error is out of date.
pygame_sdl2.color is out of date.
pygame_sdl2.controller is out of date.
pygame_sdl2.rect is out of date.
warning: src/pygame_sdl2/rect.pyx:402:8: Unreachable code
pygame_sdl2.rwobject is out of date.

Error compiling Cython file:
------------------------------------------------------------
...

cdef set_error(e):
    cdef char *msg
    e = str(e)
    msg = <char *> e
    SDL_SetError("%s", e)
                       ^
------------------------------------------------------------

src/pygame_sdl2/rwobject.pyx:56:24: Python object cannot be passed as a varargs parameter

Command '['cython', '-2', '-Iinclude', '-Igen', '-a', 'src/pygame_sdl2/rwobject.pyx', '-o', 'gen/pygame_sdl2.rwobject.c']' returned non-zero exit status 1

Can you add the pygame.mask Submodule

I'm trying to convert my game written in pygame into an android Aplication using your libraries and Project. The problem is, that i need the pygame.mask, which doesn't seems to be implemented yet.
I would be very pleased if you can add it to your Project.
Thank you

setup on win7 x86-64 python 3.5 x86

python.exe setup.py install:

Traceback (most recent call last):
File "setup.py", line 47, in
parse_cflags([ "sh", "-c", "sdl2-config --cflags" ])
File "C:\pygame_sdl2\setuplib.py", line 93, in parse_cflags
output = subprocess.check_output(command, universal_newlines=True)
File "c:\Python35-32\lib\subprocess.py", line 629, in check_output
*_kwargs).stdout
File "c:\Python35-32\lib\subprocess.py", line 696, in run
with Popen(_popenargs, **kwargs) as process:
File "c:\Python35-32\lib\subprocess.py", line 950, in init
restore_signals, start_new_session)
File "c:\Python35-32\lib\subprocess.py", line 1220, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] O sistema n\xe3o pode encontrar o arquivo especificado
(=The system couldn't find the specified file)

Minor error in README

The line:
git clone https://github.com/pygame_sdl2_windeps

Should actually read:
git clone https://github.com/renpy/pygame_sdl2_windeps

This messed me up when I first tried using the library. Forgot to mention until now!

Surface.set_alpha() doesn't work

Hi there! We use translucent surfaces in order to apply a tint to images and do things like fade in and out. It looks like Pygame_SDL2's set_alpha() function on surfaces isn't working.

The following code draws a semi-transparent red box over a white box in Pygame:

screen shot 2016-01-23 at 5 06 02 pm

But it draws a solid red box in Pygame_SDL2:

screen shot 2016-01-23 at 5 06 28 pm

Code to reproduce it is below:

# Comment out these two lines to go back to old Pygame version
import pygame_sdl2
pygame_sdl2.import_as_pygame()

import pygame
from pygame import KEYDOWN, QUIT
import sys

def main():

    pygame.init()
    tilesize = 35
    size_x = 24
    size_y = 18
    screen_size = (tilesize * size_x, tilesize * size_y)
    screen = pygame.display.set_mode(screen_size, 0, 32)
    clock = pygame.time.Clock()

    stop_flag = False

    block = pygame.Surface((300,300))
    block.fill((255,255,255))

    overlay_block = pygame.Surface((300,300))
    overlay_block.fill((255,0,0))
    overlay_block.set_alpha(140)

    while not stop_flag:

        for event in pygame.event.get():
            if event.type == QUIT:
                sys.exit()


        screen.fill((200,200,200))

        screen.blit(block, (50,50))
        screen.blit(overlay_block, (100,100))

        pygame.display.flip()
        clock.tick(60)


if __name__ == '__main__':
    main()

Multiple displays and window position

  1. One of the new features available in SDL2 is the ability to handle multiple displays, It'll be a great if it's listed upon the upcoming features for the next pygame_sdl2 release.

  2. Another point: the ability to set the position of the pygame window was available in the old pygame versions, Is it possible to do so using pygame_sdl2 with the current modules ?

Rendering the Empty String and None

Hi! Detected another crash getting Lost Sky to work on Pygame_SDL2

I'm not sure how backwards compatible you want it to be but the following code works in Pygame but crashes in Pygame_SDL2.

Crash when Font.render() tries to render an empty string.

Traceback (most recent call last):
  File "/Users/rune_devros/Documents/lostskyproject/sandbox/text_test.py", line 64, in <module>
    main()
  File "/Users/rune_devros/Documents/lostskyproject/sandbox/text_test.py", line 31, in main
    text_rendered2 = font.render(text2, True, (0,0,0))
  File "src/pygame_sdl2/font.pyx", line 75, in pygame_sdl2.font.Font.render (gen/pygame_sdl2.font.c:1718)
pygame_sdl2.error.error: Text has zero width

Crash when Font.render() is passed None

Traceback (most recent call last):
  File "/Users/rune_devros/Documents/lostskyproject/sandbox/text_test.py", line 67, in <module>
    main()
  File "/Users/rune_devros/Documents/lostskyproject/sandbox/text_test.py", line 41, in main
    text_rendered3 = font.render(text3, True, (0,0,0))
  File "src/pygame_sdl2/font.pyx", line 70, in pygame_sdl2.font.Font.render (gen/pygame_sdl2.font.c:1641)
AttributeError: 'NoneType' object has no attribute 'encode'

Code to reproduce these errors is below. Please place a TTF font file (anything works) called "somefont.ttf" in the same directory as the python script. I don't think Github lets me upload a font fole? In Pygame both of these scenarios return a blank 1x30 surface when the font size is set to 25.

Program Output:

Width: 1
Height: 30
Width: 1
Height: 30
# Comment out these two lines to go back to old Pygame version
import pygame_sdl2
pygame_sdl2.import_as_pygame()

import pygame
from pygame import KEYDOWN, QUIT
import sys

def main():

    pygame.init()
    tilesize = 35
    size_x = 24
    size_y = 18
    screen_size = (tilesize * size_x, tilesize * size_y)
    screen = pygame.display.set_mode(screen_size, 0, 32)
    clock = pygame.time.Clock()

    stop_flag = False

    # Put any font file called somefont.ttf in the same directory as this script
    font = pygame.font.Font("somefont.ttf", 25)

    text = "BLAH BLAH BLAH"
    text_rendered = font.render(text, True, (0,0,0))

    # An empty string
    text2 = ""
    text_rendered2 = font.render(text2, True, (0,0,0))
    print "Width: %d"%text_rendered2.get_width()
    print "Height: %d"%text_rendered2.get_height()

    # passing None to the font renderer
    text3 = None
    text_rendered3 = font.render(text3, True, (0,0,0))
    print "Width: %d"%text_rendered3.get_width()
    print "Height: %d"%text_rendered3.get_height()

    while not stop_flag:

        for event in pygame.event.get():
            if event.type == QUIT:
                sys.exit()


        screen.fill((200,200,200))

        screen.blit(text_rendered, (50, 50))
        screen.blit(text_rendered2, (50,150))
        screen.blit(text_rendered3, (50, 250))

        pygame.display.flip()
        clock.tick(60)


if __name__ == '__main__':
    main()

No Windows Build Instructions

There currently aren't any Windows build instructions, and I'm trying to compile in cygwin as I write this, so would you like me to add a little part to the README on windows installation once I get it working?

import_as_pygame() not working for static methods

I don't know if this is specific to pygame_sdl2 or if this is expected behavior for python, but I'll report it here it anyway. It appears as if the

import pygame_sdl2
pygame_sdl2.import_as_pygame()

does not work when the pygame module is afterwards referenced in a static method. A function like:

@staticmethod
    def init_display(experiment):
        # Intialize PyGame
        pygame.init()

stops with the following stack trace

 ...
  File "/path/to/module.py", line 227, in init_display
    pygame.init()
NameError: global name 'pygame' is not defined

Is there a way to let the pygame_sdl2.import_as_pygame() functionality transfer to static methods?

Alpha transparency handled differently for surface.fill and pygame.draw functions

Context

I noticed this difference testing Lost Sky because Marisa's Master Spark spell looks different in Pygame SDL2.

Pygame SDL2
screen shot 2016-02-01 at 8 33 29 pm

vs

Pygame
marisa_ms

Directions to Reproduce

I tracked this down to the way alpha transparency works in surface.fill() vs the pygame.draw functions draw.rect and draw.polygon (Marisa's Master Spark uses the latter), producing drawings that are more transparent than desired.

The following code produces differences in Pygame and Pygame SDL2. In Pygame, both kinds of functions match up. Items are created by surface.fill(), pygame.draw.rect(), pygame.draw.circle(), pygame.draw.polygon() from left to right.

screen shot 2016-02-01 at 8 44 02 pm

But in Pygame SDL2, the items are more transparent when drawing functions are called but the same alpha values are passed into the function:

screen shot 2016-02-01 at 8 44 22 pm

# Comment out these two lines to go back to old Pygame version
import pygame_sdl2
pygame_sdl2.import_as_pygame()

import pygame
from pygame import KEYDOWN, QUIT
import sys

def main():

    pygame.init()
    tilesize = 35
    size_x = 24
    size_y = 18
    screen_size = (tilesize * size_x, tilesize * size_y)
    screen = pygame.display.set_mode(screen_size, 0, 32)
    clock = pygame.time.Clock()

    stop_flag = False

    while not stop_flag:

        for event in pygame.event.get():
            if event.type == QUIT:
                sys.exit()


        screen.fill((200,0, 0))


        for i in xrange(0, 10):
            box_surface_fill = pygame.Surface((50, 50), pygame.SRCALPHA)
            box_surface_fill.fill((255, 255, 255, i*20))

            box_surface_rect = pygame.Surface((50, 50), pygame.SRCALPHA)
            pygame.draw.rect(box_surface_rect, (255, 255, 255, i*20), (0,0, 50,50))

            box_surface_circle = pygame.Surface((50, 50), pygame.SRCALPHA)
            pygame.draw.circle(box_surface_circle, (255, 255, 255, i*20), (25,25), 10)


            box_surface_polygon = pygame.Surface((50, 50), pygame.SRCALPHA)
            pygame.draw.polygon(box_surface_polygon, (255, 255, 255, i*20), ((25,0), (0,25), (25,50), (50,25)))

            screen.blit(box_surface_fill, (50, i*60))
            screen.blit(box_surface_rect, (150, i*60))
            screen.blit(box_surface_circle, (250, i*60))
            screen.blit(box_surface_polygon, (350, i*60))

        pygame.display.flip()

        clock.tick(60)

if __name__ == '__main__':
    main()

Surface.get_alpha() doesn't work

import pygame_sdl2
pygame_sdl2.import_as_pygame()

import pygame
import os

print (pygame.version.ver)
print (pygame.version.vernum)
print (pygame.version.rev)
main_dir = os.path.split(os.path.abspath(__file__))[0]

filename =["image.png" , "image.bmp" , "image.jpg" , "image.gif"] 

def test_alpha(path):
    path = os.path.join(main_dir,path )
    print(path)
    image=pygame.image.load(path)
    if image.get_alpha() is None:
        print("None")
    else:
        print("Alpha!")

for path in filename:
    test_alpha(path)

"normal" pygame with SDL
sdl

pygame with SDL2
sdl2

Blitting doesn't support vector object

I'm trying to get my project Story of a Lost Sky running on Pygame_SDL2. I rely heavily on a Vector2 package for vector math called GameObjects and while I can directly pass it as a blitting coordinate in Pygame it looks like Pygame_SDL2 doesn't support this.

2016-01-15 21:01:23.274 Python[4243:25701] 21:01:23.274 WARNING:  140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.
Traceback (most recent call last):
  File "/Users/rune_devros/Documents/lostskyproject/sandbox/vector2_test.py", line 185, in <module>
    main()
  File "/Users/rune_devros/Documents/lostskyproject/sandbox/vector2_test.py", line 178, in main
    screen.blit(block, coord)
  File "src/pygame_sdl2/surface.pyx", line 184, in pygame_sdl2.surface.Surface.blit (gen/pygame_sdl2.surface.c:2832)
  File "src/pygame_sdl2/rect.pyx", line 379, in pygame_sdl2.rect.to_sdl_rect (gen/pygame_sdl2.rect.c:10458)
TypeError: Argument dest must be a rect style object.

Rather than trying the entire SoaLS codebase, I've included a snippet of code that demonstrates this behavior. The following code works with Pygame (if you comment out the first two lines), but not Pygame_SDL2

# Comment out these two lines to go back to old Pygame version
import pygame_sdl2
pygame_sdl2.import_as_pygame()

import pygame
from pygame import KEYDOWN, QUIT
import sys

# Vector 2 class:
# Modified Minimal Implementation from GameObjects
# https://pypi.python.org/pypi/gameobjects/0.0.3

from math import sqrt

class Vector2(object):

    __slots__ = ('_v', )

    _gameobjects_vector = 2


    def __init__(self, x=0., y=0.):
        """Initialise a vector

        @type x: number
        @param x: The x value (defaults to 0.), or a container of 2 values
        @type x: number
        @param y: The y value (defaults to 0.)

        """
        if hasattr(x, "__getitem__"):
            x, y = x
            self._v = [float(x), float(y)]
        else:
            self._v = [float(x), float(y)]

    def _get_length(self):
        x, y = self._v
        return sqrt(x*x + y*y)
    def _set_length(self, length):
        v = self._v
        try:
            x, y = v
            l = length / sqrt(x*x +y*y)
        except ZeroDivisionError:
            v[0] = 0.0
            v[1] = 0.0
            return self
        v[0] *= l
        v[1] *= l
    length = property(_get_length, _set_length, None, "Length of the vector")


    @classmethod
    def from_floats(cls, x, y):
        vec = cls.__new__(cls, object)
        vec._v = [x, y]
        return vec


    def __iter__(self):

        return iter(self._v[:])

    def __len__(self):

        return 2


    def __getitem__(self, index):
        """Gets a component as though the vector were a list."""
        try:
            return self._v[index]
        except IndexError:
            raise IndexError, "There are 2 values in this object, index should be 0 or 1"


    def __add__(self, rhs):
        x, y = self._v
        xx, yy = rhs
        return Vector2.from_floats(x+xx, y+yy)




def main():

    pygame.init()
    tilesize = 35
    size_x = 24
    size_y = 18
    screen_size = (tilesize * size_x, tilesize * size_y)
    screen = pygame.display.set_mode(screen_size, 0, 32)
    clock = pygame.time.Clock()

    stop_flag = False

    coord = Vector2(50,50)

    block = pygame.Surface((30,30))
    block.fill((255,0,0))


    while not stop_flag:

        for event in pygame.event.get():
            if event.type == KEYDOWN or event.type == QUIT:
                sys.exit()


        screen.fill((200,200,200))

        # Passing a Vector object to blit doesn't work in Pygame SDL2 but works in Pygame
        screen.blit(block, coord)

        screen.blit(block, coord+(50,50))

        pygame.display.flip()
        clock.tick(60)


if __name__ == '__main__':
    main()

Surface.set_colorkey() doesn't work

Hi! The following code produces this in Pygame_SDL2

screen shot 2016-01-15 at 9 50 14 pm

and produces a properly transparent surface with colorkey color set to (0,0,0) in Pygame.

screen shot 2016-01-15 at 9 50 38 pm

Not sure if this is part of the stuff that Surface hasn't been implemented yet but we use this feature for some of our UI elements in Lost Sky. Thanks in advance!

# Comment out these two lines to go back to old Pygame version

import pygame_sdl2
pygame_sdl2.import_as_pygame()

import pygame
from pygame import KEYDOWN, QUIT
import sys

def get_panel():
    panel = pygame.Surface((300,300))
    panel.set_colorkey((0,0,0))

    panel.fill((0,0,0))
    pygame.draw.rect(panel, (255, 0, 0),(20, 20, 100,100))

    return panel

def main():

    pygame.init()
    tilesize = 35
    size_x = 24
    size_y = 18
    screen_size = (tilesize * size_x, tilesize * size_y)
    screen = pygame.display.set_mode(screen_size, 0, 32)
    clock = pygame.time.Clock()

    stop_flag = False

    block = get_panel()

    while not stop_flag:

        for event in pygame.event.get():
            if event.type == QUIT:
                sys.exit()


        screen.fill((200,200,200))

        screen.blit(block, (50,50))

        pygame.display.flip()
        clock.tick(60)


if __name__ == '__main__':
    main()

Missing headers on install

Hi there, since version 6.99.9 I haven't been able to package this because of a missing headers (well, most likely 3). Full build & install log here: https://paste.xinu.at/D3O/
Have you got any idea what could be the problem ? Happens with python 2 or 3 and inside or outside of a clean chroot.

Blitting a surface with a color key to another surface causes target surface not to blit properly to screen

Hi!

Looks like the last fix to alpha transparency introduced another error. Here it is the scenario when Surface A is assigned a color key is blitted to Surface B, Surface B is not drawn when blitted to the screen.

The following code doesn't appear to be able to draw Surface B in Pygame_SDL2:

screen shot 2016-01-23 at 9 28 41 pm

Disabling the Surface A's colorkey produces this, which enables Surface B to be drawn

screen shot 2016-01-23 at 9 42 44 pm

In Pygame, the code below produces a red square, the product of Surface B being properly drawn to the screen:

screen shot 2016-01-23 at 9 29 22 pm

# Comment out these two lines to go back to old Pygame version
import pygame_sdl2
pygame_sdl2.import_as_pygame()

import pygame
from pygame import QUIT
import sys

def target_surf_test():

    # Create a target surface with the SRCALPHA flag enabled to which to draw another surface to
    target_surface = pygame.Surface((500, 500), pygame.SRCALPHA)

    # Create the second_surface which will be blitted to the target surface
    second_surface = pygame.Surface((200, 200))

    # Assign a color key to the second surface
    colorkey = (0,0,0)
    second_surface.fill(colorkey)

    # If you disable this line, the target surface actually draws
    second_surface.set_colorkey(colorkey)


    # Draw a red rectangle to the second surface
    color = (255, 0, 0)

    pygame.draw.rect(second_surface,color,(25, 25, 100, 100))

    # Draw the second surface to the target surface
    target_surface.blit(second_surface,(10,10))

    return target_surface


def main():

    pygame.init()
    tilesize = 35
    size_x = 24
    size_y = 18
    screen_size = (tilesize * size_x, tilesize * size_y)
    screen = pygame.display.set_mode(screen_size, 0, 32)
    clock = pygame.time.Clock()

    stop_flag = False


    block = target_surf_test()

    while not stop_flag:

        for event in pygame.event.get():
            if event.type == QUIT:
                sys.exit()


        screen.fill((200,200,200))


        # Draw the block surface we obtained
        # Pygame - Draws a red block
        # Pygame_SDL2 - Doesn't draw anything
        screen.blit(block, (50,50))

        pygame.display.flip()
        clock.tick(60)


if __name__ == '__main__':
    main()

pygame_sdl2.error.error: Failed loading smpeg2.dll: The specified module could not be found.

I set the following error when trying to play music:

File "src/pygame_sdl2/mixer_music.pyx", line 53, in pygame_sdl2.mixer_music.load (gen\pygame_sdl2.mixer_music.c:1050)
pygame_sdl2.error.error: Failed loading smpeg2.dll: The specified module could not be found.

This is when using the latest nightly build of pygame_sdl2 for Windows. The Linux build using the non-nightly works fine though. Can confirm that smpeg2.dll is in the pygame_sdl2 folder though.

EDIT: Weird and possibly related, once I run the code and this error pops up my audio player stops working for a while. Listening to music while testing (Audacious) and the player stops.

Error message: could not find any library for SDL2

I try to check the sdl2 working status by writing below code in Python 2.7.11 on windows 7 (64bit) and execute.
import sdl2.ext
After executing, it does not work and got "ImportError: could not find any library for SDL2".
I've already set environment path "C:\Python27\Lib\site-packages\sdl2" before running it.
What's problem here?
For me, it's a big issue. Are there detail steps for me reference?

Issues With Py2EXE

When a game is compiled to EXE with Py2EXE it silent closes with no errors. Also strangely, I have to add the libwebp-4.dll to the folder with the EXE or it does (at least) error out; asking for that file.

I thought perhaps my script is wrong, but have tried multiple variations. The game will work fine with no issues prior to compiling the EXE though. Not sure what approach to take but it seems to be a mix of Pygame_SDL2 and Py2EXE as the game compiled fine prior to using it.

EDIT: My guess is that Py2EXE is not pulling in all the right stuff for Pygame_SDL2 to function at all.

Compile error on Linux Mint

I get an error when trying to install the library on Linux Mint:

"src/pygame_sdl2/color.pyx:70:9: closures inside cdef functions not yet supported"

Could not open 'DejaVuSans.ttf'

Same as Issue 42, failing to open files on the pygame_sdl2 directory, in this case the font DejaVuSans.ttf:
File "src\pygame_sdl2\font.pyx", line 65, in pygame_sdl2.font.Font.__init__ (gen3\pygame_sdl2.font.c:1594) File "src\pygame_sdl2\rwobject.pyx", line 198, in pygame_sdl2.rwobject.to_rwops (gen3\pygame_sdl2.rwobject.c:3027) OSError: Could not open 'DejaVuSans.ttf': b"Couldn't open DejaVuSans.ttf"
Using windows 7 x64, python 3.5 x86, pygame_sdl2 and windeps as of 06/07/2016.

Can't import pygame_sdl2

When I try running fix_virtualenv.py, I get "/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 is not a symlink. Perhaps this script has already been run."

I went ahead and installed it anyway, and it seemed successful. But when I try to import it, I get this error:

>>> import pygame_sdl2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame_sdl2-2.1.0-py2.7-macosx-10.5-fat.egg/pygame_sdl2/__init__.py", line 79, in <module>
    from pygame_sdl2.error import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame_sdl2-2.1.0-py2.7-macosx-10.5-fat.egg/pygame_sdl2/error.so, 2): Symbol not found: _SDL_GetError
  Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame_sdl2-2.1.0-py2.7-macosx-10.5-fat.egg/pygame_sdl2/error.so
  Expected in: dynamic lookup

OS X 10.11.4, Python 2.7.11...how do I fix it?

pygame_sdl2.mixer: channel_callback sometimes causes the app to hang indefinitely

This is more likely to happen when there are a lot of sounds being played and stopped. pygame_sdl2.mixer.channel_callback will sometimes get stuck waiting for GIL indefinitely, causing the app to hang.

The solution is to make calls to SDL Mixer functions such as Mix_PlayChannelTimed, Mix_HaltChannel and Mix_FadeOutChannel in no GIL mode.

I think this problem is caused by a race condition. AFAIK, SDL uses a separate thread for audio. When we call Mix_HaltChannel for example, it probably switches to another thread, where it stops the audio playing and then executes the callback. Sometimes the call returns before the audio thread requests the callback and everything works fine, and sometimes, the callback gets called before Mix_HaltChannel returns and releases the GIL, leading to a deadlock. That's why calling these methods in nogil fixes the issue.

I'll submit a pull request with the fix soon.

Build fails with cython-0.23

As reported here, building pygame_sdl2 fails when compiling with cython-0.23

The error given is:

Error compiling Cython file:
------------------------------------------------------------
...

    cdef Sint64 left = sf.length - sf.tell
    cdef size_t rv;

    if size * maxnum > left:
        maxnum = left / size
                     ^
------------------------------------------------------------

src/pygame_sdl2/rwobject.pyx:149:22: Cannot assign type 'double' to 'size_t'
pygame_sdl2.error is out of date.
pygame_sdl2.color is out of date.
pygame_sdl2.rect is out of date.
pygame_sdl2.rwobject is out of date.

Command '['cython', '-3', '-Iinclude', '-Igen3', '-a', 'src/pygame_sdl2/rwobject.pyx', '-o', 'gen3/pygame_sdl2.rwobject.c']' returned non-zero exit status 1

Pygame and Pygame_SDL2 render text in different sizes

Noticed this while writing the surface testing. Looks like Pygame and Pygame_SDL2 handle text sizes differently. The following code draws a 100 pixel block and some text. To run it you need to put a font called "somefont.ttf" in the directory. I'm using DejaVuSans-Oblique.ttf in this example.

Pygame

screen shot 2016-01-23 at 10 46 38 pm

Pygame_SDL2

screen shot 2016-01-23 at 10 46 08 pm

# Comment out these two lines to go back to old Pygame version
import pygame_sdl2
pygame_sdl2.import_as_pygame()

import pygame
from pygame import KEYDOWN, QUIT
import sys


def main():

    pygame.init()
    tilesize = 35
    size_x = 24
    size_y = 18
    screen_size = (tilesize * size_x, tilesize * size_y)
    screen = pygame.display.set_mode(screen_size, 0, 32)
    clock = pygame.time.Clock()

    stop_flag = False

    #
    font = pygame.font.Font("somefont.ttf", 25)

    text = "This is a 100 pixel wide block for reference"

    text_rendered = font.render(text, True, (0,0,0))

    block = pygame.Surface((100,100))
    block.fill((255,0,0))

    while not stop_flag:

        for event in pygame.event.get():
            if event.type == QUIT:
                sys.exit()


        screen.fill((200,200,200))

        screen.blit(text_rendered, (300,50))

        screen.blit(block, (50,50))

        pygame.display.flip()
        clock.tick(60)

if __name__ == '__main__':
    main()

compilation error in Ubuntu 15.04

I have installed all the libs in my Ubuntu 15.04 and i got this:

kaybo@BOST:~/Downloads/pygame_sdl2-master$ python setup.py install
[....]
gen/pygame_sdl2.image.c:259:23: fatal error: SDL_image.h: No such file or directory
 #include "SDL_image.h"
                       ^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

pygame_sdl2.error is out of date

I get the following error while running python setup.py install

shivam@shivam-Inspiron-3542 ~/Documents/My Projects/Python/pygame/pygame_sdl2-master $ python setup.py install
pygame_sdl2.error is out of date.
Traceback (most recent call last):
  File "setup.py", line 109, in <module>
    cython("pygame_sdl2.error", libs=sdl_libs)
  File "/home/shivam/Documents/My Projects/Python/pygame/pygame_sdl2-master/setuplib.py", line 245, in cython
    c_fn])
  File "/usr/lib/python2.7/subprocess.py", line 536, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 523, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

I am running Linux Mint 18 "Serena" Cinnamon edition

sdl2 setup,py install

Hi, I follow instruction to install sdl2, but have files can't be found issue. Did I miss something? The python is 2.7.11 in windows 10. Below is the message from system. Thanks.

C:\pygame_sdl2-2.1.0a2016.06.04>python setup.py install
Traceback (most recent call last):
File "setup.py", line 47, in
parse_cflags([ "sh", "-c", "sdl2-config --cflags" ])
File "C:\pygame_sdl2-2.1.0a2016.06.04\setuplib.py", line 93, in parse_cflags
output = subprocess.check_output(command, universal_newlines=True)
File "C:\Python27\lib\subprocess.py", line 566, in check_output
process = Popen(stdout=PIPE, _popenargs, *_kwargs)
File "C:\Python27\lib\subprocess.py", line 710, in init
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 958, in _execute_child
startupinfo)
WindowsError: [Error 2]

'error: GLX is not supported' creating software window on Linux

src/pygame_sdl2/display.pyx unconditionally adds the SDL_WINDOW_OPENGL flag to SDL_CreateWindow, so pygame_sdl2 programs won't start at all on a Linux system unless OpenGL is working. (Seen breaking things in the wild on a newly-installed Debian machine with a minimalist package set.)

It looks to me from the rest of display.pyx like the SDL_WINDOW_OPENGL flag is meant to be optional - Pygame doesn't actually set up GL contexts unless SDL_WINDOW_OPENGL is set by the caller. Is there any particular reason for all windows to be GL windows? (I'm guessing it's there to work around highdpi-related breakage on Mac/Win)

Setting GL version

In SDL, there's a way to set GL's version, with

SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, maj);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, min);

Is there a way to do this in PyGame-SDL2?

(I know that display.set_gl_attribute() calls SDL_GL_SetAttribute(), but there's no constalnt for SDL_GL_CONTEXT_MINOR_VERSION and SDL_GL_CONTEXT_MAJOR_VERSION)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.