Blender V4.3
GHOST_Test.cpp
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
13#include <iostream>
14#include <math.h>
15#include <string>
16
17#if defined(WIN32) || defined(__APPLE__)
18# ifdef WIN32
19# include <atlbase.h>
20# include <windows.h>
21
22# include <GL/gl.h>
23# else // WIN32 \
24 // __APPLE__ is defined
25# include <AGL/gl.h>
26# endif // WIN32
27#else // defined(WIN32) || defined(__APPLE__)
28# include <GL/gl.h>
29#endif // defined(WIN32) || defined(__APPLE__)
30
31#include "GHOST_Rect.hh"
32
33#include "GHOST_IEvent.hh"
35#include "GHOST_ISystem.hh"
36
37#define LEFT_EYE 0
38#define RIGHT_EYE 1
39
40static bool nVidiaWindows; // very dirty but hey, it's for testing only
41
42static void gearsTimerProc(GHOST_ITimerTask *task, uint64_t time);
43
44static class Application *fApp;
45static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
46static GLfloat fAngle = 0.0;
48
49void StereoProjection(float left,
50 float right,
51 float bottom,
52 float top,
53 float nearplane,
54 float farplane,
55 float zero_plane,
56 float dist,
57 float eye);
58
59static void testTimerProc(GHOST_ITimerTask * /*task*/, uint64_t time)
60{
61 std::cout << "timer1, time=" << int(time) << "\n";
62}
63
64static void gearGL(
65 GLfloat inner_radius, GLfloat outer_radius, GLfloat width, GLint teeth, GLfloat tooth_depth)
66{
67 GLint i;
68 GLfloat r0, r1, r2;
69 GLfloat angle, da;
70 GLfloat u, v, len;
71
72 r0 = inner_radius;
73 r1 = outer_radius - tooth_depth / 2.0;
74 r2 = outer_radius + tooth_depth / 2.0;
75
76 const double pi = 3.14159264;
77 da = 2.0 * pi / teeth / 4.0;
78
79 glShadeModel(GL_FLAT);
80 glNormal3f(0.0, 0.0, 1.0);
81
82 /* draw front face */
83 glBegin(GL_QUAD_STRIP);
84 for (i = 0; i <= teeth; i++) {
85 angle = i * 2.0 * pi / teeth;
86 glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
87 glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
88 glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
89 glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
90 }
91 glEnd();
92
93 /* draw front sides of teeth */
94 glBegin(GL_QUADS);
95 da = 2.0 * pi / teeth / 4.0;
96 for (i = 0; i < teeth; i++) {
97 angle = i * 2.0 * pi / teeth;
98 glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
99 glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
100 glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
101 glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
102 }
103 glEnd();
104
105 glNormal3f(0.0, 0.0, -1.0);
106
107 /* draw back face */
108 glBegin(GL_QUAD_STRIP);
109 for (i = 0; i <= teeth; i++) {
110 angle = i * 2.0 * pi / teeth;
111 glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
112 glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
113 glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
114 glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
115 }
116 glEnd();
117
118 /* draw back sides of teeth */
119 glBegin(GL_QUADS);
120 da = 2.0 * pi / teeth / 4.0;
121 for (i = 0; i < teeth; i++) {
122 angle = i * 2.0 * pi / teeth;
123 glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
124 glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
125 glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
126 glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
127 }
128 glEnd();
129
130 /* draw outward faces of teeth */
131 glBegin(GL_QUAD_STRIP);
132 for (i = 0; i < teeth; i++) {
133 angle = i * 2.0 * pi / teeth;
134 glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
135 glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
136 u = r2 * cos(angle + da) - r1 * cos(angle);
137 v = r2 * sin(angle + da) - r1 * sin(angle);
138 len = sqrt(u * u + v * v);
139 u /= len;
140 v /= len;
141 glNormal3f(v, -u, 0.0);
142 glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
143 glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
144 glNormal3f(cos(angle), sin(angle), 0.0);
145 glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
146 glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
147 u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
148 v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
149 glNormal3f(v, -u, 0.0);
150 glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
151 glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
152 glNormal3f(cos(angle), sin(angle), 0.0);
153 }
154 glVertex3f(r1 * cos(0.0), r1 * sin(0.0), width * 0.5);
155 glVertex3f(r1 * cos(0.0), r1 * sin(0.0), -width * 0.5);
156 glEnd();
157
158 glShadeModel(GL_SMOOTH);
159
160 /* draw inside radius cylinder */
161 glBegin(GL_QUAD_STRIP);
162 for (i = 0; i <= teeth; i++) {
163 angle = i * 2.0 * pi / teeth;
164 glNormal3f(-cos(angle), -sin(angle), 0.0);
165 glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
166 glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
167 }
168 glEnd();
169}
170
171static void drawGearGL(int id)
172{
173 static GLfloat pos[4] = {5.0f, 5.0f, 10.0f, 1.0f};
174 static GLfloat ared[4] = {0.8f, 0.1f, 0.0f, 1.0f};
175 static GLfloat agreen[4] = {0.0f, 0.8f, 0.2f, 1.0f};
176 static GLfloat ablue[4] = {0.2f, 0.2f, 1.0f, 1.0f};
177
178 glLightfv(GL_LIGHT0, GL_POSITION, pos);
179 glEnable(GL_CULL_FACE);
180 glEnable(GL_LIGHTING);
181 glEnable(GL_LIGHT0);
182 glEnable(GL_DEPTH_TEST);
183
184 switch (id) {
185 case 1:
186 glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, ared);
187 gearGL(1.0f, 4.0f, 1.0f, 20, 0.7f);
188 break;
189 case 2:
190 glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, agreen);
191 gearGL(0.5f, 2.0f, 2.0f, 10, 0.7f);
192 break;
193 case 3:
194 glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, ablue);
195 gearGL(1.3f, 2.0f, 0.5f, 10, 0.7f);
196 break;
197 default:
198 break;
199 }
200 glEnable(GL_NORMALIZE);
201}
202
204{
205 glRotatef(view_rotx, 1.0, 0.0, 0.0);
206 glRotatef(view_roty, 0.0, 1.0, 0.0);
207 glRotatef(view_rotz, 0.0, 0.0, 1.0);
208}
209
211{
212 glPushMatrix();
213 glTranslatef(-3.0, -2.0, 0.0);
214 glRotatef(fAngle, 0.0, 0.0, 1.0);
215 drawGearGL(1);
216 glPopMatrix();
217
218 glPushMatrix();
219 glTranslatef(3.1f, -2.0f, 0.0f);
220 glRotatef(-2.0 * fAngle - 9.0, 0.0, 0.0, 1.0);
221 drawGearGL(2);
222 glPopMatrix();
223
224 glPushMatrix();
225 glTranslatef(-3.1f, 2.2f, -1.8f);
226 glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
227 glRotatef(2.0 * fAngle - 2.0, 0.0, 0.0, 1.0);
228 drawGearGL(3);
229 glPopMatrix();
230}
231
232static void View(GHOST_IWindow *window, bool stereo, int eye = 0)
233{
234 window->activateDrawingContext();
235 GHOST_Rect bnds;
236 int noOfScanlines = 0, lowerScanline = 0;
237 /* hard coded for testing purposes, display device dependent */
238 int verticalBlankingInterval = 32;
239 float left, right, bottom, top;
240 float nearplane, farplane, zeroPlane, distance;
241 float eyeSeparation = 0.62f;
242 window->getClientBounds(bnds);
243
244 // viewport
245 if (stereo) {
246 if (nVidiaWindows) {
247 // handled by nVidia driver so act as normal (explicitly put here since
248 // it -is- stereo)
249 glViewport(0, 0, bnds.getWidth(), bnds.getHeight());
250 }
251 else { // generic cross platform above-below stereo
252 noOfScanlines = (bnds.getHeight() - verticalBlankingInterval) / 2;
253 switch (eye) {
254 case LEFT_EYE:
255 // upper half of window
256 lowerScanline = bnds.getHeight() - noOfScanlines;
257 break;
258 case RIGHT_EYE:
259 // lower half of window
260 lowerScanline = 0;
261 break;
262 }
263 }
264 }
265 else {
266 noOfScanlines = bnds.getHeight();
267 lowerScanline = 0;
268 }
269
270 glViewport(0, lowerScanline, bnds.getWidth(), noOfScanlines);
271
272 // projection
273 left = -6.0;
274 right = 6.0;
275 bottom = -4.8f;
276 top = 4.8f;
277 nearplane = 5.0;
278 farplane = 60.0;
279
280 if (stereo) {
281 zeroPlane = 0.0;
282 distance = 14.5;
283 switch (eye) {
284 case LEFT_EYE:
285 StereoProjection(left,
286 right,
287 bottom,
288 top,
289 nearplane,
290 farplane,
291 zeroPlane,
292 distance,
293 -eyeSeparation / 2.0);
294 break;
295 case RIGHT_EYE:
296 StereoProjection(left,
297 right,
298 bottom,
299 top,
300 nearplane,
301 farplane,
302 zeroPlane,
303 distance,
304 eyeSeparation / 2.0);
305 break;
306 }
307 }
308 else {
309 // left = -w;
310 // right = w;
311 // bottom = -h;
312 // top = h;
313 glMatrixMode(GL_PROJECTION);
314 glLoadIdentity();
315 glFrustum(left, right, bottom, top, 5.0, 60.0);
316 glMatrixMode(GL_MODELVIEW);
317 glLoadIdentity();
318 glTranslatef(0.0, 0.0, -40.0);
319 }
320
321 glClearColor(.2f, 0.0f, 0.0f, 0.0f);
322}
323
324void StereoProjection(float left,
325 float right,
326 float bottom,
327 float top,
328 float nearplane,
329 float farplane,
330 float zero_plane,
331 float dist,
332 float eye)
333/* Perform the perspective projection for one eye's sub-field.
334 * The projection is in the direction of the negative z axis.
335 *
336 * -6.0, 6.0, -4.8, 4.8,
337 * left, right, bottom, top = the coordinate range, in the plane of zero
338 * parallax setting, which will be displayed on the screen. The
339 * ratio between (right-left) and (top-bottom) should equal the aspect
340 * ratio of the display.
341 *
342 * 6.0, -6.0,
343 * near, far = the z-coordinate values of the clipping planes.
344 *
345 * 0.0,
346 * zero_plane = the z-coordinate of the plane of zero parallax setting.
347 *
348 * 14.5,
349 * dist = the distance from the center of projection to the plane
350 * of zero parallax.
351 *
352 * -0.31
353 * eye = half the eye separation; positive for the right eye sub-field,
354 * negative for the left eye sub-field.
355 */
356{
357 float xmid, ymid, clip_near, clip_far, topw, bottomw, leftw, rightw, dx, dy, n_over_d;
358
359 dx = right - left;
360 dy = top - bottom;
361
362 xmid = (right + left) / 2.0;
363 ymid = (top + bottom) / 2.0;
364
365 clip_near = dist + zero_plane - nearplane;
366 clip_far = dist + zero_plane - farplane;
367
368 n_over_d = clip_near / dist;
369
370 topw = n_over_d * dy / 2.0;
371 bottomw = -topw;
372 rightw = n_over_d * (dx / 2.0 - eye);
373 leftw = n_over_d * (-dx / 2.0 - eye);
374
375 /* Need to be in projection mode for this. */
376 glLoadIdentity();
377 glFrustum(leftw, rightw, bottomw, topw, clip_near, clip_far);
378
379 glTranslatef(-xmid - eye, -ymid, -zero_plane - dist);
380}
381
398
400 : m_system(system),
401 m_mainWindow(0),
402 m_secondaryWindow(0),
403 m_fullScreenWindow(0),
404 m_gearsTimer(0),
405 m_testTimer(0),
407 m_exitRequested(false),
408 stereo(false)
409{
410 GHOST_GPUSettings gpuSettings = {0};
411 gpuSettings.context_type = GHOST_kDrawingContextTypeOpenGL;
412 fApp = this;
413
414 // Create the main window
415 m_mainWindow = system->createWindow(
416 "gears - main window", 10, 64, 320, 200, GHOST_kWindowStateNormal, gpuSettings);
417
418 if (!m_mainWindow) {
419 std::cout << "could not create main window\n";
420 exit(-1);
421 }
422
423 // Create a secondary window
425 "gears - secondary window", 340, 64, 320, 200, GHOST_kWindowStateNormal, gpuSettings);
426 if (!m_secondaryWindow) {
427 std::cout << "could not create secondary window\n";
428 exit(-1);
429 }
430
431 // Install a timer to have the gears running
432 m_gearsTimer = system->installTimer(0 /*delay*/, 20 /*interval*/, gearsTimerProc, m_mainWindow);
433}
434
445
447{
448 GHOST_IWindow *window = event->getWindow();
449 bool handled = true;
450
451 switch (event->getType()) {
452#if 0
454 break;
455 case GHOST_kEventCursorButton:
456 std::cout << "GHOST_kEventCursorButton";
457 break;
459 std::cout << "GHOST_kEventCursorMove";
460 break;
461#endif
462 case GHOST_kEventWheel: {
463 GHOST_TEventWheelData *wheelData = (GHOST_TEventWheelData *)event->getData();
464 if (wheelData->z > 0) {
465 view_rotz += 5.f;
466 }
467 else {
468 view_rotz -= 5.f;
469 }
470 break;
471 }
473 break;
474
475 case GHOST_kEventKeyDown: {
476 GHOST_TEventKeyData *keyData = (GHOST_TEventKeyData *)event->getData();
477 switch (keyData->key) {
478 case GHOST_kKeyC: {
479 int cursor = m_cursor;
480 cursor++;
481 if (cursor >= GHOST_kStandardCursorNumCursors) {
483 }
485 window->setCursorShape(m_cursor);
486 break;
487 }
488
489 case GHOST_kKeyE: {
490 int x = 200, y = 200;
492 break;
493 }
494
495 case GHOST_kKeyF:
496 if (!m_system->getFullScreen()) {
497 // Begin fullscreen mode
498 GHOST_DisplaySetting setting;
499
500 setting.bpp = 16;
501 setting.frequency = 50;
502 setting.xPixels = 640;
503 setting.yPixels = 480;
504 m_system->beginFullScreen(setting, &m_fullScreenWindow, false /* stereo flag */);
505 }
506 else {
509 }
510 break;
511
512 case GHOST_kKeyH:
513 window->setCursorVisibility(!window->getCursorVisibility());
514 break;
515
516 case GHOST_kKeyM: {
517 bool down = false;
519 if (down) {
520 std::cout << "left shift down\n";
521 }
523 if (down) {
524 std::cout << "right shift down\n";
525 }
527 if (down) {
528 std::cout << "left Alt down\n";
529 }
531 if (down) {
532 std::cout << "right Alt down\n";
533 }
535 if (down) {
536 std::cout << "left control down\n";
537 }
539 if (down) {
540 std::cout << "right control down\n";
541 }
542 break;
543 }
544
545 case GHOST_kKeyQ:
546 if (m_system->getFullScreen()) {
549 }
550 m_exitRequested = true;
551 break;
552
553 case GHOST_kKeyS: // toggle mono and stereo
554 if (stereo) {
555 stereo = false;
556 }
557 else {
558 stereo = true;
559 }
560 break;
561
562 case GHOST_kKeyT:
563 if (!m_testTimer) {
565 }
566
567 else {
569 m_testTimer = 0;
570 }
571
572 break;
573
574 case GHOST_kKeyW:
575 if (m_mainWindow) {
576 std::string title = m_mainWindow->getTitle();
577 title += "-";
578 m_mainWindow->setTitle(title);
579 }
580 break;
581
582 default:
583 break;
584 }
585 break;
586 }
587
589 GHOST_IWindow *window2 = event->getWindow();
590 if (window2 == m_mainWindow) {
591 m_exitRequested = true;
592 }
593 else {
594 m_system->disposeWindow(window2);
595 }
596 break;
597 }
598
600 handled = false;
601 break;
602
604 handled = false;
605 break;
606
608 GHOST_IWindow *window2 = event->getWindow();
609 if (!m_system->validWindow(window2)) {
610 break;
611 }
612
613 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
614
615 if (stereo) {
616 View(window2, stereo, LEFT_EYE);
617 glPushMatrix();
618 RenderCamera();
619 RenderScene();
620 glPopMatrix();
621
622 View(window2, stereo, RIGHT_EYE);
623 glPushMatrix();
624 RenderCamera();
625 RenderScene();
626 glPopMatrix();
627 }
628 else {
629 View(window2, stereo);
630 glPushMatrix();
631 RenderCamera();
632 RenderScene();
633 glPopMatrix();
634 }
635 window2->swapBuffers();
636 break;
637 }
638
639 default:
640 handled = false;
641 break;
642 }
643 return handled;
644}
645
646int main(int /*argc*/, char ** /*argv*/)
647{
648 nVidiaWindows = false;
649 // nVidiaWindows = true;
650
651#ifdef WIN32
652 /* Set a couple of settings in the registry for the nVidia detonator driver.
653 * So this is very specific...
654 */
655 if (nVidiaWindows) {
656 LONG lresult;
657 HKEY hkey = 0;
658 DWORD dwd = 0;
659 // unsigned char buffer[128];
660
661 CRegKey regkey;
662 // DWORD keyValue;
663 // lresult = regkey.Open(
664 // HKEY_LOCAL_MACHINE, "SOFTWARE\\NVIDIA Corporation\\Global\\Stereo3D\\StereoEnable");
665 lresult = regkey.Open(HKEY_LOCAL_MACHINE,
666 "SOFTWARE\\NVIDIA Corporation\\Global\\Stereo3D\\StereoEnable",
667 KEY_ALL_ACCESS);
668
669 if (lresult == ERROR_SUCCESS)
670 printf("Successfully opened key\n");
671# if 0
672 lresult = regkey.QueryValue(&keyValue, "StereoEnable");
673 if (lresult == ERROR_SUCCESS)
674 printf("Successfully queried key\n");
675# endif
676 lresult = regkey.SetValue(
677 HKEY_LOCAL_MACHINE, "SOFTWARE\\NVIDIA Corporation\\Global\\Stereo3D\\StereoEnable", "1");
678 if (lresult == ERROR_SUCCESS)
679 printf("Successfully set value for key\n");
680 regkey.Close();
681 if (lresult == ERROR_SUCCESS) {
682 printf("Successfully closed key\n");
683 }
684 // regkey.Write("2");
685 }
686#endif // WIN32
687
688 // Create the system
691
692 if (fSystem) {
693 // Create an application object
694 Application app(fSystem);
695
696 // Add the application as event consumer
698
699 // Enter main loop
700 while (!app.m_exitRequested) {
701 // printf("main: loop\n");
702 fSystem->processEvents(true);
704 }
705
706 // Remove so ghost doesn't do a double free
708 }
709
710 // Dispose the system
712
713 return 0;
714}
715
716static void gearsTimerProc(GHOST_ITimerTask *task, uint64_t /*time*/)
717{
718 fAngle += 2.0;
719 view_roty += 1.0;
720 GHOST_IWindow *window = (GHOST_IWindow *)task->getUserData();
722 // Running full screen
724 }
725 else {
726 if (fSystem->validWindow(window)) {
727 window->invalidate();
728 }
729 }
730}
sqrt(x)+1/max(0
static GLfloat fAngle
static void gearsTimerProc(GHOST_ITimerTask *task, uint64_t time)
static GHOST_ISystem * fSystem
void RenderScene()
static GLfloat view_roty
static GLfloat view_rotz
void StereoProjection(float left, float right, float bottom, float top, float nearplane, float farplane, float zero_plane, float dist, float eye)
static void gearGL(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, GLint teeth, GLfloat tooth_depth)
#define RIGHT_EYE
static void testTimerProc(GHOST_ITimerTask *, uint64_t time)
void RenderCamera()
static bool nVidiaWindows
#define LEFT_EYE
static GLfloat view_rotx
static void drawGearGL(int id)
static void View(GHOST_IWindow *window, bool stereo, int eye=0)
static class Application * fApp
@ GHOST_kWindowStateNormal
GHOST_TStandardCursor
#define GHOST_kStandardCursorNumCursors
@ GHOST_kEventWindowClose
@ GHOST_kEventWheel
@ GHOST_kEventCursorMove
@ GHOST_kEventWindowActivate
@ GHOST_kEventWindowUpdate
@ GHOST_kEventWindowDeactivate
@ GHOST_kEventKeyDown
@ GHOST_kEventUnknown
@ GHOST_kEventKeyUp
#define GHOST_kStandardCursorFirstCursor
@ GHOST_kKeyT
@ GHOST_kKeyW
@ GHOST_kKeyC
@ GHOST_kKeyQ
@ GHOST_kKeyF
@ GHOST_kKeyM
@ GHOST_kKeyS
@ GHOST_kKeyH
@ GHOST_kKeyE
@ GHOST_kModifierKeyRightControl
@ GHOST_kModifierKeyLeftControl
@ GHOST_kModifierKeyRightAlt
@ GHOST_kModifierKeyRightShift
@ GHOST_kModifierKeyLeftAlt
@ GHOST_kModifierKeyLeftShift
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
Definition IK_Math.h:125
ATTR_WARN_UNUSED_RESULT const BMVert * v
GHOST_IWindow * m_secondaryWindow
Application(GHOST_ISystem *system)
GHOST_TStandardCursor m_cursor
virtual bool processEvent(GHOST_IEvent *event)
GHOST_ITimerTask * m_testTimer
GHOST_IWindow * m_fullScreenWindow
GHOST_IWindow * m_mainWindow
bool m_exitRequested
GHOST_ITimerTask * m_gearsTimer
GHOST_ISystem * m_system
virtual GHOST_TEventType getType() const =0
virtual GHOST_TEventDataPtr getData() const =0
virtual GHOST_TSuccess endFullScreen()=0
static GHOST_ISystem * getSystem()
virtual GHOST_ITimerTask * installTimer(uint64_t delay, uint64_t interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData=nullptr)=0
virtual bool getFullScreen()=0
virtual bool validWindow(GHOST_IWindow *window)=0
virtual GHOST_TSuccess addEventConsumer(GHOST_IEventConsumer *consumer)=0
virtual GHOST_TSuccess getModifierKeyState(GHOST_TModifierKey mask, bool &isDown) const =0
virtual GHOST_TSuccess removeTimer(GHOST_ITimerTask *timerTask)=0
static GHOST_TSuccess createSystem(bool verbose, bool background)
static GHOST_TSuccess disposeSystem()
virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting &setting, GHOST_IWindow **window, const bool stereoVisual)=0
virtual void dispatchEvents()=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 gpuSettings, const bool exclusive=false, const bool is_dialog=false, const GHOST_IWindow *parentWindow=nullptr)=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 bool processEvents(bool waitForEvent)=0
virtual void setTitle(const char *title)=0
virtual void getClientBounds(GHOST_Rect &bounds) const =0
virtual GHOST_TSuccess activateDrawingContext()=0
virtual std::string getTitle() const =0
virtual GHOST_TSuccess setCursorShape(GHOST_TStandardCursor cursorShape)=0
virtual GHOST_TSuccess setCursorVisibility(bool visible)=0
virtual bool getCursorVisibility() const =0
virtual GHOST_TSuccess invalidate()=0
virtual GHOST_TSuccess swapBuffers()=0
virtual int32_t getHeight() const
virtual int32_t getWidth() const
#define printf
int len
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
uint top
ccl_device_inline float3 cos(float3 v)
static int left
int main()
float distance(float a, float b)
unsigned __int64 uint64_t
Definition stdint.h:90
GHOST_TDrawingContextType context_type