| Summary: | SDL_VIDEO_WINDOW_POS, Mac OS X, OpenGL | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ryan C. Gordon <icculus> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | renesd |
| Version: | 1.2.13 | Keywords: | target-1.2.14 |
| Hardware: | PowerPC | ||
| OS: | Mac OS X (All) | ||
| Attachments: | Reproduction case. | ||
Created attachment 280 [details]
Reproduction case.
Attached a test program that illustrates this. The whole window should be red, but just a corner is, due to the incorrect scissoring.
To compile:
gcc -Wall -O0 -g -o test SDL-test-broken-window-position-opengl.c `sdl-config --cflags --libs` -framework OpenGL
--ryan.
(Actually, this isn't just the viewport and scissor, it also becomes the mouse area...you get SDL_APPMOUSEFOCUS events as you move in and out of that viewport.) --ryan. hi, it seems that SDL_VIDEO_WINDOW_POS doesn't work on OSX. If I move it off the x coordinate, then shows white screen on the left side of the window by the same amount. This is with x=300, y=0 for example -- there is white on the window for 300 pixels across. Moving it on the y axis I get a bus error. with last stable... SDL 1.2.13, OSX 10.5.7 Tested with pygame 1.9.0pre. hi again, It looks like the parent window isn't moved with the main SDL window. The bus error crashes with SDL_FillRect if I change the y coordinate. This is the file where SDL_VIDEO_WINDOW_POS is inspected... src/video/quartz/SDL_QuartzVideo.m It looks like the patch addresses it using some carbon calls: http://www.nabble.com/-patch--OS-X-carbon-SDL_WINDOWID-support-td6457591.html Haven't tried the patch though. export SDL_VIDEO_WINDOW_POS="0,0" works ok, since then the parent window doesn't need to be modified... as it starts off at 0,0 by default. ps. SDL_VIDEO_CENTERED=1 works fine. Tagging this bug with "target-1.2.14" so we can try to resolve it for SDL 1.2.14. Please note that we may choose to resolve it as WONTFIX. This tag is largely so we have a comprehensive wishlist of bugs to examine for 1.2.14 (and so we can close bugs that we'll never fix, rather than have them live forever in Bugzilla). --ryan. Fixed in svn revision #4890. --ryan. |
If you try to force the window position with the SDL_VIDEO_WINDOW_POS environment variable, the Quartz backend will incorrectly set the GL viewport and scissor inside a Cocoa call. Running this under OpenGL Profiler and setting a breakpoint on glScissor shows us this is the culprit: [ gl_context setView: window_view ]; ...in QZ_SetVideoWindowed(). --ryan.