| Summary: | SDL_SetRelativeMouseMode is slow | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Guillaume Payet <payetguillaume2008> |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED INVALID | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | gabomdq |
| Version: | 2.0.1 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 8 | ||
|
Description
Guillaume Payet
2014-02-19 00:45:26 UTC
Can you show us what your main loop looks like? If I comment out all drawings and processing, the minimal loop where I can still experience lag is:
do
{
SDL_PollEvent(event);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glFlush();
SDL_GL_SwapWindow(SDL_GL_GetCurrentWindow());
}
while (event->type == SDL_KEYDOWN && event->key.keysym.sym == SDLK_ESCAPE);
You should poll all events until the queue is empty, then run your render code (specially SDL_GL_SwapWindow, since it can get "stuck" waiting for the vertical retrace). If after making this change you still get laggy behavior, feel free to reopen. It works. Thanks |