Giter VIP home page Giter VIP logo

Comments (4)

marcusva avatar marcusva commented on June 2, 2024

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.

marcusva avatar marcusva commented on June 2, 2024

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.

marcusva avatar marcusva commented on June 2, 2024

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.

a-hurst avatar a-hurst commented on June 2, 2024

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)

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.