Distortion Renderer

This module renders the eyes textures into the display.

Summary

Important: This module functions must be called from the render thread.

Functions

CardboardDistortionRenderer_create()
Creates a new distortion renderer object.
CardboardDistortionRenderer_destroy(CardboardDistortionRenderer *renderer)
void
Destroys and releases memory used by the provided distortion renderer object.
CardboardDistortionRenderer_renderEyeToDisplay(CardboardDistortionRenderer *renderer, int target_display, int x, int y, int width, int height, const CardboardEyeTextureDescription *left_eye, const CardboardEyeTextureDescription *right_eye)
void
Renders eye textures to a rectangle in the display.
CardboardDistortionRenderer_setMesh(CardboardDistortionRenderer *renderer, const CardboardMesh *mesh, CardboardEye eye)
void
Sets Distortion Mesh for a particular eye.

Functions

CardboardDistortionRenderer_create

CardboardDistortionRenderer * CardboardDistortionRenderer_create()

Creates a new distortion renderer object.

Must be called from render thread.

Details
Returns
Distortion renderer object pointer

CardboardDistortionRenderer_destroy

void CardboardDistortionRenderer_destroy(
  CardboardDistortionRenderer *renderer
)

Destroys and releases memory used by the provided distortion renderer object.

Must be called from render thread.

Details
Parameters
renderer
Distortion renderer object pointer.

CardboardDistortionRenderer_renderEyeToDisplay

void CardboardDistortionRenderer_renderEyeToDisplay(
  CardboardDistortionRenderer *renderer,
  int target_display,
  int x,
  int y,
  int width,
  int height,
  const CardboardEyeTextureDescription *left_eye,
  const CardboardEyeTextureDescription *right_eye
)

Renders eye textures to a rectangle in the display.

Must be called from render thread.

Details
Parameters
renderer
Distortion renderer object pointer.
target_display
Target display.
x
x coordinate of the rectangle's lower left corner in pixels.
y
y coordinate of the rectangle's lower left corner in pixels.
width
Size in pixels of the rectangle's width.
height
Size in pixels of the rectangle's height.
left_eye
Left eye texture description.
right_eye
Right eye texture description.

CardboardDistortionRenderer_setMesh

void CardboardDistortionRenderer_setMesh(
  CardboardDistortionRenderer *renderer,
  const CardboardMesh *mesh,
  CardboardEye eye
)

Sets Distortion Mesh for a particular eye.

Must be called from render thread.

Details
Parameters
renderer
Distortion renderer object pointer.
mesh
Distortion mesh.
eye
Desired eye.