21 #if defined(WIN32) || defined(__APPLE__)
49 printf(
"timer1, time=%d\n", (
int)
time);
53 GLfloat inner_radius, GLfloat outer_radius, GLfloat
width, GLint teeth, GLfloat tooth_depth)
59 const double pi = 3.14159264;
62 r1 = (
float)(outer_radius - tooth_depth / 2.0);
63 r2 = (
float)(outer_radius + tooth_depth / 2.0);
65 da = (
float)(2.0 * pi / teeth / 4.0);
72 for (i = 0; i <= teeth; i++) {
79 (
float)(
width * 0.5));
85 da = (
float)(2.0 * pi / teeth / 4.0);
86 for (i = 0; i < teeth; i++) {
92 (
float)(
width * 0.5));
95 (
float)(
width * 0.5));
103 for (i = 0; i <= teeth; i++) {
109 (
float)(-
width * 0.5));
116 da = (
float)(2.0 * pi / teeth / 4.0);
117 for (i = 0; i < teeth; i++) {
121 (
float)(-
width * 0.5));
124 (
float)(-
width * 0.5));
133 for (i = 0; i < teeth; i++) {
149 (
float)(
width * 0.5));
152 (
float)(-
width * 0.5));
158 (
float)(
width * 0.5));
161 (
float)(-
width * 0.5));
172 for (i = 0; i <= teeth; i++) {
183 static GLfloat
pos[4] = {5.0f, 5.0f, 10.0f, 1.0f};
184 static GLfloat ared[4] = {0.8f, 0.1f, 0.0f, 1.0f};
185 static GLfloat agreen[4] = {0.0f, 0.8f, 0.2f, 1.0f};
186 static GLfloat ablue[4] = {0.2f, 0.2f, 1.0f, 1.0f};
197 gearGL(1.0f, 4.0f, 1.0f, 20, 0.7f);
201 gearGL(0.5f, 2.0f, 2.0f, 10, 0.7f);
205 gearGL(1.3f, 2.0f, 0.5f, 10, 0.7f);
215 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
247 GHOST_RectangleHandle hRect =
NULL;
266 glClearColor(.2f, 0.0f, 0.0f, 0.0f);
267 glClear(GL_COLOR_BUFFER_BIT);
286 case GHOST_kEventCursorButton:
293 if (wheelData->
z > 0) {
306 switch (keyData->
key) {
363 char *ntitle = malloc(strlen(title) + 2);
365 sprintf(ntitle,
"%s-", title);
413 int main(
int argc,
char **argv)
416 char *title1 =
"gears - main window";
417 char *title2 =
"gears - secondary window";
438 printf(
"could not create main window\n");
455 printf(
"could not create secondary window\n");
490 GHOST_WindowHandle hWindow =
NULL;
typedef float(TangentPoint)[2]
void BLI_kdtree_nd_() free(KDTree *tree)
static void gearsTimerProc(GHOST_TimerTaskHandle task, uint64_t time)
static GHOST_WindowHandle sFullScreenWindow
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 void testTimerProc(GHOST_TimerTaskHandle task, uint64_t time)
static GHOST_TimerTaskHandle sGearsTimer
static int sExitRequested
static void drawGearGL(int id)
static GHOST_TStandardCursor sCursor
static GHOST_WindowHandle sSecondaryWindow
bool processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData)
GHOST C-API function and type declarations.
char * GHOST_GetTitle(GHOST_WindowHandle windowhandle)
int32_t GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle)
bool GHOST_GetFullScreen(GHOST_SystemHandle systemhandle)
GHOST_WindowHandle GHOST_BeginFullScreen(GHOST_SystemHandle systemhandle, GHOST_DisplaySetting *setting, const bool stereoVisual)
GHOST_SystemHandle GHOST_CreateSystem(void)
GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle, GHOST_EventConsumerHandle consumerhandle)
void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle)
bool GHOST_ProcessEvents(GHOST_SystemHandle systemhandle, bool waitForEvent)
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)
int32_t GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle)
GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle, uint64_t delay, uint64_t interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData)
GHOST_TSuccess GHOST_SwapWindowBuffers(GHOST_WindowHandle windowhandle)
GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle)
bool GHOST_GetCursorVisibility(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle, bool visible)
GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle)
bool GHOST_ValidWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle)
GHOST_WindowHandle GHOST_GetEventWindow(GHOST_EventHandle eventhandle)
void GHOST_DispatchEvents(GHOST_SystemHandle systemhandle)
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_TDrawingContextType type, GHOST_GLSettings glSettings)
GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback, GHOST_TUserDataPtr userdata)
GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle)
@ GHOST_kWindowStateNormal
void * GHOST_TUserDataPtr
@ GHOST_kStandardCursorFirstCursor
@ GHOST_kStandardCursorNumCursors
@ GHOST_kEventWindowClose
@ GHOST_kEventWindowActivate
@ GHOST_kEventWindowUpdate
@ GHOST_kEventWindowDeactivate
@ 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::@179::@181 task
unsigned __int64 uint64_t