libnx
v4.7.0
|
Native window (NWindow) wrapper object, used for presenting images to the display (or other sinks). More...
#include "../kernel/mutex.h"
#include "../kernel/event.h"
#include "../services/vi.h"
#include "../nvidia/graphic_buffer.h"
#include "types.h"
#include "binder.h"
#include "buffer_producer.h"
Go to the source code of this file.
Data Structures | |
struct | NWindow |
Native window structure. More... | |
Functions | |
Basic functions | |
bool | nwindowIsValid (NWindow *nw) |
Checks whether a pointer refers to a valid NWindow object. | |
NWindow * | nwindowGetDefault (void) |
Retrieves the default NWindow object. More... | |
Result | nwindowCreate (NWindow *nw, Service *binder_session, s32 binder_id, bool producer_controlled_by_app) |
Creates a NWindow. More... | |
Result | nwindowCreateFromLayer (NWindow *nw, const ViLayer *layer) |
Creates a NWindow operating on a ViLayer. More... | |
void | nwindowClose (NWindow *nw) |
Closes a NWindow, freeing all resources associated with it. | |
Window configuration | |
Result | nwindowGetDimensions (NWindow *nw, u32 *out_width, u32 *out_height) |
Retrieves the dimensions of a NWindow. More... | |
Result | nwindowSetDimensions (NWindow *nw, u32 width, u32 height) |
Sets the dimensions of a NWindow. More... | |
Result | nwindowSetCrop (NWindow *nw, s32 left, s32 top, s32 right, s32 bottom) |
Configures the crop applied to images presented through a NWindow. More... | |
Result | nwindowSetTransform (NWindow *nw, u32 transform) |
Configures the transformation applied to images presented through a NWindow. More... | |
Result | nwindowSetSwapInterval (NWindow *nw, u32 swap_interval) |
Configures the swap interval of a NWindow. More... | |
static bool | nwindowIsConsumerRunningBehind (NWindow *nw) |
Checks whether the consumer of a NWindow is running behind. | |
Buffer configuration and presentation | |
Result | nwindowConfigureBuffer (NWindow *nw, s32 slot, NvGraphicBuffer *buf) |
Registers a NvGraphicBuffer with a NWindow. More... | |
Result | nwindowDequeueBuffer (NWindow *nw, s32 *out_slot, NvMultiFence *out_fence) |
Dequeues a buffer from a NWindow. More... | |
Result | nwindowCancelBuffer (NWindow *nw, s32 slot, const NvMultiFence *fence) |
Cancels a buffer previously dequeued with nwindowDequeueBuffer. More... | |
Result | nwindowQueueBuffer (NWindow *nw, s32 slot, const NvMultiFence *fence) |
Queues a buffer previously dequeued with nwindowDequeueBuffer, making it ready for presentation. More... | |
Result | nwindowReleaseBuffers (NWindow *nw) |
Releases all buffers registered with a NWindow. | |
Native window (NWindow) wrapper object, used for presenting images to the display (or other sinks).
Result nwindowCancelBuffer | ( | NWindow * | nw, |
s32 | slot, | ||
const NvMultiFence * | fence | ||
) |
Cancels a buffer previously dequeued with nwindowDequeueBuffer.
[in] | nw | Pointer to NWindow structure. |
[in] | slot | ID of the slot to cancel. This must match the output of the previous nwindowDequeueBuffer call. |
[in] | fence | Pointer to the NvMultiFence that will be waited on by the compositor before cancelling the buffer. Pass NULL if there is no such fence. |
Result nwindowConfigureBuffer | ( | NWindow * | nw, |
s32 | slot, | ||
NvGraphicBuffer * | buf | ||
) |
Registers a NvGraphicBuffer with a NWindow.
[in] | nw | Pointer to NWindow structure. |
[in] | slot | ID of the slot to configure (starting from 0). |
[in] | buf | Pointer to NvGraphicBuffer structure. |
Result nwindowCreate | ( | NWindow * | nw, |
Service * | binder_session, | ||
s32 | binder_id, | ||
bool | producer_controlled_by_app | ||
) |
Creates a NWindow.
Result nwindowDequeueBuffer | ( | NWindow * | nw, |
s32 * | out_slot, | ||
NvMultiFence * | out_fence | ||
) |
Dequeues a buffer from a NWindow.
[in] | nw | Pointer to NWindow structure. |
[out] | out_slot | Output variable containing the ID of the slot that has been dequeued. |
[out] | out_fence | Output variable containing a NvMultiFence that will be signalled by the compositor when the buffer is ready to be written to. Pass NULL to wait instead on this fence before this function returns. |
out_fence=NULL
to work, nvFenceInit must have been previously called. NWindow* nwindowGetDefault | ( | void | ) |
Retrieves the default NWindow object.
Retrieves the dimensions of a NWindow.
[in] | nw | Pointer to NWindow structure. |
[out] | out_width | Output variable containing the width of the NWindow. |
[out] | out_height | Output variable containing the height of the NWindow. |
Result nwindowQueueBuffer | ( | NWindow * | nw, |
s32 | slot, | ||
const NvMultiFence * | fence | ||
) |
Queues a buffer previously dequeued with nwindowDequeueBuffer, making it ready for presentation.
[in] | nw | Pointer to NWindow structure. |
[in] | slot | ID of the slot to queue. This must match the output of the previous nwindowDequeueBuffer call. |
[in] | fence | Pointer to the NvMultiFence that will be waited on by the compositor before queuing/presenting the buffer. Pass NULL if there is no such fence. |
Configures the crop applied to images presented through a NWindow.
[in] | nw | Pointer to NWindow structure. |
[in] | left | X coordinate of the left margin of the crop bounding box. |
[in] | top | Y coordinate of the top margin of the crop bounding box. |
[in] | right | X coordinate of the right margin of the crop bounding box. |
[in] | bottom | Y coordinate of the bottom margin of the crop bounding box. |
left
must be less or equal than right
. top
must be less or equal than bottom
. Configures the swap interval of a NWindow.
[in] | nw | Pointer to NWindow structure. |
[in] | swap_interval | Value specifying the number of display refreshes (VBlanks) that must occur between presenting images. |