The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL_WINDOW_MAXIMIZED bug?
Alex


Joined: 19 Sep 2014
Posts: 35
I created a window with flag SDL_WINDOW_MAXIMIZED, like:
Code:
SDL_Window *win = SDL_CreateWindow("Test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 928, 928, SDL_WINDOW_MAXIMIZED | SDL_WINDOW_RESIZABLE);

When I call SDL_RenderCopy(renderer, texture, NULL, NULL), I see strange result:
1. It copy only a part of a texture (looks like 928 x 928 in size). My texture is bigger in size than the window.
2. Copied image is not resized to window size. The size of image is only a part of window area with black space at top and at right of an image.
3. Copied image started by y-coordinate not from 0, but from 15. I see black space above image 14 pixels in height. Looks like an image aligned to bottom-left corner of a window, but not to top-left.

This tested on Linux (Ubuntu) with Mate desktop, my screen size is 1280 x 1024.
Is it a bug or I am doing something wrong?
SDL_WINDOW_MAXIMIZED bug?
Rainer Deyke
Guest

On 17.12.2014 17:59, Alex wrote:
Quote:
I created a window with flag SDL_WINDOW_MAXIMIZED, like: Code:
SDL_Window *win = SDL_CreateWindow("Test", SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED, 928, 928, SDL_WINDOW_MAXIMIZED |
SDL_WINDOW_RESIZABLE);


When I call SDL_RenderCopy(renderer, texture, NULL, NULL), I see
strange result: 1. It copy only a part of a texture (looks like 928 x
928 in size). My texture is bigger in size than the window. 2. Copied
image is not resized to window size. The size of image is only a part
of window area with black space at top and at right of an image. 3.
Copied image started by y-coordinate not from 0, but from 15. I see
black space above image 14 pixels in height. Looks like an image
aligned to bottom-left corner of a window, but not to top-left.

This tested on Linux (Ubuntu) with Mate desktop, my screen size is
1280 x 1024. Is it a bug or I am doing something wrong?

SDL_WINDOW_MAXIMIZED under Linux/X11 seems to be somewhere between
"buggy" and "flat-out not implemented". See
https://bugzilla.libsdl.org/show_bug.cgi?id=2793 for example. I've been
meaning to take a closer look at it, but I want bug 2793 resolved one
way or another before I start working on any more patches.


--
Rainer Deyke

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org