Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display mode in full screen is always set at desktop resolution #915

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

Display mode in full screen is always set at desktop resolution #915

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Labels
invalid This doesn't seem right

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.0
Reported for operating system, platform: Linux, x86_64

Comments on the original bug report:

On 2013-06-09 15:53:38 +0000, Alejandro Ricoveri wrote:

Hi everyone. First of all I want to congratulated for such an amazing job you're doing.

After not being able to get any success on discussing this matter on the SDL IRC channel, I've come with the conclusion than the following is a potential bug that I might found in SDL2.

The behavior has been isolated as this:

  • In any case, when it comes to setup full screen mode at a determined resolution, apparently gets ignored and its set always at desktop resolution (doing a SDL_GetWindowDisplayMode after setting up the full screen has confirmed the issue to me).
  • I've not only tried with SDL_CreateWindow, it also fails by other methods like SDL_GetClosestDisplayMode + SDL_SetWindowDisplayMode, it's the same behavior, video mode gets stalled at desktop resolution (which in my case is 1366x768).

My system is this:
Ubuntu 13.04 x86_64
uname: Linux marion 3.8.0-19-generic # 29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Part of my glxinfo (no extensions and no visuals):
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
server glx extensions:
client glx vendor string: NVIDIA Corporation
client glx version string: 1.4
GLX version: 1.4
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce 8600 GT/PCIe/SSE2
OpenGL version string: 3.3.0 NVIDIA 310.44
OpenGL shading language version string: 3.30 NVIDIA via Cg compiler

I've made a small isolated test case for this, and it fails. I've made the tests with both 2.0RC1 and latest 'default' branch snapshot:

/*

  • Full screen display mode test case
    */
    #include <SDL2/SDL.h>
    #include <GL/gl.h>
    #define WIDTH 640
    #define HEIGHT 480

int
main (int argc, char *argv[])
{
SDL_Window *window; // window
SDL_DisplayMode mode; // display mode
int i = 400;

/* Boot up */
SDL_Init (SDL_INIT_VIDEO);

/* GL setup */
SDL_GL_SetAttribute ( SDL_GL_RED_SIZE, 8 );
SDL_GL_SetAttribute ( SDL_GL_GREEN_SIZE, 8 );
SDL_GL_SetAttribute ( SDL_GL_BLUE_SIZE, 8 );
SDL_GL_SetAttribute ( SDL_GL_DEPTH_SIZE, 24 );
SDL_GL_SetAttribute ( SDL_GL_DOUBLEBUFFER, 1 );
SDL_GL_SetAttribute ( SDL_GL_STENCIL_SIZE, 8 );

/* Create a window */
window = SDL_CreateWindow ("Test case", 0, 0,
WIDTH, HEIGHT, SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN | SDL_WINDOW_SHOWN );

/* Set up OpenGL context */
SDL_GL_CreateContext ( window );

/* Query the actual display mode */
SDL_GetWindowDisplayMode (window, &mode);

/* Let's see about that */
if (mode.w != WIDTH || mode.h != HEIGHT) {
printf ("Le voila!. Display mode is different from what I expected!.\n");
return -1;
}

/* See some red if everything was OK */
glClearColor (1.0, 0.0, 0.0, 0.0);
while (--i)
glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

/* Tear down */
SDL_Quit ();
return 0;
}

I'll dig through the code to see if I may do something about it. I'll do everything I can.

Thank you in advance.

My regards.
Alejandro

On 2013-06-09 16:00:23 +0000, Alejandro Ricoveri wrote:

Created attachment 1186
Display mode test case

On 2013-06-09 16:11:30 +0000, Alejandro Ricoveri wrote:

After doing a Xephyr session over Mesa GLX with my project, I've isolated even more the issue. Apparently, it only happens nvidia-glx. I need to confirm this someone else.

On 2013-06-09 21:34:54 +0000, Alejandro Ricoveri wrote:

Update: It is not strictly happen on nvidia-glx, the test case also failed on a machine with Mesa 9.1 Gallium 0.4 on ATI RS480. So yeah, it's likely to be a SDL2 bug.

On 2013-06-13 09:43:45 +0000, Gabriel Jacobo wrote:

What's the xrandr -q output for your system/s?

On 2013-06-14 13:30:52 +0000, Alejandro Ricoveri wrote:

This is xrandr -q for my Ubuntu box in my office

alejandro@stonemedia:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 13.04
Release: 13.04
Codename: raring

alejandro@stonemedia:~$ xrandr -q
Screen 0: minimum 320 x 200, current 1366 x 768, maximum 32767 x 32767
VGA1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 410mm x 230mm
1366x768 59.8*+
1280x720 60.0
1024x768 75.1 70.1 60.0
832x624 74.6
800x600 72.2 75.0 60.3 56.2
640x480 72.8 75.0 66.7 60.0
720x400 70.1

On 2013-06-14 17:17:42 +0000, Alejandro Ricoveri wrote:

Newsflash: At least on Ubuntu: test case is passing when X11_SHARED is set off, it works just dandy. I will evaluate this further.

On 2013-07-06 16:26:30 +0000, Gabriel Jacobo wrote:

Any updates on this? I was just testing the behavior using testrendercopyex for a different bug and this seemed to work fine.

On 2014-02-26 10:08:36 +0000, Gabriel Jacobo wrote:

This is probably a configure issue on the build system. Feel free to reopen if the problem resurfaces.

@SDLBugzilla SDLBugzilla added bug invalid This doesn't seem right labels Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant