mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-25 16:54:24 +00:00
committed by
Sam Lantinga
parent
5a4f1cbceb
commit
ff2a43bfbf
@@ -245,7 +245,7 @@ static SDL_CameraFrameResult COREMEDIA_AcquireFrame(SDL_Camera *device, SDL_Surf
|
||||
if (device->position == SDL_CAMERA_POSITION_BACK_FACING) {
|
||||
static const Uint16 back_rotations[4][4] = {
|
||||
{ 90, 90, 90, 90 }, // ui portrait
|
||||
{ 270, 270, 270, 270 }, // ui portait upside down
|
||||
{ 270, 270, 270, 270 }, // ui portrait upside down
|
||||
{ 0, 0, 0, 0 }, // ui landscape left
|
||||
{ 180, 180, 180, 180 } // ui landscape right
|
||||
};
|
||||
@@ -253,7 +253,7 @@ static SDL_CameraFrameResult COREMEDIA_AcquireFrame(SDL_Camera *device, SDL_Surf
|
||||
} else {
|
||||
static const Uint16 front_rotations[4][4] = {
|
||||
{ 90, 90, 270, 270 }, // ui portrait
|
||||
{ 270, 270, 90, 90 }, // ui portait upside down
|
||||
{ 270, 270, 90, 90 }, // ui portrait upside down
|
||||
{ 0, 0, 180, 180 }, // ui landscape left
|
||||
{ 180, 180, 0, 0 } // ui landscape right
|
||||
};
|
||||
@@ -462,7 +462,7 @@ static bool COREMEDIA_OpenDevice(SDL_Camera *device, const SDL_CameraSpec *spec)
|
||||
// the device's accelerometer, so I assume this burns power, so we don't leave this running all
|
||||
// the time. These calls nest, so we just need to call the matching `end` message when we close.
|
||||
// You _can_ get an actual events through this mechanism, but we just want to be able to call
|
||||
// -[UIDevice orientation], which will update with real info while notificatons are enabled.
|
||||
// -[UIDevice orientation], which will update with real info while notifications are enabled.
|
||||
UIDevice *uidevice = [UIDevice currentDevice];
|
||||
[uidevice beginGeneratingDeviceOrientationNotifications];
|
||||
hidden.last_device_orientation = uidevice.orientation;
|
||||
|
||||
Reference in New Issue
Block a user