SDL 2.0 fullscreen mode won't work?

Ee4b169a069ef358df51a571abc035cf
0
SteveDeFacto 101 Aug 13, 2012 at 15:28

When I try to go full screen the resolution changes but that is about it. The window border still shows and when I exist my application my desktop is still in that resolution. Is this because SDL 2.0 is not finished or do I have to do something else to make my window expand to fullscreen / manually exit fullscreen?

EDIT: Probably need to give more information. I’m using Ubuntu 12.04 and I’ve tried many things to fix the problem but nothing seems to work. I noticed that when the resolution of my desktop is already set to the resolution of the window the window will properly expand to fullscreen. Here is my how I create the window:

    SDL_Init(SDL_INIT_VIDEO);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
    SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
    SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
    SDL_Window* window = SDL_CreateWindow("ContextWindow", 0, 0, 1024, 768, SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN);

1 Reply

Please log in or register to post a reply.

B18fd419eb473dffaff6a66110512816
0
AgentC 101 Oct 21, 2012 at 19:19

You could try adding SDL_WINDOW_BORDERLESS to the flags. Also make sure you’re using the latest head revision from the Mercurial repository. SDL 2.0 is certainly a work in progress; I remember they committed just recently some fixes to Linux fullscreen mode. As far as I’m aware SDL 2.0 is trying to be friendlier with the window managers and their various extensions, however that also makes fullscreen mode setup more errorprone.