Blender V5.0
GHOST_C-api.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#include <cstdlib>
12#include <cstring>
13
14#include "GHOST_C-api.h"
15#include "GHOST_IEvent.hh"
17#include "GHOST_ISystem.hh"
18#include "intern/GHOST_Debug.hh"
19#ifdef WITH_XR_OPENXR
20# include "GHOST_IXrContext.hh"
22#endif
25
26GHOST_SystemHandle GHOST_CreateSystem()
27{
28 GHOST_ISystem::createSystem(true, false);
30
31 return (GHOST_SystemHandle)system;
32}
33
34GHOST_SystemHandle GHOST_CreateSystemBackground()
35{
38
39 return (GHOST_SystemHandle)system;
40}
41
42void GHOST_SystemInitDebug(GHOST_SystemHandle systemhandle, GHOST_Debug debug)
43{
44 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
45
46 system->initDebug(debug);
47}
48
49GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle /*systemhandle*/)
50{
52}
53
54#if !(defined(WIN32) || defined(__APPLE__))
56{
58}
59#endif
60
61void GHOST_ShowMessageBox(GHOST_SystemHandle systemhandle,
62 const char *title,
63 const char *message,
64 const char *help_label,
65 const char *continue_label,
66 const char *link,
67 GHOST_DialogOptions dialog_options)
68{
69 const GHOST_ISystem *system = (const GHOST_ISystem *)systemhandle;
70 system->showMessageBox(title, message, help_label, continue_label, link, dialog_options);
71}
72
73GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback,
74 GHOST_TUserDataPtr user_data)
75{
76 return (GHOST_EventConsumerHandle) new GHOST_CallbackEventConsumer(eventCallback, user_data);
77}
78
79GHOST_TSuccess GHOST_DisposeEventConsumer(GHOST_EventConsumerHandle consumerhandle)
80{
81 delete ((GHOST_CallbackEventConsumer *)consumerhandle);
82 return GHOST_kSuccess;
83}
84
85uint64_t GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle)
86{
87 const GHOST_ISystem *system = (const GHOST_ISystem *)systemhandle;
88
89 return system->getMilliSeconds();
90}
91
92GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle,
93 uint64_t delay,
94 uint64_t interval,
95 GHOST_TimerProcPtr timerproc,
96 GHOST_TUserDataPtr user_data)
97{
98 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
99
100 return (GHOST_TimerTaskHandle)system->installTimer(delay, interval, timerproc, user_data);
101}
102
103GHOST_TSuccess GHOST_RemoveTimer(GHOST_SystemHandle systemhandle,
104 GHOST_TimerTaskHandle timertaskhandle)
105{
106 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
107 GHOST_ITimerTask *timertask = (GHOST_ITimerTask *)timertaskhandle;
108
109 return system->removeTimer(timertask);
110}
111
112uint8_t GHOST_GetNumDisplays(GHOST_SystemHandle systemhandle)
113{
114 const GHOST_ISystem *system = (const GHOST_ISystem *)systemhandle;
115
116 return system->getNumDisplays();
117}
118
119GHOST_TSuccess GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
120 uint32_t *r_width,
121 uint32_t *r_height)
122{
123 const GHOST_ISystem *system = (const GHOST_ISystem *)systemhandle;
124 *r_width = 0;
125 *r_height = 0;
126 system->getMainDisplayDimensions(*r_width, *r_height);
127 return (*r_width == 0 && *r_height == 0) ? GHOST_kFailure : GHOST_kSuccess;
128}
129
130GHOST_TSuccess GHOST_GetAllDisplayDimensions(GHOST_SystemHandle systemhandle,
131 uint32_t *r_width,
132 uint32_t *r_height)
133{
134 const GHOST_ISystem *system = (const GHOST_ISystem *)systemhandle;
135 *r_width = 0;
136 *r_height = 0;
137 system->getAllDisplayDimensions(*r_width, *r_height);
138 return (*r_width == 0 && *r_height == 0) ? GHOST_kFailure : GHOST_kSuccess;
139}
140
141GHOST_ContextHandle GHOST_CreateGPUContext(GHOST_SystemHandle systemhandle,
142 GHOST_GPUSettings gpu_settings)
143{
144 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
145
146 return (GHOST_ContextHandle)system->createOffscreenContext(gpu_settings);
147}
148
149GHOST_TSuccess GHOST_DisposeGPUContext(GHOST_SystemHandle systemhandle,
150 GHOST_ContextHandle contexthandle)
151{
152 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
153 GHOST_IContext *context = (GHOST_IContext *)contexthandle;
154
155 return system->disposeContext(context);
156}
157
158GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
159 GHOST_WindowHandle parent_windowhandle,
160 const char *title,
162 int32_t top,
163 uint32_t width,
164 uint32_t height,
166 bool is_dialog,
167 GHOST_GPUSettings gpu_settings)
168{
169 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
170
171 return (GHOST_WindowHandle)system->createWindow(title,
172 left,
173 top,
174 width,
175 height,
176 state,
177 gpu_settings,
178 false,
179 is_dialog,
180 (GHOST_IWindow *)parent_windowhandle);
181}
182
183GHOST_TUserDataPtr GHOST_GetWindowUserData(GHOST_WindowHandle windowhandle)
184{
185 const GHOST_IWindow *window = (const GHOST_IWindow *)windowhandle;
186
187 return window->getUserData();
188}
189void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle, GHOST_TUserDataPtr user_data)
190{
191 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
192
193 window->setUserData(user_data);
194}
195
196bool GHOST_IsDialogWindow(GHOST_WindowHandle windowhandle)
197{
198 const GHOST_IWindow *window = (const GHOST_IWindow *)windowhandle;
199
200 return window->isDialog();
201}
202
203GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle,
204 GHOST_WindowHandle windowhandle)
205{
206 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
207 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
208
209 return system->disposeWindow(window);
210}
211
212bool GHOST_ValidWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
213{
214 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
215 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
216
217 return system->validWindow(window);
218}
219
220GHOST_WindowHDRInfo GHOST_WindowGetHDRInfo(GHOST_WindowHandle windowhandle)
221{
222 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
223 return window->getHDRInfo();
224}
225
226GHOST_WindowHandle GHOST_GetWindowUnderCursor(GHOST_SystemHandle systemhandle,
227 int32_t x,
228 int32_t y)
229{
230 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
231 GHOST_IWindow *window = system->getWindowUnderCursor(x, y);
232
233 return (GHOST_WindowHandle)window;
234}
235
236bool GHOST_ProcessEvents(GHOST_SystemHandle systemhandle, bool waitForEvent)
237{
238 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
239
240 return system->processEvents(waitForEvent);
241}
242
243void GHOST_DispatchEvents(GHOST_SystemHandle systemhandle)
244{
245 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
246
247 system->dispatchEvents();
248}
249
250GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle,
251 GHOST_EventConsumerHandle consumerhandle)
252{
253 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
254
255 return system->addEventConsumer((GHOST_CallbackEventConsumer *)consumerhandle);
256}
257
258GHOST_TSuccess GHOST_RemoveEventConsumer(GHOST_SystemHandle systemhandle,
259 GHOST_EventConsumerHandle consumerhandle)
260{
261 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
262
263 return system->removeEventConsumer((GHOST_CallbackEventConsumer *)consumerhandle);
264}
265
266GHOST_TSuccess GHOST_SetProgressBar(GHOST_WindowHandle windowhandle, float progress)
267{
268 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
269
270 return window->setProgressBar(progress);
271}
272
273GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle)
274{
275 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
276
277 return window->endProgressBar();
278}
279
280GHOST_TStandardCursor GHOST_GetCursorShape(GHOST_WindowHandle windowhandle)
281{
282 const GHOST_IWindow *window = (const GHOST_IWindow *)windowhandle;
283
284 return window->getCursorShape();
285}
286
287GHOST_TSuccess GHOST_SetCursorShape(GHOST_WindowHandle windowhandle,
288 GHOST_TStandardCursor cursorshape)
289{
290 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
291
292 return window->setCursorShape(cursorshape);
293}
294
295GHOST_TSuccess GHOST_HasCursorShape(GHOST_WindowHandle windowhandle,
296 GHOST_TStandardCursor cursorshape)
297{
298 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
299
300 return window->hasCursorShape(cursorshape);
301}
302
303GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle,
304 const uint8_t *bitmap,
305 const uint8_t *mask,
306 const int size[2],
307 const int hot_spot[2],
308 bool can_invert_color)
309{
310 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
311 return window->setCustomCursorShape(bitmap, mask, size, hot_spot, can_invert_color);
312}
313
314GHOST_TSuccess GHOST_SetCustomCursorGenerator(GHOST_WindowHandle windowhandle,
315 GHOST_CursorGenerator *cursor_generator)
316{
317 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
318 return window->setCustomCursorGenerator(cursor_generator);
319}
320
321GHOST_TSuccess GHOST_GetCursorBitmap(GHOST_WindowHandle windowhandle,
322 GHOST_CursorBitmapRef *bitmap)
323{
324 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
325
326 return window->getCursorBitmap(bitmap);
327}
328
329uint32_t GHOST_GetCursorPreferredLogicalSize(const GHOST_SystemHandle systemhandle)
330{
331 const GHOST_ISystem *system = (const GHOST_ISystem *)systemhandle;
332
333 return system->getCursorPreferredLogicalSize();
334}
335
336bool GHOST_GetCursorVisibility(GHOST_WindowHandle windowhandle)
337{
338 const GHOST_IWindow *window = (const GHOST_IWindow *)windowhandle;
339
340 return window->getCursorVisibility();
341}
342
343GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle, bool visible)
344{
345 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
346
347 return window->setCursorVisibility(visible);
348}
349
350/* Unused, can expose again if needed although WAYLAND
351 * can only properly use client relative coordinates, so leave disabled if possible. */
352#if 0
353GHOST_TSuccess GHOST_GetCursorPositionScreenCoords(GHOST_SystemHandle systemhandle,
354 int32_t *x,
355 int32_t *y)
356{
357 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
358
359 return system->getCursorPosition(*x, *y);
360}
361
362GHOST_TSuccess GHOST_SetCursorPositionScreenCoords(GHOST_SystemHandle systemhandle,
363 int32_t x,
364 int32_t y)
365{
366 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
367
368 return system->setCursorPosition(x, y);
369}
370#endif
371
372GHOST_TSuccess GHOST_GetCursorPosition(const GHOST_SystemHandle systemhandle,
373 const GHOST_WindowHandle windowhandle,
374 int32_t *x,
375 int32_t *y)
376{
377 const GHOST_ISystem *system = (const GHOST_ISystem *)systemhandle;
378 const GHOST_IWindow *window = (const GHOST_IWindow *)windowhandle;
379
380 return system->getCursorPositionClientRelative(window, *x, *y);
381}
382
383GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle,
384 GHOST_WindowHandle windowhandle,
385 int32_t x,
386 int32_t y)
387{
388 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
389 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
390
391 return system->setCursorPositionClientRelative(window, x, y);
392}
393
394GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
396 GHOST_TAxisFlag wrap_axis,
397 const int bounds[4],
398 const int mouse_ungrab_xy[2])
399{
400 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
401 GHOST_Rect bounds_rect;
402 int32_t mouse_xy[2];
403
404 if (bounds) {
405 bounds_rect = GHOST_Rect(bounds[0], bounds[1], bounds[2], bounds[3]);
406 }
407 if (mouse_ungrab_xy) {
408 mouse_xy[0] = mouse_ungrab_xy[0];
409 mouse_xy[1] = mouse_ungrab_xy[1];
410 }
411
412 return window->setCursorGrab(
413 mode, wrap_axis, bounds ? &bounds_rect : nullptr, mouse_ungrab_xy ? mouse_xy : nullptr);
414}
415
416void GHOST_GetCursorGrabState(GHOST_WindowHandle windowhandle,
417 GHOST_TGrabCursorMode *r_mode,
418 GHOST_TAxisFlag *r_axis_flag,
419 int r_bounds[4],
420 bool *r_use_software_cursor)
421{
422 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
423 GHOST_Rect bounds_rect;
424 bool use_software_cursor;
425 window->getCursorGrabState(*r_mode, *r_axis_flag, bounds_rect, use_software_cursor);
426 r_bounds[0] = bounds_rect.l_;
427 r_bounds[1] = bounds_rect.t_;
428 r_bounds[2] = bounds_rect.r_;
429 r_bounds[3] = bounds_rect.b_;
430 *r_use_software_cursor = use_software_cursor;
431}
432
433GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle,
435 bool *r_is_down)
436{
437 const GHOST_ISystem *system = (const GHOST_ISystem *)systemhandle;
439 bool is_down = false;
440
441 result = system->getModifierKeyState(mask, is_down);
442 *r_is_down = is_down;
443
444 return result;
445}
446
447GHOST_TSuccess GHOST_GetButtonState(GHOST_SystemHandle systemhandle,
449 bool *r_is_down)
450{
451 const GHOST_ISystem *system = (const GHOST_ISystem *)systemhandle;
453 bool is_down = false;
454
455 result = system->getButtonState(mask, is_down);
456 *r_is_down = is_down;
457
458 return result;
459}
460
461#ifdef WITH_INPUT_NDOF
462void GHOST_setNDOFDeadZone(float deadzone)
463{
465 system->setNDOFDeadZone(deadzone);
466}
467#endif
468
469void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, bool can_accept)
470{
471 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
472
473 window->setAcceptDragOperation(can_accept);
474}
475
476GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle)
477{
478 const GHOST_IEvent *event = (const GHOST_IEvent *)eventhandle;
479
480 return event->getType();
481}
482
483uint64_t GHOST_GetEventTime(GHOST_EventHandle eventhandle)
484{
485 const GHOST_IEvent *event = (const GHOST_IEvent *)eventhandle;
486
487 return event->getTime();
488}
489
490GHOST_WindowHandle GHOST_GetEventWindow(GHOST_EventHandle eventhandle)
491{
492 const GHOST_IEvent *event = (const GHOST_IEvent *)eventhandle;
493
494 return (GHOST_WindowHandle)event->getWindow();
495}
496
497GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle)
498{
499 const GHOST_IEvent *event = (const GHOST_IEvent *)eventhandle;
500
501 return event->getData();
502}
503
504GHOST_TimerProcPtr GHOST_GetTimerProc(GHOST_TimerTaskHandle timertaskhandle)
505{
506 const GHOST_ITimerTask *timertask = (const GHOST_ITimerTask *)timertaskhandle;
507
508 return timertask->getTimerProc();
509}
510
511void GHOST_SetTimerProc(GHOST_TimerTaskHandle timertaskhandle, GHOST_TimerProcPtr timerproc)
512{
513 GHOST_ITimerTask *timertask = (GHOST_ITimerTask *)timertaskhandle;
514
515 timertask->setTimerProc(timerproc);
516}
517
518GHOST_TUserDataPtr GHOST_GetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle)
519{
520 const GHOST_ITimerTask *timertask = (const GHOST_ITimerTask *)timertaskhandle;
521
522 return timertask->getUserData();
523}
524
525void GHOST_SetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle,
526 GHOST_TUserDataPtr user_data)
527{
528 GHOST_ITimerTask *timertask = (GHOST_ITimerTask *)timertaskhandle;
529
530 timertask->setUserData(user_data);
531}
532
533bool GHOST_GetValid(GHOST_WindowHandle windowhandle)
534{
535 const GHOST_IWindow *window = (const GHOST_IWindow *)windowhandle;
536
537 return window->getValid();
538}
539
541{
542 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
543
544 return window->getDrawingContextType();
545}
546
547GHOST_TSuccess GHOST_SetDrawingContextType(GHOST_WindowHandle windowhandle,
549{
550 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
551
552 return window->setDrawingContextType(type);
553}
554
555GHOST_ContextHandle GHOST_GetDrawingContext(GHOST_WindowHandle windowhandle)
556{
557 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
558 return (GHOST_ContextHandle)window->getDrawingContext();
559}
560
561void GHOST_SetTitle(GHOST_WindowHandle windowhandle, const char *title)
562{
563 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
564
565 window->setTitle(title);
566}
567
568char *GHOST_GetTitle(GHOST_WindowHandle windowhandle)
569{
570 const GHOST_IWindow *window = (const GHOST_IWindow *)windowhandle;
571 std::string title = window->getTitle();
572
573 const size_t ctitle_size = title.size() + 1;
574 char *ctitle = (char *)malloc(ctitle_size);
575
576 if (ctitle == nullptr) {
577 return nullptr;
578 }
579
580 memcpy(ctitle, title.c_str(), ctitle_size);
581
582 return ctitle;
583}
584
585GHOST_TSuccess GHOST_SetPath(GHOST_WindowHandle windowhandle, const char *filepath)
586{
587 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
588
589 return window->setPath(filepath);
590}
591
593 GHOST_WindowHandle windowhandle)
594{
595 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
596 return window->getWindowDecorationStyleFlags();
597}
598
599void GHOST_SetWindowDecorationStyleFlags(GHOST_WindowHandle windowhandle,
601{
602 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
603 window->setWindowDecorationStyleFlags(style_flags);
604}
605
607 GHOST_WindowHandle windowhandle, GHOST_WindowDecorationStyleSettings decoration_settings)
608{
609 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
610 window->setWindowDecorationStyleSettings(decoration_settings);
611}
612
613GHOST_TSuccess GHOST_ApplyWindowDecorationStyle(GHOST_WindowHandle windowhandle)
614{
615 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
616 return window->applyWindowDecorationStyle();
617}
618
619GHOST_RectangleHandle GHOST_GetWindowBounds(GHOST_WindowHandle windowhandle)
620{
621 const GHOST_IWindow *window = (const GHOST_IWindow *)windowhandle;
622 GHOST_Rect *rectangle = nullptr;
623
624 rectangle = new GHOST_Rect();
625 window->getWindowBounds(*rectangle);
626
627 return (GHOST_RectangleHandle)rectangle;
628}
629
630GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle)
631{
632 const GHOST_IWindow *window = (const GHOST_IWindow *)windowhandle;
633 GHOST_Rect *rectangle = nullptr;
634
635 rectangle = new GHOST_Rect();
636 window->getClientBounds(*rectangle);
637
638 return (GHOST_RectangleHandle)rectangle;
639}
640
641void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle)
642{
643 delete (GHOST_Rect *)rectanglehandle;
644}
645
646GHOST_TSuccess GHOST_SetClientWidth(GHOST_WindowHandle windowhandle, uint32_t width)
647{
648 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
649
650 return window->setClientWidth(width);
651}
652
653GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle, uint32_t height)
654{
655 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
656
657 return window->setClientHeight(height);
658}
659
660GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle,
661 uint32_t width,
662 uint32_t height)
663{
664 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
665
666 return window->setClientSize(width, height);
667}
668
670 GHOST_WindowHandle windowhandle, int32_t inX, int32_t inY, int32_t *outX, int32_t *outY)
671{
672 const GHOST_IWindow *window = (const GHOST_IWindow *)windowhandle;
673
674 window->screenToClient(inX, inY, *outX, *outY);
675}
676
678 GHOST_WindowHandle windowhandle, int32_t inX, int32_t inY, int32_t *outX, int32_t *outY)
679{
680 const GHOST_IWindow *window = (const GHOST_IWindow *)windowhandle;
681
682 window->clientToScreen(inX, inY, *outX, *outY);
683}
684
685GHOST_TWindowState GHOST_GetWindowState(GHOST_WindowHandle windowhandle)
686{
687 const GHOST_IWindow *window = (const GHOST_IWindow *)windowhandle;
688
689 return window->getState();
690}
691
693{
694 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
695
696 return window->setState(state);
697}
698
699GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhandle,
700 bool is_unsaved_changes)
701{
702 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
703
704 return window->setModifiedState(is_unsaved_changes);
705}
706
707GHOST_TSuccess GHOST_SetWindowOrder(GHOST_WindowHandle windowhandle, GHOST_TWindowOrder order)
708{
709 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
710
711 return window->setOrder(order);
712}
713
714GHOST_TSuccess GHOST_SwapWindowBufferAcquire(GHOST_WindowHandle windowhandle)
715{
716 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
717
718 return window->swapBufferAcquire();
719}
720
721GHOST_TSuccess GHOST_SwapWindowBufferRelease(GHOST_WindowHandle windowhandle)
722{
723 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
724
725 return window->swapBufferRelease();
726}
727
728GHOST_TSuccess GHOST_SetSwapInterval(GHOST_WindowHandle windowhandle, int interval)
729{
730 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
731
732 return window->setSwapInterval(interval);
733}
734
735GHOST_TSuccess GHOST_GetSwapInterval(GHOST_WindowHandle windowhandle, int *r_interval)
736{
737 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
738
739 return window->getSwapInterval(*r_interval);
740}
741
743{
744 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
745
746 return window->activateDrawingContext();
747}
748
749GHOST_TSuccess GHOST_ActivateGPUContext(GHOST_ContextHandle contexthandle)
750{
751 GHOST_IContext *context = (GHOST_IContext *)contexthandle;
752 if (context) {
753 return context->activateDrawingContext();
754 }
755 GHOST_PRINTF("%s: Context not valid\n", __func__);
756 return GHOST_kFailure;
757}
758
759GHOST_TSuccess GHOST_ReleaseGPUContext(GHOST_ContextHandle contexthandle)
760{
761 GHOST_IContext *context = (GHOST_IContext *)contexthandle;
762
763 return context->releaseDrawingContext();
764}
765
766GHOST_ContextHandle GHOST_GetActiveGPUContext()
767{
768 return (GHOST_ContextHandle)GHOST_IContext::getActiveDrawingContext();
769}
770
771uint GHOST_GetContextDefaultGPUFramebuffer(GHOST_ContextHandle contexthandle)
772{
773 GHOST_IContext *context = (GHOST_IContext *)contexthandle;
774
775 return context->getDefaultFramebuffer();
776}
777
778uint GHOST_GetDefaultGPUFramebuffer(GHOST_WindowHandle windowhandle)
779{
780 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
781
782 return window->getDefaultFramebuffer();
783}
784
785GHOST_TSuccess GHOST_InvalidateWindow(GHOST_WindowHandle windowhandle)
786{
787 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
788
789 return window->invalidate();
790}
791
792void GHOST_SetMultitouchGestures(GHOST_SystemHandle systemhandle, const bool use)
793{
794 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
795 system->setMultitouchGestures(use);
796}
797
798void GHOST_SetTabletAPI(GHOST_SystemHandle systemhandle, GHOST_TTabletAPI api)
799{
800 GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
801 system->setTabletAPI(api);
802}
803
805{
806 const GHOST_ISystem *system = GHOST_ISystem::getSystem();
807 return system->getPixelAtCursor(r_color);
808}
809
810int32_t GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle)
811{
812 return ((GHOST_Rect *)rectanglehandle)->getWidth();
813}
814
815int32_t GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle)
816{
817 return ((GHOST_Rect *)rectanglehandle)->getHeight();
818}
819
821 GHOST_RectangleHandle rectanglehandle, int32_t *l, int32_t *t, int32_t *r, int32_t *b)
822{
823 const GHOST_Rect *rect = (GHOST_Rect *)rectanglehandle;
824
825 *l = rect->l_;
826 *t = rect->t_;
827 *r = rect->r_;
828 *b = rect->b_;
829}
830
832 GHOST_RectangleHandle rectanglehandle, int32_t l, int32_t t, int32_t r, int32_t b)
833{
834 ((GHOST_Rect *)rectanglehandle)->set(l, t, r, b);
835}
836
837GHOST_TSuccess GHOST_IsEmptyRectangle(GHOST_RectangleHandle rectanglehandle)
838{
840
841 if (((GHOST_Rect *)rectanglehandle)->isEmpty()) {
843 }
844 return result;
845}
846
847GHOST_TSuccess GHOST_IsValidRectangle(GHOST_RectangleHandle rectanglehandle)
848{
850
851 if (((GHOST_Rect *)rectanglehandle)->isValid()) {
853 }
854 return result;
855}
856
857void GHOST_InsetRectangle(GHOST_RectangleHandle rectanglehandle, int32_t i)
858{
859 ((GHOST_Rect *)rectanglehandle)->inset(i);
860}
861
862void GHOST_UnionRectangle(GHOST_RectangleHandle rectanglehandle,
863 GHOST_RectangleHandle anotherrectanglehandle)
864{
865 ((GHOST_Rect *)rectanglehandle)->unionRect(*(GHOST_Rect *)anotherrectanglehandle);
866}
867
868void GHOST_UnionPointRectangle(GHOST_RectangleHandle rectanglehandle, int32_t x, int32_t y)
869{
870 ((GHOST_Rect *)rectanglehandle)->unionPoint(x, y);
871}
872
873GHOST_TSuccess GHOST_IsInsideRectangle(GHOST_RectangleHandle rectanglehandle, int32_t x, int32_t y)
874{
876
877 if (((GHOST_Rect *)rectanglehandle)->isInside(x, y)) {
879 }
880 return result;
881}
882
883GHOST_TVisibility GHOST_GetRectangleVisibility(GHOST_RectangleHandle rectanglehandle,
884 GHOST_RectangleHandle anotherrectanglehandle)
885{
887
888 visible = ((GHOST_Rect *)rectanglehandle)->getVisibility(*(GHOST_Rect *)anotherrectanglehandle);
889
890 return visible;
891}
892
893void GHOST_SetCenterRectangle(GHOST_RectangleHandle rectanglehandle, int32_t cx, int32_t cy)
894{
895 ((GHOST_Rect *)rectanglehandle)->setCenter(cx, cy);
896}
897
899 GHOST_RectangleHandle rectanglehandle, int32_t cx, int32_t cy, int32_t w, int32_t h)
900{
901 ((GHOST_Rect *)rectanglehandle)->setCenter(cx, cy, w, h);
902}
903
904GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle,
905 GHOST_RectangleHandle anotherrectanglehandle)
906{
908
909 if (((GHOST_Rect *)rectanglehandle)->clip(*(GHOST_Rect *)anotherrectanglehandle)) {
911 }
912 return result;
913}
914
915char *GHOST_getClipboard(bool selection)
916{
917 const GHOST_ISystem *system = GHOST_ISystem::getSystem();
918 return system->getClipboard(selection);
919}
920
921void GHOST_putClipboard(const char *buffer, bool selection)
922{
923 const GHOST_ISystem *system = GHOST_ISystem::getSystem();
924 system->putClipboard(buffer, selection);
925}
926
932
933uint *GHOST_getClipboardImage(int *r_width, int *r_height)
934{
935 const GHOST_ISystem *system = GHOST_ISystem::getSystem();
936 return system->getClipboardImage(r_width, r_height);
937}
938
939GHOST_TSuccess GHOST_putClipboardImage(uint *rgba, int width, int height)
940{
941 const GHOST_ISystem *system = GHOST_ISystem::getSystem();
942 return system->putClipboardImage(rgba, width, height);
943}
944
950
952{
954 return system->useNativePixel();
955}
956
962
964{
965 GHOST_ISystem::setBacktraceFn(backtrace_fn);
966}
967
968void GHOST_UseWindowFrame(bool use_window_frame)
969{
970 GHOST_ISystem::setUseWindowFrame(use_window_frame);
971}
972
973void GHOST_UseWindowFocus(bool use_focus)
974{
976 system->useWindowFocus(use_focus);
977}
978
979void GHOST_SetAutoFocus(bool auto_focus)
980{
982 system->setAutoFocus(auto_focus);
983}
984
985float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle)
986{
987 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
988 if (window) {
989 return window->getNativePixelSize();
990 }
991 return 1.0f;
992}
993
994uint16_t GHOST_GetDPIHint(GHOST_WindowHandle windowhandle)
995{
996 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
997 return window->getDPIHint();
998}
999
1000#ifdef WITH_INPUT_IME
1001
1002void GHOST_BeginIME(
1003 GHOST_WindowHandle windowhandle, int32_t x, int32_t y, int32_t w, int32_t h, bool complete)
1004{
1005 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
1006 window->beginIME(x, y, w, h, complete);
1007}
1008
1009void GHOST_EndIME(GHOST_WindowHandle windowhandle)
1010{
1011 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
1012 window->endIME();
1013}
1014
1015#endif /* WITH_INPUT_IME */
1016
1017#ifdef WITH_XR_OPENXR
1018
1019# define GHOST_XR_CAPI_CALL(call, ctx) \
1020 try { \
1021 call; \
1022 } \
1023 catch (GHOST_XrException & e) { \
1024 (ctx)->dispatchErrorMessage(&e); \
1025 }
1026
1027# define GHOST_XR_CAPI_CALL_RET(call, ctx) \
1028 try { \
1029 return call; \
1030 } \
1031 catch (GHOST_XrException & e) { \
1032 (ctx)->dispatchErrorMessage(&e); \
1033 }
1034
1035void GHOST_XrSessionStart(GHOST_XrContextHandle xr_contexthandle,
1036 const GHOST_XrSessionBeginInfo *begin_info)
1037{
1038 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1039 GHOST_XR_CAPI_CALL(xr_context->startSession(begin_info), xr_context);
1040}
1041
1042void GHOST_XrSessionEnd(GHOST_XrContextHandle xr_contexthandle)
1043{
1044 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1045 GHOST_XR_CAPI_CALL(xr_context->endSession(), xr_context);
1046}
1047
1048void GHOST_XrSessionDrawViews(GHOST_XrContextHandle xr_contexthandle, void *draw_customdata)
1049{
1050 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1051 GHOST_XR_CAPI_CALL(xr_context->drawSessionViews(draw_customdata), xr_context);
1052}
1053
1054int GHOST_XrSessionIsRunning(const GHOST_XrContextHandle xr_contexthandle)
1055{
1056 const GHOST_IXrContext *xr_context = (const GHOST_IXrContext *)xr_contexthandle;
1057 GHOST_XR_CAPI_CALL_RET(xr_context->isSessionRunning(), xr_context);
1058 return 0; /* Only reached if exception is thrown. */
1059}
1060
1061void GHOST_XrGraphicsContextBindFuncs(GHOST_XrContextHandle xr_contexthandle,
1062 GHOST_XrGraphicsContextBindFn bind_fn,
1063 GHOST_XrGraphicsContextUnbindFn unbind_fn)
1064{
1065 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1066 GHOST_XR_CAPI_CALL(xr_context->setGraphicsContextBindFuncs(bind_fn, unbind_fn), xr_context);
1067}
1068
1069void GHOST_XrDrawViewFunc(GHOST_XrContextHandle xr_contexthandle, GHOST_XrDrawViewFn draw_view_fn)
1070{
1071 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1072 GHOST_XR_CAPI_CALL(xr_context->setDrawViewFunc(draw_view_fn), xr_context);
1073}
1074
1075void GHOST_XrPassthroughEnabledFunc(GHOST_XrContextHandle xr_contexthandle,
1076 GHOST_XrPassthroughEnabledFn passthrough_enabled_fn)
1077{
1078 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1079 GHOST_XR_CAPI_CALL(xr_context->setPassthroughEnabledFunc(passthrough_enabled_fn), xr_context);
1080}
1081
1082void GHOST_XrDisablePassthroughFunc(GHOST_XrContextHandle xr_contexthandle,
1083 GHOST_XrDisablePassthroughFn disable_passthrough_fn)
1084{
1085 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1086 GHOST_XR_CAPI_CALL(xr_context->setDisablePassthroughFunc(disable_passthrough_fn), xr_context);
1087}
1088
1089int GHOST_XrSessionNeedsUpsideDownDrawing(const GHOST_XrContextHandle xr_contexthandle)
1090{
1091 const GHOST_IXrContext *xr_context = (const GHOST_IXrContext *)xr_contexthandle;
1092
1093 GHOST_XR_CAPI_CALL_RET(xr_context->needsUpsideDownDrawing(), xr_context);
1094 return 0; /* Only reached if exception is thrown. */
1095}
1096
1097int GHOST_XrCreateActionSet(GHOST_XrContextHandle xr_contexthandle,
1098 const GHOST_XrActionSetInfo *info)
1099{
1100 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1101 GHOST_XrSession *xr_session = xr_context->getSession();
1102 GHOST_XR_CAPI_CALL_RET(xr_session->createActionSet(*info), xr_context);
1103 return 0;
1104}
1105
1106void GHOST_XrDestroyActionSet(GHOST_XrContextHandle xr_contexthandle, const char *action_set_name)
1107{
1108 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1109 GHOST_XrSession *xr_session = xr_context->getSession();
1110 GHOST_XR_CAPI_CALL(xr_session->destroyActionSet(action_set_name), xr_context);
1111}
1112
1113int GHOST_XrCreateActions(GHOST_XrContextHandle xr_contexthandle,
1114 const char *action_set_name,
1115 uint32_t count,
1116 const GHOST_XrActionInfo *infos)
1117{
1118 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1119 GHOST_XrSession *xr_session = xr_context->getSession();
1120 GHOST_XR_CAPI_CALL_RET(xr_session->createActions(action_set_name, count, infos), xr_context);
1121 return 0;
1122}
1123
1124void GHOST_XrDestroyActions(GHOST_XrContextHandle xr_contexthandle,
1125 const char *action_set_name,
1126 uint32_t count,
1127 const char *const *action_names)
1128{
1129 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1130 GHOST_XrSession *xr_session = xr_context->getSession();
1131 GHOST_XR_CAPI_CALL(xr_session->destroyActions(action_set_name, count, action_names), xr_context);
1132}
1133
1134int GHOST_XrCreateActionBindings(GHOST_XrContextHandle xr_contexthandle,
1135 const char *action_set_name,
1136 uint32_t count,
1137 const GHOST_XrActionProfileInfo *infos)
1138{
1139 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1140 GHOST_XrSession *xr_session = xr_context->getSession();
1141 GHOST_XR_CAPI_CALL_RET(xr_session->createActionBindings(action_set_name, count, infos),
1142 xr_context);
1143 return 0;
1144}
1145
1146void GHOST_XrDestroyActionBindings(GHOST_XrContextHandle xr_contexthandle,
1147 const char *action_set_name,
1148 uint32_t count,
1149 const char *const *action_names,
1150 const char *const *profile_paths)
1151{
1152 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1153 GHOST_XrSession *xr_session = xr_context->getSession();
1154 GHOST_XR_CAPI_CALL(
1155 xr_session->destroyActionBindings(action_set_name, count, action_names, profile_paths),
1156 xr_context);
1157}
1158
1159int GHOST_XrAttachActionSets(GHOST_XrContextHandle xr_contexthandle)
1160{
1161 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1162 GHOST_XrSession *xr_session = xr_context->getSession();
1163 GHOST_XR_CAPI_CALL_RET(xr_session->attachActionSets(), xr_context);
1164 return 0;
1165}
1166
1167int GHOST_XrSyncActions(GHOST_XrContextHandle xr_contexthandle, const char *action_set_name)
1168{
1169 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1170 GHOST_XrSession *xr_session = xr_context->getSession();
1171 GHOST_XR_CAPI_CALL_RET(xr_session->syncActions(action_set_name), xr_context);
1172 return 0;
1173}
1174
1175int GHOST_XrApplyHapticAction(GHOST_XrContextHandle xr_contexthandle,
1176 const char *action_set_name,
1177 const char *action_name,
1178 const char *subaction_path,
1179 const int64_t *duration,
1180 const float *frequency,
1181 const float *amplitude)
1182{
1183 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1184 GHOST_XrSession *xr_session = xr_context->getSession();
1185 GHOST_XR_CAPI_CALL_RET(
1186 xr_session->applyHapticAction(
1187 action_set_name, action_name, subaction_path, *duration, *frequency, *amplitude),
1188 xr_context);
1189 return 0;
1190}
1191
1192void GHOST_XrStopHapticAction(GHOST_XrContextHandle xr_contexthandle,
1193 const char *action_set_name,
1194 const char *action_name,
1195 const char *subaction_path)
1196{
1197 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1198 GHOST_XrSession *xr_session = xr_context->getSession();
1199 GHOST_XR_CAPI_CALL(xr_session->stopHapticAction(action_set_name, action_name, subaction_path),
1200 xr_context);
1201}
1202
1203void *GHOST_XrGetActionSetCustomdata(GHOST_XrContextHandle xr_contexthandle,
1204 const char *action_set_name)
1205{
1206 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1207 GHOST_XrSession *xr_session = xr_context->getSession();
1208 GHOST_XR_CAPI_CALL_RET(xr_session->getActionSetCustomdata(action_set_name), xr_context);
1209 return nullptr;
1210}
1211
1212void *GHOST_XrGetActionCustomdata(GHOST_XrContextHandle xr_contexthandle,
1213 const char *action_set_name,
1214 const char *action_name)
1215{
1216 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1217 GHOST_XrSession *xr_session = xr_context->getSession();
1218 GHOST_XR_CAPI_CALL_RET(xr_session->getActionCustomdata(action_set_name, action_name),
1219 xr_context);
1220 return nullptr;
1221}
1222
1223uint GHOST_XrGetActionCount(GHOST_XrContextHandle xr_contexthandle, const char *action_set_name)
1224{
1225 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1226 GHOST_XrSession *xr_session = xr_context->getSession();
1227 GHOST_XR_CAPI_CALL_RET(xr_session->getActionCount(action_set_name), xr_context);
1228 return 0;
1229}
1230
1231void GHOST_XrGetActionCustomdataArray(GHOST_XrContextHandle xr_contexthandle,
1232 const char *action_set_name,
1233 void **r_customdata_array)
1234{
1235 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1236 GHOST_XrSession *xr_session = xr_context->getSession();
1237 GHOST_XR_CAPI_CALL(xr_session->getActionCustomdataArray(action_set_name, r_customdata_array),
1238 xr_context);
1239}
1240
1241int GHOST_XrLoadControllerModel(GHOST_XrContextHandle xr_contexthandle, const char *subaction_path)
1242{
1243 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1244 GHOST_XrSession *xr_session = xr_context->getSession();
1245 GHOST_XR_CAPI_CALL_RET(xr_session->loadControllerModel(subaction_path), xr_context);
1246 return 0;
1247}
1248
1249void GHOST_XrUnloadControllerModel(GHOST_XrContextHandle xr_contexthandle,
1250 const char *subaction_path)
1251{
1252 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1253 GHOST_XrSession *xr_session = xr_context->getSession();
1254 GHOST_XR_CAPI_CALL(xr_session->unloadControllerModel(subaction_path), xr_context);
1255}
1256
1257int GHOST_XrUpdateControllerModelComponents(GHOST_XrContextHandle xr_contexthandle,
1258 const char *subaction_path)
1259{
1260 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1261 GHOST_XrSession *xr_session = xr_context->getSession();
1262 GHOST_XR_CAPI_CALL_RET(xr_session->updateControllerModelComponents(subaction_path), xr_context);
1263 return 0;
1264}
1265
1266int GHOST_XrGetControllerModelData(GHOST_XrContextHandle xr_contexthandle,
1267 const char *subaction_path,
1268 GHOST_XrControllerModelData *r_data)
1269{
1270 GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
1271 GHOST_XrSession *xr_session = xr_context->getSession();
1272 GHOST_XR_CAPI_CALL_RET(xr_session->getControllerModelData(subaction_path, *r_data), xr_context);
1273 return 0;
1274}
1275
1276#endif /* WITH_XR_OPENXR */
1277
1278#ifdef WITH_VULKAN_BACKEND
1279
1280void GHOST_GetVulkanHandles(GHOST_ContextHandle contexthandle, GHOST_VulkanHandles *r_handles)
1281{
1282 GHOST_IContext *context = (GHOST_IContext *)contexthandle;
1283 context->getVulkanHandles(*r_handles);
1284}
1285
1286void GHOST_SetVulkanSwapBuffersCallbacks(
1287 GHOST_ContextHandle contexthandle,
1288 void (*swap_buffer_draw_callback)(const GHOST_VulkanSwapChainData *),
1289 void (*swap_buffer_acquired_callback)(void),
1290 void (*openxr_acquire_image_callback)(GHOST_VulkanOpenXRData *),
1291 void (*openxr_release_image_callback)(GHOST_VulkanOpenXRData *))
1292{
1293 GHOST_IContext *context = (GHOST_IContext *)contexthandle;
1294 context->setVulkanSwapBuffersCallbacks(swap_buffer_draw_callback,
1295 swap_buffer_acquired_callback,
1296 openxr_acquire_image_callback,
1297 openxr_release_image_callback);
1298}
1299
1300void GHOST_GetVulkanSwapChainFormat(GHOST_WindowHandle windowhandle,
1301 GHOST_VulkanSwapChainData *r_swap_chain_data)
1302{
1303 GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
1304 window->getVulkanSwapChainFormat(r_swap_chain_data);
1305}
1306
1307#endif /* WITH_VULKAN_BACKEND */
unsigned int uint
GHOST_TSuccess GHOST_IsInsideRectangle(GHOST_RectangleHandle rectanglehandle, int32_t x, int32_t y)
GHOST_TWindowState GHOST_GetWindowState(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_putClipboardImage(uint *rgba, int width, int height)
int32_t GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle)
GHOST_TSuccess GHOST_GetPixelAtCursor(float r_color[3])
GHOST_TVisibility GHOST_GetRectangleVisibility(GHOST_RectangleHandle rectanglehandle, GHOST_RectangleHandle anotherrectanglehandle)
GHOST_TSuccess GHOST_GetCursorPosition(const GHOST_SystemHandle systemhandle, const GHOST_WindowHandle windowhandle, int32_t *x, int32_t *y)
GHOST_ContextHandle GHOST_CreateGPUContext(GHOST_SystemHandle systemhandle, GHOST_GPUSettings gpu_settings)
GHOST_TSuccess GHOST_SetWindowOrder(GHOST_WindowHandle windowhandle, GHOST_TWindowOrder order)
GHOST_TUserDataPtr GHOST_GetWindowUserData(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_SwapWindowBufferRelease(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle, uint32_t width, uint32_t height)
GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle, int32_t x, int32_t y)
void GHOST_ShowMessageBox(GHOST_SystemHandle systemhandle, const char *title, const char *message, const char *help_label, const char *continue_label, const char *link, GHOST_DialogOptions dialog_options)
void GHOST_UnionRectangle(GHOST_RectangleHandle rectanglehandle, GHOST_RectangleHandle anotherrectanglehandle)
void GHOST_SetWindowDecorationStyleSettings(GHOST_WindowHandle windowhandle, GHOST_WindowDecorationStyleSettings decoration_settings)
void GHOST_ClientToScreen(GHOST_WindowHandle windowhandle, int32_t inX, int32_t inY, int32_t *outX, int32_t *outY)
GHOST_WindowHandle GHOST_GetWindowUnderCursor(GHOST_SystemHandle systemhandle, int32_t x, int32_t y)
GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback, GHOST_TUserDataPtr user_data)
GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle, GHOST_EventConsumerHandle consumerhandle)
GHOST_TSuccess GHOST_GetAllDisplayDimensions(GHOST_SystemHandle systemhandle, uint32_t *r_width, uint32_t *r_height)
GHOST_TimerProcPtr GHOST_GetTimerProc(GHOST_TimerTaskHandle timertaskhandle)
uint GHOST_GetContextDefaultGPUFramebuffer(GHOST_ContextHandle contexthandle)
void GHOST_SetRectangleCenter(GHOST_RectangleHandle rectanglehandle, int32_t cx, int32_t cy, int32_t w, int32_t h)
GHOST_TSuccess GHOST_SetCustomCursorGenerator(GHOST_WindowHandle windowhandle, GHOST_CursorGenerator *cursor_generator)
GHOST_TSuccess GHOST_hasClipboardImage()
GHOST_TSuccess GHOST_RemoveEventConsumer(GHOST_SystemHandle systemhandle, GHOST_EventConsumerHandle consumerhandle)
uint16_t GHOST_GetDPIHint(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_IsEmptyRectangle(GHOST_RectangleHandle rectanglehandle)
uint GHOST_GetDefaultGPUFramebuffer(GHOST_WindowHandle windowhandle)
uint32_t GHOST_GetCursorPreferredLogicalSize(const GHOST_SystemHandle systemhandle)
GHOST_TSuccess GHOST_SwapWindowBufferAcquire(GHOST_WindowHandle windowhandle)
void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle)
GHOST_TSuccess GHOST_SetPath(GHOST_WindowHandle windowhandle, const char *filepath)
void GHOST_UseWindowFocus(bool use_focus)
bool GHOST_ProcessEvents(GHOST_SystemHandle systemhandle, bool waitForEvent)
void GHOST_SetTitle(GHOST_WindowHandle windowhandle, const char *title)
void GHOST_SetWindowDecorationStyleFlags(GHOST_WindowHandle windowhandle, GHOST_TWindowDecorationStyleFlags style_flags)
GHOST_TStandardCursor GHOST_GetCursorShape(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_ReleaseGPUContext(GHOST_ContextHandle contexthandle)
GHOST_TSuccess GHOST_SetClientWidth(GHOST_WindowHandle windowhandle, uint32_t width)
GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle, uint32_t height)
GHOST_ContextHandle GHOST_GetActiveGPUContext()
const char * GHOST_SystemBackend()
void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle, int32_t inX, int32_t inY, int32_t *outX, int32_t *outY)
GHOST_TSuccess GHOST_SetCursorShape(GHOST_WindowHandle windowhandle, GHOST_TStandardCursor cursorshape)
GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle, GHOST_RectangleHandle anotherrectanglehandle)
GHOST_TSuccess GHOST_DisposeEventConsumer(GHOST_EventConsumerHandle consumerhandle)
char * GHOST_getClipboard(bool selection)
GHOST_RectangleHandle GHOST_GetWindowBounds(GHOST_WindowHandle windowhandle)
uint64_t GHOST_GetEventTime(GHOST_EventHandle eventhandle)
GHOST_TSuccess GHOST_SetProgressBar(GHOST_WindowHandle windowhandle, float progress)
GHOST_TUserDataPtr GHOST_GetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle)
GHOST_SystemHandle GHOST_CreateSystem()
GHOST_SystemHandle GHOST_CreateSystemBackground()
void GHOST_SetAutoFocus(bool auto_focus)
GHOST_TSuccess GHOST_InvalidateWindow(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle, GHOST_TGrabCursorMode mode, GHOST_TAxisFlag wrap_axis, const int bounds[4], const int mouse_ungrab_xy[2])
GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
bool GHOST_setConsoleWindowState(GHOST_TConsoleWindowState action)
void GHOST_SetTimerProc(GHOST_TimerTaskHandle timertaskhandle, GHOST_TimerProcPtr timerproc)
GHOST_TSuccess GHOST_ActivateGPUContext(GHOST_ContextHandle contexthandle)
void GHOST_SetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle, GHOST_TUserDataPtr user_data)
GHOST_TSuccess GHOST_SetWindowState(GHOST_WindowHandle windowhandle, GHOST_TWindowState state)
void GHOST_SetBacktraceHandler(GHOST_TBacktraceFn backtrace_fn)
GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhandle, bool is_unsaved_changes)
GHOST_TSuccess GHOST_RemoveTimer(GHOST_SystemHandle systemhandle, GHOST_TimerTaskHandle timertaskhandle)
int32_t GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle)
void GHOST_SetTabletAPI(GHOST_SystemHandle systemhandle, GHOST_TTabletAPI api)
void GHOST_GetCursorGrabState(GHOST_WindowHandle windowhandle, GHOST_TGrabCursorMode *r_mode, GHOST_TAxisFlag *r_axis_flag, int r_bounds[4], bool *r_use_software_cursor)
GHOST_TSuccess GHOST_GetCursorBitmap(GHOST_WindowHandle windowhandle, GHOST_CursorBitmapRef *bitmap)
void GHOST_SetCenterRectangle(GHOST_RectangleHandle rectanglehandle, int32_t cx, int32_t cy)
GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle, const uint8_t *bitmap, const uint8_t *mask, const int size[2], const int hot_spot[2], bool can_invert_color)
void GHOST_SetMultitouchGestures(GHOST_SystemHandle systemhandle, const bool use)
GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle)
bool GHOST_GetCursorVisibility(GHOST_WindowHandle windowhandle)
GHOST_WindowHDRInfo GHOST_WindowGetHDRInfo(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle, bool visible)
uint * GHOST_getClipboardImage(int *r_width, int *r_height)
GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle, GHOST_TModifierKey mask, bool *r_is_down)
bool GHOST_ValidWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle)
GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle)
bool GHOST_IsDialogWindow(GHOST_WindowHandle windowhandle)
void GHOST_SystemInitDebug(GHOST_SystemHandle systemhandle, GHOST_Debug debug)
GHOST_TSuccess GHOST_ApplyWindowDecorationStyle(GHOST_WindowHandle windowhandle)
void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, bool can_accept)
void GHOST_putClipboard(const char *buffer, bool selection)
GHOST_ContextHandle GHOST_GetDrawingContext(GHOST_WindowHandle windowhandle)
void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle, GHOST_TUserDataPtr user_data)
GHOST_TCapabilityFlag GHOST_GetCapabilities()
GHOST_WindowHandle GHOST_GetEventWindow(GHOST_EventHandle eventhandle)
void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle, int32_t *l, int32_t *t, int32_t *r, int32_t *b)
GHOST_TWindowDecorationStyleFlags GHOST_GetWindowDecorationStyleFlags(GHOST_WindowHandle windowhandle)
char * GHOST_GetTitle(GHOST_WindowHandle windowhandle)
bool GHOST_UseNativePixels()
GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle parent_windowhandle, const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, bool is_dialog, GHOST_GPUSettings gpu_settings)
GHOST_TDrawingContextType GHOST_GetDrawingContextType(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_HasCursorShape(GHOST_WindowHandle windowhandle, GHOST_TStandardCursor cursorshape)
GHOST_TSuccess GHOST_IsValidRectangle(GHOST_RectangleHandle rectanglehandle)
void GHOST_DispatchEvents(GHOST_SystemHandle systemhandle)
void GHOST_SetRectangle(GHOST_RectangleHandle rectanglehandle, int32_t l, int32_t t, int32_t r, int32_t b)
GHOST_TSuccess GHOST_SetDrawingContextType(GHOST_WindowHandle windowhandle, GHOST_TDrawingContextType type)
GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle)
GHOST_TSuccess GHOST_DisposeGPUContext(GHOST_SystemHandle systemhandle, GHOST_ContextHandle contexthandle)
GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle)
void GHOST_UseWindowFrame(bool use_window_frame)
GHOST_TSuccess GHOST_SetSwapInterval(GHOST_WindowHandle windowhandle, int interval)
GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle, uint64_t delay, uint64_t interval, GHOST_TimerProcPtr timerproc, GHOST_TUserDataPtr user_data)
void GHOST_InsetRectangle(GHOST_RectangleHandle rectanglehandle, int32_t i)
GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle)
uint8_t GHOST_GetNumDisplays(GHOST_SystemHandle systemhandle)
uint64_t GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle)
void GHOST_UnionPointRectangle(GHOST_RectangleHandle rectanglehandle, int32_t x, int32_t y)
bool GHOST_GetValid(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_GetSwapInterval(GHOST_WindowHandle windowhandle, int *r_interval)
GHOST_TSuccess GHOST_GetButtonState(GHOST_SystemHandle systemhandle, GHOST_TButton mask, bool *r_is_down)
GHOST_TSuccess GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle, uint32_t *r_width, uint32_t *r_height)
GHOST C-API function and type declarations.
void GHOST_BeginIME(GHOST_WindowHandle windowhandle, int32_t x, int32_t y, int32_t w, int32_t h, bool complete)
bool(*)(GHOST_EventHandle event, GHOST_TUserDataPtr user_data) GHOST_EventCallbackProcPtr
Definition GHOST_C-api.h:22
void GHOST_EndIME(GHOST_WindowHandle windowhandle)
#define GHOST_PRINTF(x,...)
GHOST_TWindowState
void * GHOST_TUserDataPtr
Definition GHOST_Types.h:55
GHOST_TStandardCursor
GHOST_TEventType
GHOST_TCapabilityFlag
GHOST_TVisibility
@ GHOST_kNotVisible
GHOST_TAxisFlag
void(* GHOST_TimerProcPtr)(struct GHOST_TimerTaskHandle__ *task, uint64_t time)
const void * GHOST_TEventDataPtr
GHOST_TDrawingContextType
GHOST_TWindowOrder
GHOST_TModifierKey
GHOST_TSuccess
Definition GHOST_Types.h:57
@ GHOST_kFailure
Definition GHOST_Types.h:57
@ GHOST_kSuccess
Definition GHOST_Types.h:57
void(* GHOST_TBacktraceFn)(void *file_handle)
Definition GHOST_Types.h:53
GHOST_TGrabCursorMode
GHOST_TButton
GHOST_TConsoleWindowState
GHOST_TTabletAPI
GHOST_DialogOptions
GHOST_TWindowDecorationStyleFlags
ATTR_WARN_UNUSED_RESULT const BMLoop * l
virtual bool isInside(const btVector3 &pt, btScalar tolerance) const
long long int int64_t
unsigned long long int uint64_t
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
Definition btDbvt.cpp:299
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
static GHOST_IContext * getActiveDrawingContext()
virtual GHOST_TEventType getType() const =0
virtual GHOST_TEventDataPtr getData() const =0
virtual GHOST_IWindow * getWindow() const =0
virtual uint64_t getTime() const =0
static GHOST_ISystem * getSystem()
virtual void putClipboard(const char *buffer, bool selection) const =0
virtual GHOST_TSuccess getModifierKeyState(GHOST_TModifierKey mask, bool &is_down) const =0
static void setUseWindowFrame(bool use_window_frame)
static void setBacktraceFn(GHOST_TBacktraceFn backtrace_fn)
virtual GHOST_TSuccess showMessageBox(const char *, const char *, const char *, const char *, const char *, GHOST_DialogOptions) const =0
virtual void initDebug(GHOST_Debug debug)=0
virtual void setTabletAPI(GHOST_TTabletAPI api)=0
virtual char * getClipboard(bool selection) const =0
virtual GHOST_TSuccess setCursorPositionClientRelative(GHOST_IWindow *window, int32_t x, int32_t y)=0
virtual void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const =0
virtual GHOST_TSuccess hasClipboardImage() const =0
virtual bool validWindow(GHOST_IWindow *window)=0
virtual GHOST_TSuccess getCursorPosition(int32_t &x, int32_t &y) const =0
virtual GHOST_IWindow * createWindow(const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, GHOST_GPUSettings gpu_settings, const bool exclusive=false, const bool is_dialog=false, const GHOST_IWindow *parent_window=nullptr)=0
virtual void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const =0
virtual uint * getClipboardImage(int *r_width, int *r_height) const =0
virtual GHOST_IContext * createOffscreenContext(GHOST_GPUSettings gpu_settings)=0
virtual GHOST_TSuccess addEventConsumer(GHOST_IEventConsumer *consumer)=0
virtual GHOST_ITimerTask * installTimer(uint64_t delay, uint64_t interval, GHOST_TimerProcPtr timer_proc, GHOST_TUserDataPtr user_data=nullptr)=0
virtual void useWindowFocus(const bool use_focus)=0
virtual GHOST_TSuccess disposeContext(GHOST_IContext *context)=0
virtual GHOST_TSuccess removeTimer(GHOST_ITimerTask *timerTask)=0
virtual bool useNativePixel()=0
static GHOST_TSuccess createSystem(bool verbose, bool background)
static GHOST_TSuccess disposeSystem()
virtual uint8_t getNumDisplays() const =0
virtual void setMultitouchGestures(const bool use)=0
virtual bool setConsoleWindowState(GHOST_TConsoleWindowState action)=0
virtual void dispatchEvents()=0
static const char * getSystemBackend()
virtual GHOST_TCapabilityFlag getCapabilities() const =0
virtual uint32_t getCursorPreferredLogicalSize() const =0
virtual GHOST_TSuccess putClipboardImage(uint *rgba, int width, int height) const =0
virtual GHOST_TSuccess getButtonState(GHOST_TButton mask, bool &is_down) const =0
virtual void setAutoFocus(const bool auto_focus)=0
virtual GHOST_TSuccess getCursorPositionClientRelative(const GHOST_IWindow *window, int32_t &x, int32_t &y) const =0
virtual uint64_t getMilliSeconds() const =0
virtual GHOST_TSuccess disposeWindow(GHOST_IWindow *window)=0
virtual GHOST_TSuccess setCursorPosition(int32_t x, int32_t y)=0
virtual GHOST_TSuccess removeEventConsumer(GHOST_IEventConsumer *consumer)=0
virtual GHOST_TSuccess getPixelAtCursor(float r_color[3]) const =0
virtual GHOST_IWindow * getWindowUnderCursor(int32_t x, int32_t y)=0
virtual bool processEvents(bool waitForEvent)=0
static GHOST_TSuccess createSystemBackground()
virtual GHOST_TUserDataPtr getUserData() const =0
virtual void setUserData(const GHOST_TUserDataPtr user_data)=0
virtual GHOST_TimerProcPtr getTimerProc() const =0
virtual void setTimerProc(const GHOST_TimerProcPtr timer_proc)=0
virtual void setTitle(const char *title)=0
virtual void getClientBounds(GHOST_Rect &bounds) const =0
virtual GHOST_TSuccess activateDrawingContext()=0
virtual GHOST_TSuccess getCursorBitmap(GHOST_CursorBitmapRef *bitmap)=0
virtual GHOST_TSuccess endProgressBar()=0
virtual GHOST_TSuccess setCursorShape(GHOST_TStandardCursor cursor_shape)=0
virtual void setWindowDecorationStyleSettings(GHOST_WindowDecorationStyleSettings decoration_settings)=0
virtual GHOST_TSuccess setOrder(GHOST_TWindowOrder order)=0
virtual void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const =0
virtual GHOST_TSuccess setClientHeight(uint32_t height)=0
virtual GHOST_TSuccess setProgressBar(float progress)=0
virtual GHOST_TSuccess setCustomCursorShape(const uint8_t *bitmap, const uint8_t *mask, const int size[2], const int hot_spot[2], bool can_invert_color)=0
virtual GHOST_TSuccess swapBufferRelease()=0
virtual bool isDialog() const =0
virtual GHOST_WindowHDRInfo getHDRInfo()=0
virtual std::string getTitle() const =0
virtual GHOST_TSuccess setClientSize(uint32_t width, uint32_t height)=0
virtual GHOST_TSuccess applyWindowDecorationStyle()=0
virtual GHOST_TSuccess setState(GHOST_TWindowState state)=0
virtual GHOST_TSuccess setClientWidth(uint32_t width)=0
virtual float getNativePixelSize()=0
virtual GHOST_IContext * getDrawingContext()=0
virtual GHOST_TSuccess setCursorVisibility(bool visible)=0
virtual GHOST_TSuccess getSwapInterval(int &interval_out)=0
virtual void getCursorGrabState(GHOST_TGrabCursorMode &mode, GHOST_TAxisFlag &axis_flag, GHOST_Rect &bounds, bool &use_software_cursor)=0
virtual void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const =0
virtual GHOST_TSuccess swapBufferAcquire()=0
virtual void getWindowBounds(GHOST_Rect &bounds) const =0
virtual void setUserData(const GHOST_TUserDataPtr user_data)=0
virtual bool getCursorVisibility() const =0
virtual GHOST_TSuccess setPath(const char *filepath)=0
virtual GHOST_TWindowDecorationStyleFlags getWindowDecorationStyleFlags()=0
virtual void setAcceptDragOperation(bool can_accept)=0
virtual GHOST_TSuccess setDrawingContextType(GHOST_TDrawingContextType type)=0
virtual bool getValid() const =0
virtual GHOST_TSuccess setSwapInterval(int interval)=0
virtual GHOST_TUserDataPtr getUserData() const =0
virtual void setWindowDecorationStyleFlags(GHOST_TWindowDecorationStyleFlags style_flags)=0
virtual GHOST_TSuccess invalidate()=0
virtual GHOST_TDrawingContextType getDrawingContextType()=0
virtual GHOST_TSuccess setCustomCursorGenerator(GHOST_CursorGenerator *cursor_generator)=0
virtual GHOST_TStandardCursor getCursorShape() const =0
virtual uint16_t getDPIHint()=0
virtual GHOST_TWindowState getState() const =0
virtual GHOST_TSuccess setCursorGrab(GHOST_TGrabCursorMode, GHOST_TAxisFlag, GHOST_Rect *, int32_t[2])
virtual GHOST_TSuccess setModifiedState(bool is_unsaved_changes)=0
virtual unsigned int getDefaultFramebuffer()=0
virtual GHOST_TSuccess hasCursorShape(GHOST_TStandardCursor cursor_shape)=0
virtual void endSession()=0
virtual GHOST_XrSession * getSession()=0
virtual void setDisablePassthroughFunc(GHOST_XrDisablePassthroughFn disable_passthrough_fn)=0
virtual void startSession(const GHOST_XrSessionBeginInfo *begin_info)=0
virtual void setPassthroughEnabledFunc(GHOST_XrPassthroughEnabledFn passthrough_enabled_fn)=0
virtual bool needsUpsideDownDrawing() const =0
virtual void setGraphicsContextBindFuncs(GHOST_XrGraphicsContextBindFn bind_fn, GHOST_XrGraphicsContextUnbindFn unbind_fn)=0
virtual void drawSessionViews(void *draw_customdata)=0
virtual bool isSessionRunning() const =0
virtual void setDrawViewFunc(GHOST_XrDrawViewFn draw_view_fn)=0
int32_t t_
int32_t r_
int32_t b_
int32_t l_
void destroyActionBindings(const char *action_set_name, uint32_t count, const char *const *action_names, const char *const *profile_paths)
void destroyActionSet(const char *action_set_name)
bool createActionSet(const GHOST_XrActionSetInfo &info)
void * getActionCustomdata(const char *action_set_name, const char *action_name)
void unloadControllerModel(const char *subaction_path)
void * getActionSetCustomdata(const char *action_set_name)
bool updateControllerModelComponents(const char *subaction_path)
bool createActionBindings(const char *action_set_name, uint32_t count, const GHOST_XrActionProfileInfo *infos)
void stopHapticAction(const char *action_set_name, const char *action_name, const char *subaction_path)
void getActionCustomdataArray(const char *action_set_name, void **r_customdata_array)
bool loadControllerModel(const char *subaction_path)
bool syncActions(const char *action_set_name=nullptr)
void destroyActions(const char *action_set_name, uint32_t count, const char *const *action_names)
bool applyHapticAction(const char *action_set_name, const char *action_name, const char *subaction_path, const int64_t &duration, const float &frequency, const float &amplitude)
uint32_t getActionCount(const char *action_set_name)
bool getControllerModelData(const char *subaction_path, GHOST_XrControllerModelData &r_data)
bool createActions(const char *action_set_name, uint32_t count, const GHOST_XrActionInfo *infos)
uint top
int count
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
static ulong state[N]
static int left
int context(const bContext *C, const char *member, bContextDataResult *result)
i
Definition text_draw.cc:230