15 #ifndef FPLBASE_RENDERER_HMD_H
16 #define FPLBASE_RENDERER_HMD_H
18 #include "fplbase/config.h"
22 #include "mathfu/glsl_mappings.h"
57 #if FPLBASE_ANDROID_VR
65 void HeadMountedDisplayRenderStart(
66 const HeadMountedDisplayInput& head_mounted_display_input,
67 Renderer* renderer,
const mathfu::vec4& clear_color,
bool use_undistortion,
74 void HeadMountedDisplayRenderEnd(
Renderer* renderer,
bool use_undistortion);
90 template <
typename RenderCallback>
91 void HeadMountedDisplayRender(
const InputSystem* input_system,
93 const mathfu::vec4& clear_color,
94 RenderCallback render_callback,
95 bool use_undistortion) {
97 HeadMountedDisplayRenderStart(input_system->head_mounted_display_input(),
98 renderer, clear_color, use_undistortion,
102 HeadMountedDisplayRenderEnd(renderer, use_undistortion);
118 template <
typename RenderCallback>
119 void HeadMountedDisplayRender(
const InputSystem* input_system,
121 const mathfu::vec4& clear_color,
122 RenderCallback render_callback) {
123 HeadMountedDisplayRender(input_system, renderer, clear_color, render_callback,
127 #endif // FPLBASE_ANDROID_VR
132 #endif // FPLBASE_RENDERER_CARDBOARD_H
void SetCardboardButtonEnabled(bool enabled)
Called to set whether the Cardboard settings button (gear icon) is enabled and rendering.
mathfu::vec4i viewport_extents[2]
Extents of each viewport.
Definition: renderer_hmd.h:52
void InitializeUndistortFramebuffer(int width, int height)
Initializes the framebuffer needed for Head Mounted Display undistortion.
void BeginUndistortFramebuffer()
Called before rendering for HMD to set up the framebuffer.
Dimensions and transforms for viewport when using stereoscopic rendering.
Definition: renderer_hmd.h:50
mathfu::mat4 viewport_transforms[2]
Transformation matrix for each viewport.
Definition: renderer_hmd.h:54
void FinishUndistortFramebuffer()
Called when finished with rendering for HMD, to undistort and render the result.
Renderer is the main API class for rendering commands.
Definition: renderer.h:310