Questions tagged [pysdl2]

PySDL2 is a Python wrapper around version 2.0 of the cross-platform multimedia library SDL. PySDL2 is designed to provide Python code with low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.

PySDL2 is a Python wrapper around version 2.0 of the cross-platform multimedia library SDL. PySDL2 is designed to provide Python code with low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.

PySDL2 has been released as public domain work, and thus has no licensing restrictions. It does not rely on any additional C code, choosing to wrap the SDL 2.0 library using the ctypes Python module.

PySDL2 also offers support for the following SDL-related libraries:

Useful Links

60 questions
15
votes
1 answer

Strange sdl side-effect on unrelated windows

When playing with sdl2 via pysdl2 I noticed this strange side-effect where once the sdl script runs unrelated windows which would normally become translucent when moved do now stay opaque. I wouldn't mind all that much if it weren't for the nagging…
Paul Panzer
  • 47,318
  • 2
  • 37
  • 82
5
votes
1 answer

PySDL2 issue with SDL_Surface / LP_SDL_Surface

Im running win7 with python 3.3 and PySDL2 0.5. When creating surfaces (no matter what method) i get an LP_SDL_Surface instead of a SDL_Surface. The LP_SDL_Surface lacks any of the methods and attribute you would expect it to have. Here is the issue…
4
votes
2 answers

(Py)SDL2: Drawing a textured polygon

PySDL2 version: 0.9.3 SDL2 version: 2.0.3 I am trying to render this image as a texture on a polygon in PySDL2 using sdl_gfx but its display is completely distorted, as can be seen at the bottom-right corner in the SDL window: I have this python…
Daniel Schreij
  • 663
  • 6
  • 22
4
votes
2 answers

Python with PySDL2 - could not find any library for SDL2

I'm starting to use PySDL2 with Python 3.4 to make a game. Every time I run the "hello world" code given by the PySDL2 documentation it looks like I haven't installed the SDL library: ImportError: could not find any library for SDL2…
BusaniX
  • 65
  • 1
  • 5
4
votes
1 answer

pysdl2 Access Violation displaying image

I'm trying to get started with pysdl2 on a windows machine. So far I have just got as far as copying-and-pasting the Hello World tutorial, just so I can see if it's actually working! It isn't. import sys import sdl2.ext RESOURCES =…
MalphasWats
  • 3,123
  • 6
  • 31
  • 40
4
votes
2 answers

RuntimeError: could not find any library for SDL2_ttf

I have a problem with pysdl2. I'm trying to launch examples from site-packages\sdl2\examples and see this error: c:\Python33\Lib\site-packages\sdl2\examples>python draw.py Traceback (most recent call last): File "draw.py", line 10, in
wiygn
  • 61
  • 2
  • 5
4
votes
2 answers

RuntimeError for SDL2 after installing pySDL2

I installed pySDL2 0.4.1 by: Downloading the source package, entering python setup.py install. Then I tried to run the copypasted into PyDev eclipse "The Pong Game: Getting Started" tutorial code example: import os, sys try: …
Folaht
  • 849
  • 8
  • 27
3
votes
1 answer

How can I embed an SDL2 window in my Tkinter GUI application?

I'm trying to embed an SDL2 window into my Tkinter application, via pySDL2. How do I setup my pySDL2 window, renderer so that my rendering or drawing appears inside an embedded frame? Other examples have shown for pygame, but I've discovered that my…
3
votes
1 answer

My quick test indicates pygame is 100 times faster than pysdl2, whats going on?

So I have been making a game in pygame, but performance is horrible. After a lot of searching I discovered that pygame is built around SDL and that SDL2 has GPU support, so I wanted to see if using something SDL2 based would improve performance. In…
Basic Block
  • 543
  • 5
  • 14
3
votes
0 answers

sdl2 (pysdl2) without x11 using directFB or OpenGL ES

I am working on Debian based embedded systems that avoids the overhead of windowing systems by running graphics directly to the screen using FBCON (similar to DirectFB). This is common with Raspberry Pi screens and there are plenty of resources to…
TravisT
  • 141
  • 1
  • 6
3
votes
2 answers

Portable .so library for Linux

I am writing a Python app that works with graphics and depends on PySDL2 library. PySDL2 depends on compiled SDL2 binary library that can be downloaded from SDL site. I wrote a bootstrap script to automate the process, but it works only for Windows,…
anatoly techtonik
  • 17,421
  • 8
  • 111
  • 131
3
votes
2 answers

Catching joystick events with PySDL2

I'm playing with the new(ish) SDL2 wrapper for python, PySDL2, and I can't seem to see any joystick events popping up on the event queue. Keydown events are fine, and when I explicitly poll the joystick, I can get the axis state fine (and observe…
Mike Lawrence
  • 1,479
  • 5
  • 18
  • 40
3
votes
1 answer

Cython + ctypes?

We are currently using Cython to make bindings to some networking and DB libraries. We want also use SDL, but PySDL2 uses ctypes for binding. While Cython is whole interpreter, ctypes is just library. But, Cython and ctypes are most often portrayed…
Shadows In Rain
  • 985
  • 10
  • 27
2
votes
0 answers

How to write an SDL2 / OpenGL event loop

I'm writing a real-time interactive graphics application using SDL2 and OpenGL in Python (pysdl2, PyOpenGL). The application continuously produces frames, which may change in response to keyboard / mouse input or based on time. My main event loop,…
A. Donda
  • 7,941
  • 1
  • 17
  • 45
2
votes
1 answer

Resizing Window in Kivy Android App on softkeyboard with SDL2

I am currently working on an Android App using the Python and the Kivy Framework. The majority of the screen's real estate is used by a text_input widget. I would like to resize this text_input when the android soft keyboard pops ups so that the…
Just-Joe
  • 21
  • 1
1
2 3 4