GxrContext

GxrContext

Functions

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── GxrContext

Includes

#include <gxr.h>

Description

Functions

gxr_context_new ()

GxrContext *
gxr_context_new (char *app_name,
                 uint32_t app_version);

gxr_context_new_from_vulkan_extensions ()

GxrContext *
gxr_context_new_from_vulkan_extensions
                               (GSList *instance_ext_list,
                                GSList *device_ext_list,
                                char *app_name,
                                uint32_t app_version);

gxr_context_get_head_pose ()

gboolean
gxr_context_get_head_pose (GxrContext *self,
                           graphene_matrix_t *pose);

gxr_context_get_frustum_angles ()

void
gxr_context_get_frustum_angles (GxrContext *self,
                                GxrEye eye,
                                float *left,
                                float *right,
                                float *top,
                                float *bottom);

gxr_context_init_framebuffers ()

gboolean
gxr_context_init_framebuffers (GxrContext *self,
                               VkExtent2D extent,
                               VkSampleCountFlagBits sample_count,
                               GulkanRenderPass **render_pass);

gxr_context_poll_events ()

void
gxr_context_poll_events (GxrContext *self);

gxr_context_get_projection ()

void
gxr_context_get_projection (GxrContext *self,
                            GxrEye eye,
                            float near,
                            float far,
                            graphene_matrix_t *mat);

gxr_context_get_view ()

void
gxr_context_get_view (GxrContext *self,
                      GxrEye eye,
                      graphene_matrix_t *mat);

gxr_context_get_eye_position ()

void
gxr_context_get_eye_position (GxrContext *self,
                              GxrEye eye,
                              graphene_vec3_t *v);

gxr_context_wait_frame ()

gboolean
gxr_context_wait_frame (GxrContext *self);

gxr_context_begin_frame ()

gboolean
gxr_context_begin_frame (GxrContext *self);

gxr_context_end_frame ()

gboolean
gxr_context_end_frame (GxrContext *self);

gxr_context_request_quit ()

void
gxr_context_request_quit (GxrContext *self);

gxr_context_get_gulkan ()

GulkanContext *
gxr_context_get_gulkan (GxrContext *self);

gxr_context_get_runtime_instance_extensions ()

gboolean
gxr_context_get_runtime_instance_extensions
                               (GxrContext *self,
                                GSList **out_list);

gxr_context_get_runtime_device_extensions ()

gboolean
gxr_context_get_runtime_device_extensions
                               (GxrContext *self,
                                GSList **out_list);

gxr_context_get_device_manager ()

GxrDeviceManager *
gxr_context_get_device_manager (GxrContext *self);

gxr_context_get_swapchain_length ()

uint32_t
gxr_context_get_swapchain_length (GxrContext *self);

gxr_context_get_acquired_framebuffer ()

GulkanFrameBuffer *
gxr_context_get_acquired_framebuffer (GxrContext *self);

gxr_context_get_framebuffer_at ()

GulkanFrameBuffer *
gxr_context_get_framebuffer_at (GxrContext *self,
                                uint32_t i);

gxr_context_get_swapchain_extent ()

VkExtent2D
gxr_context_get_swapchain_extent (GxrContext *self,
                                  uint32_t view_index);

gxr_context_get_buffer_index ()

uint32_t
gxr_context_get_buffer_index (GxrContext *self);

gxr_context_attach_action_sets ()

gboolean
gxr_context_attach_action_sets (GxrContext *self,
                                GxrActionSet **sets,
                                uint32_t count);

Types and Values

GXR_DEVICE_INDEX_MAX

#define GXR_DEVICE_INDEX_MAX 64

GXR_TYPE_CONTEXT

#define GXR_TYPE_CONTEXT gxr_context_get_type ()

struct GxrContextClass

struct GxrContextClass {
  GObjectClass parent;
};

Members

GObjectClass parent;

The parent class

 

enum GxrEye

Type of Gxr viewport.

Members

GXR_EYE_LEFT

Left eye.

 

GXR_EYE_RIGHT

Right eye.

 

enum GxrStateChange

Members

GXR_STATE_FRAMECYCLE_START

Ready to call gxr_context_begin_frame / gxr_context_end_frame.

 

GXR_STATE_FRAMECYCLE_STOP

Not ready to call gxr_context_begin_frame / gxr_context_end_frame.

 

GXR_STATE_RENDERING_START

The frame content will be shown in XR.

 

GXR_STATE_RENDERING_STOP

The frame content will not be visible, expensive rendering work can be skipped, but gxr_context_begin_frame / gxr_context_end_frame should be called.

 

GXR_STATE_SHUTDOWN

XR Runtime is shutting down.

 

GxrContext

typedef struct _GxrContext GxrContext;

Signal Details

The “overlay-event” signal

void
user_function (GxrContext *gxrcontext,
               gpointer    arg1,
               gpointer    user_data)

Flags: Run Last

The “state-change-event” signal

void
user_function (GxrContext *gxrcontext,
               gpointer    arg1,
               gpointer    user_data)

Flags: Run Last