1// Package graphene was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package graphene
3
4import (
5 "structs"
6 "unsafe"
7
8 "github.com/ebitengine/purego"
9
10 "github.com/bnema/puregotk/pkg/core"
11 "github.com/bnema/puregotk/v4/gobject/types"
12)
13
14// A 3D box, described as the volume between a minimum and
15// a maximum vertices.
16type Box struct {
17 _ structs.HostLayout
18
19 Min uintptr
20
21 Max uintptr
22}
23
24var xBoxGLibType func() types.GType
25
26func BoxGLibType() types.GType {
27 return xBoxGLibType()
28}
29
30func (x *Box) GoPointer() uintptr {
31 return uintptr(unsafe.Pointer(x))
32}
33
34var xBoxAlloc func() *Box
35
36// Allocates a new #graphene_box_t.
37//
38// The contents of the returned structure are undefined.
39func BoxAlloc() *Box {
40
41 cret := xBoxAlloc()
42 return cret
43}
44
45var xBoxContainsBox func(uintptr, *Box) bool
46
47// Checks whether the #graphene_box_t @a contains the given
48// #graphene_box_t @b.
49func (x *Box) ContainsBox(BVar *Box) bool {
50
51 cret := xBoxContainsBox(x.GoPointer(), BVar)
52 return cret
53}
54
55var xBoxContainsPoint func(uintptr, *Point3D) bool
56
57// Checks whether @box contains the given @point.
58func (x *Box) ContainsPoint(PointVar *Point3D) bool {
59
60 cret := xBoxContainsPoint(x.GoPointer(), PointVar)
61 return cret
62}
63
64var xBoxEqual func(uintptr, *Box) bool
65
66// Checks whether the two given boxes are equal.
67func (x *Box) Equal(BVar *Box) bool {
68
69 cret := xBoxEqual(x.GoPointer(), BVar)
70 return cret
71}
72
73var xBoxExpand func(uintptr, *Point3D, *Box)
74
75// Expands the dimensions of @box to include the coordinates at @point.
76func (x *Box) Expand(PointVar *Point3D, ResVar *Box) {
77
78 xBoxExpand(x.GoPointer(), PointVar, ResVar)
79
80}
81
82var xBoxExpandScalar func(uintptr, float32, *Box)
83
84// Expands the dimensions of @box by the given @scalar value.
85//
86// If @scalar is positive, the #graphene_box_t will grow; if @scalar is
87// negative, the #graphene_box_t will shrink.
88func (x *Box) ExpandScalar(ScalarVar float32, ResVar *Box) {
89
90 xBoxExpandScalar(x.GoPointer(), ScalarVar, ResVar)
91
92}
93
94var xBoxExpandVec3 func(uintptr, *Vec3, *Box)
95
96// Expands the dimensions of @box to include the coordinates of the
97// given vector.
98func (x *Box) ExpandVec3(VecVar *Vec3, ResVar *Box) {
99
100 xBoxExpandVec3(x.GoPointer(), VecVar, ResVar)
101
102}
103
104var xBoxFree func(uintptr)
105
106// Frees the resources allocated by graphene_box_alloc().
107func (x *Box) Free() {
108
109 xBoxFree(x.GoPointer())
110
111}
112
113var xBoxGetBoundingSphere func(uintptr, *Sphere)
114
115// Computes the bounding #graphene_sphere_t capable of containing the given
116// #graphene_box_t.
117func (x *Box) GetBoundingSphere(SphereVar *Sphere) {
118
119 xBoxGetBoundingSphere(x.GoPointer(), SphereVar)
120
121}
122
123var xBoxGetCenter func(uintptr, *Point3D)
124
125// Retrieves the coordinates of the center of a #graphene_box_t.
126func (x *Box) GetCenter(CenterVar *Point3D) {
127
128 xBoxGetCenter(x.GoPointer(), CenterVar)
129
130}
131
132var xBoxGetDepth func(uintptr) float32
133
134// Retrieves the size of the @box on the Z axis.
135func (x *Box) GetDepth() float32 {
136
137 cret := xBoxGetDepth(x.GoPointer())
138 return cret
139}
140
141var xBoxGetHeight func(uintptr) float32
142
143// Retrieves the size of the @box on the Y axis.
144func (x *Box) GetHeight() float32 {
145
146 cret := xBoxGetHeight(x.GoPointer())
147 return cret
148}
149
150var xBoxGetMax func(uintptr, *Point3D)
151
152// Retrieves the coordinates of the maximum point of the given
153// #graphene_box_t.
154func (x *Box) GetMax(MaxVar *Point3D) {
155
156 xBoxGetMax(x.GoPointer(), MaxVar)
157
158}
159
160var xBoxGetMin func(uintptr, *Point3D)
161
162// Retrieves the coordinates of the minimum point of the given
163// #graphene_box_t.
164func (x *Box) GetMin(MinVar *Point3D) {
165
166 xBoxGetMin(x.GoPointer(), MinVar)
167
168}
169
170var xBoxGetSize func(uintptr, *Vec3)
171
172// Retrieves the size of the box on all three axes, and stores
173// it into the given @size vector.
174func (x *Box) GetSize(SizeVar *Vec3) {
175
176 xBoxGetSize(x.GoPointer(), SizeVar)
177
178}
179
180var xBoxGetVertices func(uintptr, *[8]Vec3)
181
182// Computes the vertices of the given #graphene_box_t.
183func (x *Box) GetVertices(VerticesVar *[8]Vec3) {
184
185 xBoxGetVertices(x.GoPointer(), VerticesVar)
186
187}
188
189var xBoxGetWidth func(uintptr) float32
190
191// Retrieves the size of the @box on the X axis.
192func (x *Box) GetWidth() float32 {
193
194 cret := xBoxGetWidth(x.GoPointer())
195 return cret
196}
197
198var xBoxInit func(uintptr, *Point3D, *Point3D) *Box
199
200// Initializes the given #graphene_box_t with two vertices.
201func (x *Box) Init(MinVar *Point3D, MaxVar *Point3D) *Box {
202
203 cret := xBoxInit(x.GoPointer(), MinVar, MaxVar)
204 return cret
205}
206
207var xBoxInitFromBox func(uintptr, *Box) *Box
208
209// Initializes the given #graphene_box_t with the vertices of
210// another #graphene_box_t.
211func (x *Box) InitFromBox(SrcVar *Box) *Box {
212
213 cret := xBoxInitFromBox(x.GoPointer(), SrcVar)
214 return cret
215}
216
217var xBoxInitFromPoints func(uintptr, uint, []Point3D) *Box
218
219// Initializes the given #graphene_box_t with the given array
220// of vertices.
221//
222// If @n_points is 0, the returned box is initialized with
223// graphene_box_empty().
224func (x *Box) InitFromPoints(NPointsVar uint, PointsVar []Point3D) *Box {
225
226 cret := xBoxInitFromPoints(x.GoPointer(), NPointsVar, PointsVar)
227 return cret
228}
229
230var xBoxInitFromVec3 func(uintptr, *Vec3, *Vec3) *Box
231
232// Initializes the given #graphene_box_t with two vertices
233// stored inside #graphene_vec3_t.
234func (x *Box) InitFromVec3(MinVar *Vec3, MaxVar *Vec3) *Box {
235
236 cret := xBoxInitFromVec3(x.GoPointer(), MinVar, MaxVar)
237 return cret
238}
239
240var xBoxInitFromVectors func(uintptr, uint, []Vec3) *Box
241
242// Initializes the given #graphene_box_t with the given array
243// of vertices.
244//
245// If @n_vectors is 0, the returned box is initialized with
246// graphene_box_empty().
247func (x *Box) InitFromVectors(NVectorsVar uint, VectorsVar []Vec3) *Box {
248
249 cret := xBoxInitFromVectors(x.GoPointer(), NVectorsVar, VectorsVar)
250 return cret
251}
252
253var xBoxIntersection func(uintptr, *Box, *Box) bool
254
255// Intersects the two given #graphene_box_t.
256//
257// If the two boxes do not intersect, @res will contain a degenerate box
258// initialized with graphene_box_empty().
259func (x *Box) Intersection(BVar *Box, ResVar *Box) bool {
260
261 cret := xBoxIntersection(x.GoPointer(), BVar, ResVar)
262 return cret
263}
264
265var xBoxUnion func(uintptr, *Box, *Box)
266
267// Unions the two given #graphene_box_t.
268func (x *Box) Union(BVar *Box, ResVar *Box) {
269
270 xBoxUnion(x.GoPointer(), BVar, ResVar)
271
272}
273
274var xBoxEmpty func() *Box
275
276// A degenerate #graphene_box_t that can only be expanded.
277//
278// The returned value is owned by Graphene and should not be modified or freed.
279func BoxEmpty() *Box {
280
281 cret := xBoxEmpty()
282 return cret
283}
284
285var xBoxInfinite func() *Box
286
287// A degenerate #graphene_box_t that cannot be expanded.
288//
289// The returned value is owned by Graphene and should not be modified or freed.
290func BoxInfinite() *Box {
291
292 cret := xBoxInfinite()
293 return cret
294}
295
296var xBoxMinusOne func() *Box
297
298// A #graphene_box_t with the minimum vertex set at (-1, -1, -1) and the
299// maximum vertex set at (0, 0, 0).
300//
301// The returned value is owned by Graphene and should not be modified or freed.
302func BoxMinusOne() *Box {
303
304 cret := xBoxMinusOne()
305 return cret
306}
307
308var xBoxOne func() *Box
309
310// A #graphene_box_t with the minimum vertex set at (0, 0, 0) and the
311// maximum vertex set at (1, 1, 1).
312//
313// The returned value is owned by Graphene and should not be modified or freed.
314func BoxOne() *Box {
315
316 cret := xBoxOne()
317 return cret
318}
319
320var xBoxOneMinusOne func() *Box
321
322// A #graphene_box_t with the minimum vertex set at (-1, -1, -1) and the
323// maximum vertex set at (1, 1, 1).
324//
325// The returned value is owned by Graphene and should not be modified or freed.
326func BoxOneMinusOne() *Box {
327
328 cret := xBoxOneMinusOne()
329 return cret
330}
331
332var xBoxZero func() *Box
333
334// A #graphene_box_t with both the minimum and maximum vertices set at (0, 0, 0).
335//
336// The returned value is owned by Graphene and should not be modified or freed.
337func BoxZero() *Box {
338
339 cret := xBoxZero()
340 return cret
341}
342
343func init() {
344 core.SetPackageName("GRAPHENE", "graphene-gobject-1.0")
345 core.SetSharedLibraries("GRAPHENE", []string{"libgraphene-1.0.so.0"})
346 var libs []uintptr
347 for _, libPath := range core.GetPaths("GRAPHENE") {
348 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
349 if err != nil {
350 panic(err)
351 }
352 libs = append(libs, lib)
353 }
354
355 core.PuregoSafeRegister(&xBoxEmpty, libs, "graphene_box_empty")
356 core.PuregoSafeRegister(&xBoxInfinite, libs, "graphene_box_infinite")
357 core.PuregoSafeRegister(&xBoxMinusOne, libs, "graphene_box_minus_one")
358 core.PuregoSafeRegister(&xBoxOne, libs, "graphene_box_one")
359 core.PuregoSafeRegister(&xBoxOneMinusOne, libs, "graphene_box_one_minus_one")
360 core.PuregoSafeRegister(&xBoxZero, libs, "graphene_box_zero")
361
362 core.PuregoSafeRegister(&xBoxGLibType, libs, "graphene_box_get_type")
363
364 core.PuregoSafeRegister(&xBoxAlloc, libs, "graphene_box_alloc")
365
366 core.PuregoSafeRegister(&xBoxContainsBox, libs, "graphene_box_contains_box")
367 core.PuregoSafeRegister(&xBoxContainsPoint, libs, "graphene_box_contains_point")
368 core.PuregoSafeRegister(&xBoxEqual, libs, "graphene_box_equal")
369 core.PuregoSafeRegister(&xBoxExpand, libs, "graphene_box_expand")
370 core.PuregoSafeRegister(&xBoxExpandScalar, libs, "graphene_box_expand_scalar")
371 core.PuregoSafeRegister(&xBoxExpandVec3, libs, "graphene_box_expand_vec3")
372 core.PuregoSafeRegister(&xBoxFree, libs, "graphene_box_free")
373 core.PuregoSafeRegister(&xBoxGetBoundingSphere, libs, "graphene_box_get_bounding_sphere")
374 core.PuregoSafeRegister(&xBoxGetCenter, libs, "graphene_box_get_center")
375 core.PuregoSafeRegister(&xBoxGetDepth, libs, "graphene_box_get_depth")
376 core.PuregoSafeRegister(&xBoxGetHeight, libs, "graphene_box_get_height")
377 core.PuregoSafeRegister(&xBoxGetMax, libs, "graphene_box_get_max")
378 core.PuregoSafeRegister(&xBoxGetMin, libs, "graphene_box_get_min")
379 core.PuregoSafeRegister(&xBoxGetSize, libs, "graphene_box_get_size")
380 core.PuregoSafeRegister(&xBoxGetVertices, libs, "graphene_box_get_vertices")
381 core.PuregoSafeRegister(&xBoxGetWidth, libs, "graphene_box_get_width")
382 core.PuregoSafeRegister(&xBoxInit, libs, "graphene_box_init")
383 core.PuregoSafeRegister(&xBoxInitFromBox, libs, "graphene_box_init_from_box")
384 core.PuregoSafeRegister(&xBoxInitFromPoints, libs, "graphene_box_init_from_points")
385 core.PuregoSafeRegister(&xBoxInitFromVec3, libs, "graphene_box_init_from_vec3")
386 core.PuregoSafeRegister(&xBoxInitFromVectors, libs, "graphene_box_init_from_vectors")
387 core.PuregoSafeRegister(&xBoxIntersection, libs, "graphene_box_intersection")
388 core.PuregoSafeRegister(&xBoxUnion, libs, "graphene_box_union")
389
390}