Skip to content

SDL_GetKeyboardState called every frame #69

Open
@nickenchev

Description

@nickenchev

Very minor detail.

The SDL documentation states the following: "The pointer returned is a pointer to an internal SDL array. It will be valid for the whole
lifetime of the application and should not be freed by the caller."
https://wiki.libsdl.org/SDL2/SDL_GetKeyboardState

This is very common as most SDL tutorials seem to want to call it every iteration of the game-loop, so the idea of having to constantly call it keeps getting propagated into every single SDL tutorial. If the SDL team decides to perform some more work in this function, I bet a whole bunch of SDL based applications would feel a performance hit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions