Giter Club home page Giter Club logo

Comments (4)

HexDecimal avatar HexDecimal commented on June 14, 2024

This is normal behavior for SDL-based programs. Event polling is how your program tells Windows that your app isn't hanging.

SDL has SDL_PumpEvents which lets you keep the window awake without needing to handle the events immediately. You can call this function from tcod using tcod.lib.SDL_PumpEvents().

from python-tcod.

HexDecimal avatar HexDecimal commented on June 14, 2024

There isn't much more to add. A program does need to check events at least to respond to quit events and other windowing events. SDL_PumpEvents causes important side-effects so I won't add it to non-event functions.

A main loop without event polling might be considered invalid. Something like a long loading screen might use SDL_PumpEvents or it might check events normally for its duration. What example do you have for a program which doesn't check events?

from python-tcod.

UcyElak avatar UcyElak commented on June 14, 2024

Hi, HexDec
I'm working on the first demo, so there is no event handle function yet. I agree that it at least need to respond for quit, and maybe I have to learn more on SDL to work better with tcod. XD
Thanks for your help!

from python-tcod.

HexDecimal avatar HexDecimal commented on June 14, 2024

No problem. Keeping the event loop from the getting started examples should be enough. You only need to replace tcod.event.wait with tcod.event.get.

from python-tcod.

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.