A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/vr/reference/android/com/google/vr/ndk/base/SwapChain below:

SwapChain | Google VR | Google for Developers

SwapChain

Stay organized with collections Save and categorize content based on your preferences.

Swap chain that contains some number of frames. Frames in the swap chain can be unused, in the process of being distorted and presented on the screen, or acquired and being rendered to by the application. The swap chain ensures that the most recent available frame is always shown and that the application never has to wait to render the next frame.

Public Methods Frame int getBufferCount

()

Gets the number of buffers in each frame of the swap chain.

void getBufferSize

(int bufferIndex,

Point

sizeOut)

Retrieves the size of the specified pixel buffer.

void resizeBuffer

(int bufferIndex,

Point

newSize)

Resizes the specified pixel buffer to the given size.

void Inherited Methods From class java.lang.Object boolean final Class<?>

getClass()

int

hashCode()

final void

notify()

final void

notifyAll()

String

toString()

final void

wait(long arg0, int arg1)

final void

wait(long arg0)

final void

wait()

Public Methods public Frame acquireFrame ()

Acquires a Frame from the swap chain for rendering.

Buffers that are part of the frame can then be bound with bindBuffer(int). Once the frame is finished and all its constituent buffers are ready, call submit(BufferViewportList, float[]) to display it while applying lens distortion.

Note: If frame submission is asynchronous, e.g., when async reprojection is enabled, it's possible that no free frames will be available for acquisition. Under such circumstances, this method will fail and return null. The client should re-attempt acquisition after a reasonable delay, e.g., several milliseconds.

Note: Please make sure that the GL context from initializeGl() is current when this method is called, or that it lives in a share group with the initialization context.

Returns public int getBufferCount ()

Gets the number of buffers in each frame of the swap chain.

public void getBufferSize (int bufferIndex, Point sizeOut)

Retrieves the size of the specified pixel buffer.

Note: If the buffer was resized while the current frame was acquired, the return value will be different than the value obtained from the equivalent function for the current frame.

Parameters bufferIndex Index of the buffer. sizeOut The (output) dimensions of the specified buffer. public void resizeBuffer (int bufferIndex, Point newSize)

Resizes the specified pixel buffer to the given size.

The frames are resized when they are unused, so the currently acquired frame will not be resized immediately.

Parameters bufferIndex Index of the buffer. newSize The new size for the specified buffer. public void shutdown ()

Destroys the swap chain. The SwapChain instance should not be used after this call.

All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-10-09 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["`SwapChain` manages frames for VR rendering, ensuring smooth transitions and minimizing wait times for the application."],["It provides methods to acquire, resize, and submit frames for display, along with managing buffer sizes."],["`acquireFrame()` can return null if no frames are readily available, especially with asynchronous reprojection enabled."],["`resizeBuffer()` changes the size of the buffer in the swapchain, affecting subsequently acquired frames but not the currently used one."],["Developers must call `shutdown()` to destroy the `SwapChain` instance before discarding it, preventing resource leaks."]]],["The `SwapChain` class manages frames for rendering, ensuring the latest frame is displayed without application wait times. Key actions include: `acquireFrame()` to get a frame for rendering, potentially returning null if no frames are free; `getBufferCount()` to check the number of buffers; `getBufferSize()` to retrieve a buffer's size; and `resizeBuffer()` to change a buffer's dimensions. Finally, `shutdown()` destroys the swap chain, after which the instance shouldn't be used.\n"]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4