37 #if defined(WIN32) || defined(__APPLE__)
65 printf(
"timer1, time=%d\n", (
int)
time);
69 GLfloat inner_radius, GLfloat outer_radius, GLfloat
width, GLint teeth, GLfloat tooth_depth)
75 const double pi = 3.14159264;
78 r1 = (
float)(outer_radius - tooth_depth / 2.0);
79 r2 = (
float)(outer_radius + tooth_depth / 2.0);
81 da = (
float)(2.0 * pi / teeth / 4.0);
88 for (i = 0; i <= teeth; i++) {
95 (
float)(
width * 0.5));
101 da = (
float)(2.0 * pi / teeth / 4.0);
102 for (i = 0; i < teeth; i++) {
108 (
float)(
width * 0.5));
111 (
float)(
width * 0.5));
119 for (i = 0; i <= teeth; i++) {
125 (
float)(-
width * 0.5));
132 da = (
float)(2.0 * pi / teeth / 4.0);
133 for (i = 0; i < teeth; i++) {
137 (
float)(-
width * 0.5));
140 (
float)(-
width * 0.5));
149 for (i = 0; i < teeth; i++) {
165 (
float)(
width * 0.5));
168 (
float)(-
width * 0.5));
174 (
float)(
width * 0.5));
177 (
float)(-
width * 0.5));
188 for (i = 0; i <= teeth; i++) {
199 static GLfloat
pos[4] = {5.0f, 5.0f, 10.0f, 1.0f};
200 static GLfloat ared[4] = {0.8f, 0.1f, 0.0f, 1.0f};
201 static GLfloat agreen[4] = {0.0f, 0.8f, 0.2f, 1.0f};
202 static GLfloat ablue[4] = {0.2f, 0.2f, 1.0f, 1.0f};
213 gearGL(1.0f, 4.0f, 1.0f, 20, 0.7f);
217 gearGL(0.5f, 2.0f, 2.0f, 10, 0.7f);
221 gearGL(1.3f, 2.0f, 0.5f, 10, 0.7f);
231 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
263 GHOST_RectangleHandle hRect =
NULL;
282 glClearColor(.2f, 0.0f, 0.0f, 0.0f);
283 glClear(GL_COLOR_BUFFER_BIT);
302 case GHOST_kEventCursorButton:
309 if (wheelData->
z > 0) {
322 switch (keyData->
key) {
379 char *ntitle = malloc(strlen(title) + 2);
381 sprintf(ntitle,
"%s-", title);
429 int main(
int argc,
char **argv)
432 char *title1 =
"gears - main window";
433 char *title2 =
"gears - secondary window";
454 printf(
"could not create main window\n");
471 printf(
"could not create secondary window\n");
506 GHOST_WindowHandle hWindow =
NULL;
typedef float(TangentPoint)[2]
void BLI_kdtree_nd_() free(KDTree *tree)
int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData)
static GHOST_WindowHandle sFullScreenWindow
static void gearsTimerProc(GHOST_TimerTaskHandle task, GHOST_TUns64 time)
static GHOST_SystemHandle shSystem
int main(int argc, char **argv)
static GHOST_WindowHandle sMainWindow
static void gearGL(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, GLint teeth, GLfloat tooth_depth)
static void setViewPortGL(GHOST_WindowHandle hWindow)
static GHOST_TimerTaskHandle sTestTimer
static GHOST_TimerTaskHandle sGearsTimer
static int sExitRequested
static void testTimerProc(GHOST_TimerTaskHandle task, GHOST_TUns64 time)
static void drawGearGL(int id)
static GHOST_TStandardCursor sCursor
static GHOST_WindowHandle sSecondaryWindow
GHOST C-API function and type declarations.
int GHOST_GetFullScreen(GHOST_SystemHandle systemhandle)
int GHOST_ProcessEvents(GHOST_SystemHandle systemhandle, int waitForEvent)
char * GHOST_GetTitle(GHOST_WindowHandle windowhandle)
GHOST_TInt32 GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle)
GHOST_SystemHandle GHOST_CreateSystem(void)
GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle, GHOST_EventConsumerHandle consumerhandle)
GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle, int visible)
GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle parent_windowhandle, const char *title, GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, bool is_dialog, GHOST_TDrawingContextType type, GHOST_GLSettings glSettings)
void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle)
void GHOST_SetTitle(GHOST_WindowHandle windowhandle, const char *title)
GHOST_TSuccess GHOST_SetCursorShape(GHOST_WindowHandle windowhandle, GHOST_TStandardCursor cursorshape)
GHOST_TUserDataPtr GHOST_GetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle)
GHOST_TSuccess GHOST_EndFullScreen(GHOST_SystemHandle systemhandle)
GHOST_TSuccess GHOST_InvalidateWindow(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_RemoveTimer(GHOST_SystemHandle systemhandle, GHOST_TimerTaskHandle timertaskhandle)
GHOST_TInt32 GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle)
GHOST_TSuccess GHOST_SwapWindowBuffers(GHOST_WindowHandle windowhandle)
GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle)
GHOST_WindowHandle GHOST_BeginFullScreen(GHOST_SystemHandle systemhandle, GHOST_DisplaySetting *setting, const int stereoVisual)
GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle)
GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle)
GHOST_WindowHandle GHOST_GetEventWindow(GHOST_EventHandle eventhandle)
GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle, GHOST_TUns64 delay, GHOST_TUns64 interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData)
void GHOST_DispatchEvents(GHOST_SystemHandle systemhandle)
GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback, GHOST_TUserDataPtr userdata)
GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle)
int GHOST_GetCursorVisibility(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle)
int GHOST_ValidWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
@ GHOST_kWindowStateNormal
void * GHOST_TUserDataPtr
@ 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
_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
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
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