16 #if defined(WIN32) || defined(__APPLE__)
60 std::cout <<
"timer1, time=" << (int)
time <<
"\n";
64 GLfloat inner_radius, GLfloat outer_radius, GLfloat
width, GLint teeth, GLfloat tooth_depth)
72 r1 = outer_radius - tooth_depth / 2.0;
73 r2 = outer_radius + tooth_depth / 2.0;
75 const double pi = 3.14159264;
76 da = 2.0 * pi / teeth / 4.0;
83 for (i = 0; i <= teeth; i++) {
84 angle = i * 2.0 * pi / teeth;
94 da = 2.0 * pi / teeth / 4.0;
95 for (i = 0; i < teeth; i++) {
96 angle = i * 2.0 * pi / teeth;
108 for (i = 0; i <= teeth; i++) {
109 angle = i * 2.0 * pi / teeth;
119 da = 2.0 * pi / teeth / 4.0;
120 for (i = 0; i < teeth; i++) {
121 angle = i * 2.0 * pi / teeth;
131 for (i = 0; i < teeth; i++) {
132 angle = i * 2.0 * pi / teeth;
161 for (i = 0; i <= teeth; i++) {
162 angle = i * 2.0 * pi / teeth;
172 static GLfloat
pos[4] = {5.0f, 5.0f, 10.0f, 1.0f};
173 static GLfloat ared[4] = {0.8f, 0.1f, 0.0f, 1.0f};
174 static GLfloat agreen[4] = {0.0f, 0.8f, 0.2f, 1.0f};
175 static GLfloat ablue[4] = {0.2f, 0.2f, 1.0f, 1.0f};
186 gearGL(1.0f, 4.0f, 1.0f, 20, 0.7f);
190 gearGL(0.5f, 2.0f, 2.0f, 10, 0.7f);
194 gearGL(1.3f, 2.0f, 0.5f, 10, 0.7f);
235 int noOfScanlines = 0, lowerScanline = 0;
237 int verticalBlankingInterval = 32;
239 float nearplane, farplane, zeroPlane,
distance;
240 float eyeSeparation = 0.62f;
251 noOfScanlines = (bnds.
getHeight() - verticalBlankingInterval) / 2;
255 lowerScanline = bnds.
getHeight() - noOfScanlines;
269 glViewport(0, lowerScanline, bnds.
getWidth(), noOfScanlines);
292 -eyeSeparation / 2.0);
303 eyeSeparation / 2.0);
320 glClearColor(.2f, 0.0f, 0.0f, 0.0f);
356 float xmid, ymid, clip_near, clip_far, topw, bottomw, leftw, rightw, dx, dy, n_over_d;
364 clip_near = dist + zero_plane - nearplane;
365 clip_far = dist + zero_plane - farplane;
367 n_over_d = clip_near / dist;
369 topw = n_over_d * dy / 2.0;
371 rightw = n_over_d * (dx / 2.0 - eye);
372 leftw = n_over_d * (-dx / 2.0 - eye);
376 glFrustum(leftw, rightw, bottomw, topw, clip_near, clip_far);
401 m_secondaryWindow(0),
402 m_fullScreenWindow(0),
406 m_exitRequested(false),
423 std::cout <<
"could not create main window\n";
437 std::cout <<
"could not create secondary window\n";
465 case GHOST_kEventCursorButton:
466 std::cout <<
"GHOST_kEventCursorButton";
469 std::cout <<
"GHOST_kEventCursorMove";
474 if (wheelData->
z > 0) {
487 switch (keyData->
key) {
499 int x = 200,
y = 200;
529 std::cout <<
"left shift down\n";
533 std::cout <<
"right shift down\n";
537 std::cout <<
"left Alt down\n";
541 std::cout <<
"right Alt down\n";
545 std::cout <<
"left control down\n";
549 std::cout <<
"right control down\n";
616 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
667 lresult = regkey.Open(HKEY_LOCAL_MACHINE,
668 "SOFTWARE\\NVIDIA Corporation\\Global\\Stereo3D\\StereoEnable",
671 if (lresult == ERROR_SUCCESS)
672 printf(
"Successfully opened key\n");
674 lresult = regkey.QueryValue(&keyValue,
"StereoEnable");
675 if (lresult == ERROR_SUCCESS)
676 printf(
"Successfully queried key\n");
678 lresult = regkey.SetValue(
679 HKEY_LOCAL_MACHINE,
"SOFTWARE\\NVIDIA Corporation\\Global\\Stereo3D\\StereoEnable",
"1");
680 if (lresult == ERROR_SUCCESS)
681 printf(
"Successfully set value for key\n");
683 if (lresult == ERROR_SUCCESS)
684 printf(
"Successfully closed key\n");
static void gearsTimerProc(GHOST_ITimerTask *task, uint64_t time)
static GHOST_ISystem * fSystem
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)
static void testTimerProc(GHOST_ITimerTask *, uint64_t time)
static bool nVidiaWindows
static void drawGearGL(int id)
static void View(GHOST_IWindow *window, bool stereo, int eye=0)
static class Application * fApp
@ GHOST_kWindowStateNormal
@ GHOST_kStandardCursorFirstCursor
@ GHOST_kStandardCursorNumCursors
@ GHOST_kEventWindowClose
@ GHOST_kEventWindowActivate
@ GHOST_kEventWindowUpdate
@ GHOST_kEventWindowDeactivate
@ GHOST_kDrawingContextTypeOpenGL
@ GHOST_kModifierKeyRightControl
@ GHOST_kModifierKeyLeftControl
@ GHOST_kModifierKeyRightAlt
@ GHOST_kModifierKeyRightShift
@ GHOST_kModifierKeyLeftAlt
@ GHOST_kModifierKeyLeftShift
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble right
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble top
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble bottom
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
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
GHOST_ITimerTask * m_gearsTimer
virtual GHOST_TEventDataPtr getData()=0
virtual GHOST_TEventType getType()=0
static GHOST_ISystem * getSystem()
virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting &setting, GHOST_IWindow **window, const bool stereoVisual, const bool alphaBackground=0)=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 disposeSystem()
virtual bool getFullScreen(void)=0
static GHOST_TSuccess createSystem()
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_TDrawingContextType type, GHOST_GLSettings glSettings, const bool exclusive=false, const bool is_dialog=false, const GHOST_IWindow *parentWindow=NULL)=0
virtual GHOST_TSuccess endFullScreen(void)=0
virtual GHOST_ITimerTask * installTimer(uint64_t delay, uint64_t interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData=NULL)=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
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
struct blender::compositor::@179::@181 task
T distance(const T &a, const T &b)
unsigned __int64 uint64_t