Comments (4)
Original comment by Brett Calcott (Bitbucket: bcalcott, GitHub: Unknown):
Apologies for taking so long to respond -- work overwhelm. I'm only using python for sdl2, so haven't had the chance to see if it happens elsewhere. Is there any easily installable test suites that are explicitly multi-platform?
I've know I've seen this kind of flickering before when double-buffering was turned off. ie it looks as though I'm seeing a refresh of the image on-screen BEFORE the drawing is done. But I have no ideas double buffering works in sdl2.
This was all I could find:
http://www.dreamincode.net/forums/topic/327673-sdl2-rendering/
from py-sdl2.
Original comment by Marcus von Appen (Bitbucket: marcusva, GitHub: marcusva):
Were you able verify, if this also happens in a similar non-Python example?
from py-sdl2.
Original comment by Marcus von Appen (Bitbucket: marcusva, GitHub: marcusva):
Changing the context as provided in your example snippet will cause artifacts to appear on other platforms, such as Windows and X11, especially, when the window is moved or another window overlaps the example window.
This could be fixed with adding several checks for events (raising the window, movements, resize, etc.), but would defeat the purpose of the examples of being simple.
Does the problem occur in similar C examples, too? Do you have any chance to check this?
from py-sdl2.
I've sort of fixed this in the latest commit, by tweaking the demo to behave the same as the gui.py
demo does: that is, default to software rendering (which doesn't have the issue) but allow hardware rendering by passing the -hardware
flag to the script. I also enabled vsync for hardware rendering, which seemed to improve (but not fix) the issue on my Mac.
During my searches I found a lot of people talking about flicker issues using SDL2 Renderers with the OpenGL back-end, most of which were using SDL2 with C directly, so I'm going to assume this is a low-level SDL2 problem rather than a py-sdl2 problem. Oddly enough, the example renders perfectly fine with the OpenGL backend in a Mojave VM on my desktop, so it might have to do with differences in the quality of macOS OpenGL drivers for different graphics cards. Also, only certain SDL2_gfx drawing functions seem to set it off: for example, I don't get any flicker when drawing a scene using only sdlgfx.lineColor()
, but if I add sdlgfx.thickLineColor()
or sdlgfx.aalineColor()
the flicker problem appears.
Anyway, since this doesn't seem to be py-sdl2's fault and the new defaults for the example eliminate the issue, I think it's fair to close this.
from py-sdl2.
Related Issues (20)
- [Question] How to use sdl2.SDL_RenderGeometry HOT 1
- pysdl2 gfx not working in termux HOT 4
- Problem with SDL_GL_GetProcAddress() HOT 5
- Render._get_render_drivers() not working correctly
- Units test fail on big-endian architecture HOT 13
- Unit test expects SDL version to stay 2.0.x forever HOT 4
- Handling Resize of Images / Resize of Window with SpriteFactory/Renderer HOT 3
- SDL_TICKS_PASSED doesn't handle wraparound HOT 1
- Unable to set framerate with using the FPSManager HOT 2
- ValueError: NULL pointer access while running the test suite HOT 16
- test_Mix_MusicDuration failure: assert 0.2 < 0.1501... HOT 1
- Unit tests fail with SDL git main (2.25.x)
- How to convert SDL_Surface to pygame.Surface? HOT 3
- Accessing the original ctypes function pointers broke again HOT 2
- Incorrect use of SDL_GetError() to check whether calls failed HOT 6
- TTF_WRAPPED_ALIGN_* is not defined bug HOT 1
- How to delete UserWarning: Using SDL2 binaries from pysdl2-dll 2.28.0 HOT 6
- Window icon and title are not set properly HOT 5
- SDL_gfx: Circle radius greater than 1023 results in deformation HOT 1
- Events (keyboard kew presses) missing when running app in Debian minimum (console only, no X window manager) HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py-sdl2.