Forum Discussion
LastBlow
11 years agoProtege
Window position...
Hey, hey, hey! In SDK 0.4, I believe, ovrHmd used to have WindowsPos as a member.
Resolution apparently remained as a member and gives the size of the window.
Only, how to access the position of a window in SDK 0.6?
Please, see code here below, thank you! ;-)
if (debug == false)
{
x = hmd->WindowsPos.x;
y = hmd->WindowsPos.y;
flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
}
int w = hmd->Resolution.w;
int h = hmd->Resolution.h;
Resolution apparently remained as a member and gives the size of the window.
Only, how to access the position of a window in SDK 0.6?
Please, see code here below, thank you! ;-)
if (debug == false)
{
x = hmd->WindowsPos.x;
y = hmd->WindowsPos.y;
flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
}
int w = hmd->Resolution.w;
int h = hmd->Resolution.h;
2 Replies
- MatlockHonored GuestIf you have the hwnd, you can use the windows function
RECT rect;
GetWindowRect(hwnd, &rect); - jhericoAdventurer
"LastBlow" wrote:
int w = hmd->Resolution.w;
int h = hmd->Resolution.h;
Technically this code is incorrect. hmd->Resolution gives you the native resolution of the display, not the actual resolution it's currently running at. If you're running in extended mode it's possible to set the headset to pretty much any resolution you like, so in 0.4 you should really be querying the platform for the resolution of the Rift monitor once you have it. Of course, almost no one runs the HMD in anything other than 1920x1080, so it doesn't really matter, and in SDK 0.6 it's a moot point as there's no way to identify which monitor is the Rift or even if it's in extended mode."LastBlow" wrote:
Hey, hey, hey! In SDK 0.4, I believe, ovrHmd used to have WindowsPos as a member.
Resolution apparently remained as a member and gives the size of the window.
Only, how to access the position of a window in SDK 0.6?
You don't. In 0.6, regardless of whether you're running in extended or direct mode, the SDK itself creates the Rift output surface. You're only responsible for any non-Rift windows, so you don't have any need for the Rift position (which is only valid if the user is running in extended mode anyway).
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device