Comments on: VR Window Sample https:/code-sample/vr-window-sample/ Developer resources for the X-Plane flight simulator Thu, 07 May 2020 20:20:05 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: Raphael Stadler https:/code-sample/vr-window-sample/#comment-34403 Tue, 22 Oct 2019 15:52:08 +0000 http://developer.x-plane.com/?post_type=code-sample&p=8345#comment-34403 In reply to Tyler Young.

Thanks for your suggestion. I already found my problem. It was kind a dumb mistake but now it is fixed 🙂
Thanks Tyler!

]]>
By: Tyler Young https:/code-sample/vr-window-sample/#comment-34402 Tue, 22 Oct 2019 15:05:25 +0000 http://developer.x-plane.com/?post_type=code-sample&p=8345#comment-34402 In reply to Raphael Stadler.

What about if you pop your window out (see the window API sample, specifically the call to XPLMSetWindowPositioningMode(in_window_id, xplm_WindowPopOut, 0))? My hypothesis here is that your code isn’t drawing correctly with respect to the window bounds; popping the window out will change the coordinate space for drawing in a similar way to VR.

If popping the window out works okay, I’d say get me a minimal reproducible example plugin that has this issue and I can look into it. (You can either post it here, or email me at my first name at X-Plane.com.)

]]>
By: Raphael Stadler https:/code-sample/vr-window-sample/#comment-34398 Mon, 21 Oct 2019 16:08:16 +0000 http://developer.x-plane.com/?post_type=code-sample&p=8345#comment-34398 In reply to Tyler Young.

I added a function called “draw_HMD” and called it inside the “draw” function. So it should be in the callback.
When it still is on my monitor (before pressing Toggle VR), my speed is shown correctly and is refreshed each gametick.

]]>
By: Tyler Young https:/code-sample/vr-window-sample/#comment-34397 Mon, 21 Oct 2019 14:16:59 +0000 http://developer.x-plane.com/?post_type=code-sample&p=8345#comment-34397 In reply to Raphael Stadler.

This drawing is taking place from within a window’s draw callback?

]]>
By: Raphael Stadler https:/code-sample/vr-window-sample/#comment-34396 Mon, 21 Oct 2019 13:59:45 +0000 http://developer.x-plane.com/?post_type=code-sample&p=8345#comment-34396 I’ve got a problem: I already made a HUD via OpenGL. It works fine on the monitor. Now I’m trying to implement it as a HMD for VR.
I used this sample code and the window worked fine on VR. Ben Sputnik wrote that any valid OpenGL drawing technique will work, but I can’t see my drawings of my HMD (same Code as the HUD).
I can see my drawing on my monitor when I’m not able to see the window in VR. (Toggle VR)
Any suggestions?

]]>
By: Tyler Young https:/code-sample/vr-window-sample/#comment-33333 Wed, 20 Mar 2019 17:16:02 +0000 http://developer.x-plane.com/?post_type=code-sample&p=8345#comment-33333 In reply to Peter Bond.

Widget windows can be opted in to “modern” windowing features like support for UI scaling and being popped out into a native OS window (see this note). But if you’re asking about styling windows to match X-Plane 11 text, buttons, etc., we don’t have a good solution right now. The backstory here is: between X-Plane 10 and 11, the back-end infrastructure for our internal GUI framework changed entirely, in a way that no longer matches the public widgets API at all. So long term, we need to either:

  • deprecate the existing API and create an entirely new one that more closely aligns with the internal GUI framework, or
  • bbbbbasically back-port all our new GUI components to the old system.

The cost for either is measured in months of dev time, and we just haven’t had the resources to devote to it yet. :/

]]>
By: Peter Bond https:/code-sample/vr-window-sample/#comment-33332 Wed, 20 Mar 2019 16:25:40 +0000 http://developer.x-plane.com/?post_type=code-sample&p=8345#comment-33332 In reply to Ben Supnik.

Thanks for the reply. I noticed that the Widgets API does not include the current, modern GUI elements (or maybe I did something wrong). Is it planned to expose those via the Widgets API at any time in future?

]]>
By: Ben Supnik https:/code-sample/vr-window-sample/#comment-33328 Tue, 19 Mar 2019 20:30:00 +0000 http://developer.x-plane.com/?post_type=code-sample&p=8345#comment-33328 In reply to Peter Bond.

You can use any valid OpenGL drawing technique you want. The point of the example is to show you how to interact with X-Plane, _not_ to teach you how to use OpenGL. The OpenGL code shown isn’t even useful, it is meant to prove that user-based drawing is working with a minimal sample.

]]>
By: Peter Bond https:/code-sample/vr-window-sample/#comment-33327 Tue, 19 Mar 2019 15:45:58 +0000 http://developer.x-plane.com/?post_type=code-sample&p=8345#comment-33327 I am seriously confused. This seems to be the latest example, dated late 2018, yet it uses OpenGL commands like “glBegin” and “glEnd” from the early 90s who have become obsolete since programmable shaders have been introduced, around 2008.
Is this really the way we are supposed to draw GUIs in Xplane?

]]>