xrd-scene-window.h 2.57 KB
Newer Older
Lubosz Sarnecki's avatar
Lubosz Sarnecki committed
1
/*
2
 * xrdesktop
Lubosz Sarnecki's avatar
Lubosz Sarnecki committed
3 4 5 6 7
 * Copyright 2018 Collabora Ltd.
 * Author: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
 * SPDX-License-Identifier: MIT
 */

8 9
#ifndef XRD_SCENE_WINDOW_H_
#define XRD_SCENE_WINDOW_H_
Lubosz Sarnecki's avatar
Lubosz Sarnecki committed
10

11 12 13 14
#if !defined (XRD_INSIDE) && !defined (XRD_COMPILATION)
#error "Only <xrd.h> can be included directly."
#endif

Lubosz Sarnecki's avatar
Lubosz Sarnecki committed
15 16
#include <glib-object.h>

17
#include <openvr-glib.h>
Lubosz Sarnecki's avatar
Lubosz Sarnecki committed
18

19
#include <gulkan.h>
Lubosz Sarnecki's avatar
Lubosz Sarnecki committed
20 21

#include "xrd-scene-object.h"
22
#include "xrd-window.h"
Lubosz Sarnecki's avatar
Lubosz Sarnecki committed
23 24 25 26

G_BEGIN_DECLS

#define XRD_TYPE_SCENE_WINDOW xrd_scene_window_get_type()
27 28
G_DECLARE_DERIVABLE_TYPE (XrdSceneWindow, xrd_scene_window,
                          XRD, SCENE_WINDOW, XrdSceneObject)
Lubosz Sarnecki's avatar
Lubosz Sarnecki committed
29

30 31 32 33 34 35 36
/**
 * XrdSceneWindowClass:
 * @parent: The object class structure needs to be the first
 *   element in the widget class structure in order for the class mechanism
 *   to work correctly. This allows a XrdSceneWindowClass pointer to be cast to
 *   a XrdSceneObjectClass pointer.
 */
37
struct _XrdSceneWindowClass
Lubosz Sarnecki's avatar
Lubosz Sarnecki committed
38
{
39
  XrdSceneObjectClass parent;
Lubosz Sarnecki's avatar
Lubosz Sarnecki committed
40 41
};

42 43 44 45
XrdSceneWindow *xrd_scene_window_new (const gchar *title);

XrdSceneWindow *
xrd_scene_window_new_from_meters (const gchar *title,
46 47 48
                                  float        width,
                                  float        height,
                                  float        ppm);
49

50 51 52
XrdSceneWindow *
xrd_scene_window_new_from_data (XrdWindowData *data);

53
XrdSceneWindow *
54 55 56 57
xrd_scene_window_new_from_pixels (const gchar *title,
                                  uint32_t     width,
                                  uint32_t     height,
                                  float        ppm);
58 59 60 61 62 63 64

XrdSceneWindow *
xrd_scene_window_new_from_native (const gchar *title,
                                  gpointer     native,
                                  uint32_t     width_pixels,
                                  uint32_t     height_pixels,
                                  float        ppm);
Lubosz Sarnecki's avatar
Lubosz Sarnecki committed
65 66

gboolean
67
xrd_scene_window_initialize (XrdSceneWindow *self);
Lubosz Sarnecki's avatar
Lubosz Sarnecki committed
68 69 70 71 72 73 74 75 76

void
xrd_scene_window_draw (XrdSceneWindow    *self,
                       EVREye             eye,
                       VkPipeline         pipeline,
                       VkPipelineLayout   pipeline_layout,
                       VkCommandBuffer    cmd_buffer,
                       graphene_matrix_t *vp);

77 78 79
void
xrd_scene_window_set_width_meters (XrdSceneWindow *self,
                                   float           width_meters);
80

81 82 83 84 85 86
void
xrd_scene_window_set_color (XrdSceneWindow        *self,
                            const graphene_vec3_t *color);

void
xrd_scene_window_update_descriptors (XrdSceneWindow *self);
87

Lubosz Sarnecki's avatar
Lubosz Sarnecki committed
88 89
G_END_DECLS

90
#endif /* XRD_SCENE_WINDOW_H_ */