32 #if defined(WIN32) || defined(__APPLE__)
76 std::cout <<
"timer1, time=" << (int)
time <<
"\n";
80 GLfloat inner_radius, GLfloat outer_radius, GLfloat
width, GLint teeth, GLfloat tooth_depth)
88 r1 = outer_radius - tooth_depth / 2.0;
89 r2 = outer_radius + tooth_depth / 2.0;
91 const double pi = 3.14159264;
92 da = 2.0 * pi / teeth / 4.0;
99 for (i = 0; i <= teeth; i++) {
100 angle = i * 2.0 * pi / teeth;
110 da = 2.0 * pi / teeth / 4.0;
111 for (i = 0; i < teeth; i++) {
112 angle = i * 2.0 * pi / teeth;
124 for (i = 0; i <= teeth; i++) {
125 angle = i * 2.0 * pi / teeth;
135 da = 2.0 * pi / teeth / 4.0;
136 for (i = 0; i < teeth; i++) {
137 angle = i * 2.0 * pi / teeth;
147 for (i = 0; i < teeth; i++) {
148 angle = i * 2.0 * pi / teeth;
177 for (i = 0; i <= teeth; i++) {
178 angle = i * 2.0 * pi / teeth;
188 static GLfloat
pos[4] = {5.0f, 5.0f, 10.0f, 1.0f};
189 static GLfloat ared[4] = {0.8f, 0.1f, 0.0f, 1.0f};
190 static GLfloat agreen[4] = {0.0f, 0.8f, 0.2f, 1.0f};
191 static GLfloat ablue[4] = {0.2f, 0.2f, 1.0f, 1.0f};
202 gearGL(1.0f, 4.0f, 1.0f, 20, 0.7f);
206 gearGL(0.5f, 2.0f, 2.0f, 10, 0.7f);
210 gearGL(1.3f, 2.0f, 0.5f, 10, 0.7f);
251 int noOfScanlines = 0, lowerScanline = 0;
253 int verticalBlankingInterval = 32;
255 float nearplane, farplane, zeroPlane,
distance;
256 float eyeSeparation = 0.62f;
267 noOfScanlines = (bnds.
getHeight() - verticalBlankingInterval) / 2;
271 lowerScanline = bnds.
getHeight() - noOfScanlines;
285 glViewport(0, lowerScanline, bnds.
getWidth(), noOfScanlines);
308 -eyeSeparation / 2.0);
319 eyeSeparation / 2.0);
336 glClearColor(.2f, 0.0f, 0.0f, 0.0f);
372 float xmid, ymid, clip_near, clip_far, topw, bottomw, leftw, rightw, dx, dy, n_over_d;
380 clip_near = dist + zero_plane - nearplane;
381 clip_far = dist + zero_plane - farplane;
383 n_over_d = clip_near / dist;
385 topw = n_over_d * dy / 2.0;
387 rightw = n_over_d * (dx / 2.0 - eye);
388 leftw = n_over_d * (-dx / 2.0 - eye);
392 glFrustum(leftw, rightw, bottomw, topw, clip_near, clip_far);
418 m_secondaryWindow(0),
419 m_fullScreenWindow(0),
423 m_exitRequested(false),
440 std::cout <<
"could not create main window\n";
454 std::cout <<
"could not create secondary window\n";
482 case GHOST_kEventCursorButton:
483 std::cout <<
"GHOST_kEventCursorButton";
486 std::cout <<
"GHOST_kEventCursorMove";
491 if (wheelData->
z > 0) {
504 switch (keyData->
key) {
516 int x = 200,
y = 200;
546 std::cout <<
"left shift down\n";
550 std::cout <<
"right shift down\n";
554 std::cout <<
"left Alt down\n";
558 std::cout <<
"right Alt down\n";
562 std::cout <<
"left control down\n";
566 std::cout <<
"right control down\n";
633 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
684 lresult = regkey.Open(HKEY_LOCAL_MACHINE,
685 "SOFTWARE\\NVIDIA Corporation\\Global\\Stereo3D\\StereoEnable",
688 if (lresult == ERROR_SUCCESS)
689 printf(
"Successfully opened key\n");
691 lresult = regkey.QueryValue(&keyValue,
"StereoEnable");
692 if (lresult == ERROR_SUCCESS)
693 printf(
"Successfully queried key\n");
695 lresult = regkey.SetValue(
696 HKEY_LOCAL_MACHINE,
"SOFTWARE\\NVIDIA Corporation\\Global\\Stereo3D\\StereoEnable",
"1");
697 if (lresult == ERROR_SUCCESS)
698 printf(
"Successfully set value for key\n");
700 if (lresult == ERROR_SUCCESS)
701 printf(
"Successfully closed key\n");
static GHOST_ISystem * fSystem
static void gearsTimerProc(GHOST_ITimerTask *task, GHOST_TUns64 time)
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 bool nVidiaWindows
static void testTimerProc(GHOST_ITimerTask *, GHOST_TUns64 time)
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
unsigned long long GHOST_TUns64
@ GHOST_kEventWindowClose
@ GHOST_kEventWheel
Mouse button event.
@ GHOST_kEventWindowActivate
@ GHOST_kEventWindowUpdate
@ GHOST_kEventWindowDeactivate
@ GHOST_kEventKeyDown
Trackpad event.
@ 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 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 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 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 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_IWindow * createWindow(const char *title, GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 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 addEventConsumer(GHOST_IEventConsumer *consumer)=0
virtual GHOST_TSuccess removeTimer(GHOST_ITimerTask *timerTask)=0
static GHOST_TSuccess disposeSystem()
virtual bool getFullScreen(void)=0
virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y)=0
static GHOST_TSuccess createSystem()
virtual void dispatchEvents()=0
virtual GHOST_ITimerTask * installTimer(GHOST_TUns64 delay, GHOST_TUns64 interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData=NULL)=0
virtual GHOST_TSuccess endFullScreen(void)=0
virtual GHOST_TSuccess getModifierKeyState(GHOST_TModifierKeyMask mask, bool &isDown) const =0
virtual GHOST_TSuccess disposeWindow(GHOST_IWindow *window)=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 GHOST_TInt32 getWidth() const
virtual GHOST_TInt32 getHeight() 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::@172::@174 task
ccl_device_inline float distance(const float2 &a, const float2 &b)