File: scene-object.h

package info (click to toggle)
gxr 0.15.1-4.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,768 kB
  • sloc: ansic: 15,256; sh: 72; xml: 71; awk: 35; makefile: 12
file content (109 lines) | stat: -rw-r--r-- 2,982 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
 * gxr
 * Copyright 2018 Collabora Ltd.
 * Author: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
 * Author: Christoph Haag <christoph.haag@collabora.com>
 * SPDX-License-Identifier: MIT
 */

#ifndef SCENE_OBJECT_H_
#define SCENE_OBJECT_H_

#include "glib.h"
#include <gulkan.h>
#include <graphene.h>
#include <gxr.h>

G_BEGIN_DECLS

#define SCENE_TYPE_OBJECT scene_object_get_type()
G_DECLARE_DERIVABLE_TYPE (SceneObject, scene_object,
                          SCENE, OBJECT, GObject)

/**
 * SceneObjectClass:
 * @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 SceneObjectClass pointer to be cast to
 *   a GObjectClass pointer.
 */
struct _SceneObjectClass
{
  GObjectClass parent;
};

void
scene_object_set_scale (SceneObject *self, float scale);

void
scene_object_set_position (SceneObject        *self,
                           graphene_point3d_t *position);

void
scene_object_get_position (SceneObject        *self,
                           graphene_point3d_t *position);

void
scene_object_set_rotation_euler (SceneObject      *self,
                                 graphene_euler_t *euler);

void
scene_object_get_transformation (SceneObject       *self,
                                 graphene_matrix_t *transformation);

void
scene_object_bind (SceneObject     *self,
                   GxrEye           eye,
                   VkCommandBuffer  cmd_buffer,
                   VkPipelineLayout pipeline_layout);

gboolean
scene_object_initialize (SceneObject           *self,
                         GulkanClient          *gulkan,
                         VkDescriptorSetLayout *layout,
                         VkDeviceSize           uniform_buffer_size);

void
scene_object_update_descriptors_texture (SceneObject *self,
                                         VkSampler    sampler,
                                         VkImageView  image_view);

void
scene_object_update_descriptors (SceneObject *self);

void
scene_object_set_transformation (SceneObject       *self,
                                 graphene_matrix_t *mat);

graphene_matrix_t
scene_object_get_transformation_no_scale (SceneObject *self);

gboolean
scene_object_is_visible (SceneObject *self);
void
scene_object_show (SceneObject *self);

void
scene_object_hide (SceneObject *self);

void
scene_object_set_transformation_direct (SceneObject       *self,
                                        graphene_matrix_t *mat);

GulkanUniformBuffer *
scene_object_get_ubo (SceneObject *self, uint32_t eye);

VkBuffer
scene_object_get_transformation_buffer (SceneObject *self, uint32_t eye);

VkDescriptorSet
scene_object_get_descriptor_set (SceneObject *self, uint32_t eye);

void
scene_object_update_ubo (SceneObject *self,
                         GxrEye       eye,
                         gpointer     uniform_buffer);

G_END_DECLS

#endif /* SCENE_OBJECT_H_ */