Closed carlo-bramini closed 3 years ago
Patches are welcome.
It appears that the code for this in the windib
video driver is disabled when targeting Windows CE versions older than 4.2.
https://github.com/libsdl-org/SDL-1.2/blob/main/src/video/windib/SDL_dibvideo.c#L695
Alternatively, the gapi
driver looks like it would handle screen rotation.
It appears that the code for this in the
windib
video driver is disabled when targeting Windows CE versions older than 4.2.
Talking about the windib driver, probably there is a bug in this line:
https://github.com/libsdl-org/SDL-1.2/blob/main/src/video/windib/SDL_dibvideo.c#L362
Correct way for handling the detection of the feature should be:
if (ChangeDisplaySettingsEx(NULL, &settings, NULL, CDS_TEST, NULL) == DISP_CHANGE_SUCCESSFUL)
this->hidden->supportRotation = (settings.dmDisplayOrientation != DMDO_0);
If you tested it well, please send a pull request for it. (Also, do you not need an else
case in there?)
If you tested it well, please send a pull request for it. (Also, do you not need an
else
case in there?)
There is an SDL_memset()
inside DIB_CreateDevice()
that clears the structure, so I thought that adding also an "else" statement was not strictly required, but it can be added if it improves the readability of the code if someone wants.
There is an
SDL_memset()
insideDIB_CreateDevice()
that clears the structure, so I thought that adding also an "else" statement was not strictly required
OK
After some debugging, I think that I have discovered the causes of the problem: 1) actually, the GAPI driver was missing in my build because it must be explicitely activated with --enable-gapi option to configure. By reversing width and height dimensions, you are able to display graphics in portrait. This has been tested on a real device with Windows Mobile 2003. 2) So, the windib driver was the only one that I was using. The rotation made with ChangeDisplaySettingsEx() is not supported in both the emulator and on my ASUS MyPal A620, but because the bug that I described in a previous comment, libSDL thinks that the device is able to do it. As result, it registers also the 320x240 resolution in addition to 240x320 and that's why I'm getting the output the you can see in my screenshot. PR #848 fixes this issue.
Fixed by PR #848
From README.Wince, we can read this information:
However, this does not seem to be true, at least with the source into the repo at the time of writing. Making
Width > Height
does not rotate the screen. I don't know if:...but at the moment the library does not change from portrait to landscape when you follow the instructions written into the readme file. Instead, if you create a 320x240 screen on a 240x320 device, it simply overflows the space on the display.