Skip to content

Commit

Permalink
Merge pull request #118 from pfontain/tutorial-setup-graphics-api-text
Browse files Browse the repository at this point in the history
Reword Setup Graphics API checks text
  • Loading branch information
rbessems authored Feb 14, 2024
2 parents 758faf1 + 314b7bd commit fa4f9d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tutorial/2-setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ You can now run the application to check that you have a valid :openxr_ref:`XrIn

The next major component of OpenXR that needs to be created is an :openxr_ref:`XrSession`. An :openxr_ref:`XrSession` encapsulates the state of the application from the perspective of OpenXR. When an :openxr_ref:`XrSession` is created, it starts in the :openxr_ref:`XrSessionState` ``XR_SESSION_STATE_IDLE``. It is up to the runtime to provide any updates to the :openxr_ref:`XrSessionState` and for the application to query them and react to them. We will explore this in :ref:`Chapter 2.3<2.3 Polling the Event Loop>`.

For now, we are just going to create an :openxr_ref:`XrSession`. At this point, you'll need to select which Graphics API you wish to use. Only one Graphics API can be used with an :openxr_ref:`XrSession`. This tutorial demonstrates how to use D3D11, D3D12, OpenGL, OpenGL ES and Vulkan in conjunction with OpenXR to render graphics to the provided views. Ultimately, you will most likely be bringing your own rendering solution to this tutorial, therefore the code examples provided for the Graphics APIs are `placeholders` for your own code base; demonstrating in this sub-chapter what objects are needed from your Graphics API to create an :openxr_ref:`XrSession`. This tutorial uses polymorphic classes; ``GraphicsAPI_...`` derives from the base ``GraphicsAPI`` class. There are both compile and runtime checks to select the requested Graphics API, and we construct an appropriate derived class through the use of ``std::unique_ptr<>``.
For now, we are just going to create an :openxr_ref:`XrSession`. At this point, you'll need to select which Graphics API you wish to use. Only one Graphics API can be used with an :openxr_ref:`XrSession`. This tutorial demonstrates how to use D3D11, D3D12, OpenGL, OpenGL ES and Vulkan in conjunction with OpenXR to render graphics to the provided views. Ultimately, you will most likely be bringing your own rendering solution to this tutorial, therefore the code examples provided for the Graphics APIs are `placeholders` for your own code base; demonstrating in this sub-chapter what objects are needed from your Graphics API to create an :openxr_ref:`XrSession`. At compile time the Graphics API is selected and the macro XR_TUTORIAL_GRAPHICS_API is set accordingly. At runtime, in CheckGraphicsAPI_TypeIsValidForPlatform, we double check that the Graphics API is supported in the current platform. This tutorial uses polymorphic classes; ``GraphicsAPI_...`` derives from the base ``GraphicsAPI`` class. We construct an appropriate derived class through the use of ``std::unique_ptr<>``.


Update the constructor of the ``OpenXRTutorial`` class, the ``OpenXRTutorial::Run()`` method, and add the definitions of the new methods and data members to their separate private sections. All the new code is highlighted below.

Expand Down

0 comments on commit fa4f9d4

Please sign in to comment.