Skip to content

r_vsync doesn't work #763

@feikname

Description

@feikname

Tested with OpenSpades 0.1.2 and latest master in Windows 10.

I still get 300+ fps even when r_vsync is set.

Relevant piece of code:

switch (rtype) {
case RendererType::GL:
sdlFlags = SDL_WINDOW_OPENGL;
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0);
SDL_GL_SetSwapInterval(r_vsync);
if (!r_allowSoftwareRendering)
SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);

"No OpenGL context has been made current" is returned by SDL_GetError() when I used the following code to debug this problem:

if (SDL_GL_SetSwapInterval(r_vsync) != 0) {
    SPRaise(SDL_GetError());
}

Perhaps SDL_GL_SetSwapInterval has to be called at a later time?

As a workaround, I'm using cl_fps to limit the FPS to the same as my screen refresh rate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsome feature is broken

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions