Blender  V3.3
Macros | Functions | Variables
GHOST_C-Test.c File Reference
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "GHOST_C-api.h"
#include <GL/gl.h>

Go to the source code of this file.

Macros

#define FALSE   0
 

Functions

static void gearsTimerProc (GHOST_TimerTaskHandle task, uint64_t time)
 
bool processEvent (GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData)
 
static void testTimerProc (GHOST_TimerTaskHandle task, uint64_t time)
 
static void gearGL (GLfloat inner_radius, GLfloat outer_radius, GLfloat width, GLint teeth, GLfloat tooth_depth)
 
static void drawGearGL (int id)
 
static void drawGL (void)
 
static void setViewPortGL (GHOST_WindowHandle hWindow)
 
int main (int argc, char **argv)
 

Variables

static GLfloat view_rotx = 20.0
 
static GLfloat view_roty = 30.0
 
static GLfloat view_rotz = 0.0
 
static GLfloat fAngle = 0.0
 
static int sExitRequested = 0
 
static GHOST_SystemHandle shSystem = NULL
 
static GHOST_WindowHandle sMainWindow = NULL
 
static GHOST_WindowHandle sSecondaryWindow = NULL
 
static GHOST_TStandardCursor sCursor = GHOST_kStandardCursorFirstCursor
 
static GHOST_WindowHandle sFullScreenWindow = NULL
 
static GHOST_TimerTaskHandle sTestTimer
 
static GHOST_TimerTaskHandle sGearsTimer
 

Macro Definition Documentation

◆ FALSE

#define FALSE   0

Copyright (C) 2001 NaN Technologies B.V.

Simple test file for the GHOST library. The OpenGL gear code is taken from the Qt sample code which, in turn, is probably taken from somewhere as well.

Definition at line 17 of file GHOST_C-Test.c.

Function Documentation

◆ drawGearGL()

static void drawGearGL ( int  id)
static

Definition at line 181 of file GHOST_C-Test.c.

References gearGL(), glEnable, glLightfv, glMaterialfv, and pos.

Referenced by drawGL().

◆ drawGL()

static void drawGL ( void  )
static

Definition at line 213 of file GHOST_C-Test.c.

References drawGearGL(), fAngle, glPopMatrix, glPushMatrix, glRotatef, glTranslatef, view_rotx, view_roty, and view_rotz.

Referenced by processEvent().

◆ gearGL()

static void gearGL ( GLfloat  inner_radius,
GLfloat  outer_radius,
GLfloat  width,
GLint  teeth,
GLfloat  tooth_depth 
)
static

Definition at line 52 of file GHOST_C-Test.c.

References angle(), KDL::cos(), float(), glBegin, glEnd, glNormal3f, glShadeModel, glVertex3f, len, KDL::sin(), sqrt(), v, and width.

Referenced by drawGearGL().

◆ gearsTimerProc()

static void gearsTimerProc ( GHOST_TimerTaskHandle  task,
uint64_t  time 
)
static

◆ main()

int main ( int  argc,
char **  argv 
)

◆ processEvent()

bool processEvent ( GHOST_EventHandle  hEvent,
GHOST_TUserDataPtr  userData 
)

◆ setViewPortGL()

static void setViewPortGL ( GHOST_WindowHandle  hWindow)
static

◆ testTimerProc()

static void testTimerProc ( GHOST_TimerTaskHandle  task,
uint64_t  time 
)
static

Definition at line 47 of file GHOST_C-Test.c.

References time.

Referenced by processEvent().

Variable Documentation

◆ fAngle

GLfloat fAngle = 0.0
static

◆ sCursor

Definition at line 42 of file GHOST_C-Test.c.

Referenced by processEvent().

◆ sExitRequested

int sExitRequested = 0
static

Definition at line 38 of file GHOST_C-Test.c.

Referenced by main(), and processEvent().

◆ sFullScreenWindow

GHOST_WindowHandle sFullScreenWindow = NULL
static

Definition at line 43 of file GHOST_C-Test.c.

Referenced by gearsTimerProc(), and processEvent().

◆ sGearsTimer

GHOST_TimerTaskHandle sGearsTimer
static

Definition at line 45 of file GHOST_C-Test.c.

Referenced by main(), and processEvent().

◆ shSystem

GHOST_SystemHandle shSystem = NULL
static

Definition at line 39 of file GHOST_C-Test.c.

Referenced by gearsTimerProc(), main(), and processEvent().

◆ sMainWindow

GHOST_WindowHandle sMainWindow = NULL
static

Definition at line 40 of file GHOST_C-Test.c.

Referenced by main(), and processEvent().

◆ sSecondaryWindow

GHOST_WindowHandle sSecondaryWindow = NULL
static

Definition at line 41 of file GHOST_C-Test.c.

Referenced by main().

◆ sTestTimer

GHOST_TimerTaskHandle sTestTimer
static

Definition at line 44 of file GHOST_C-Test.c.

Referenced by processEvent().

◆ view_rotx

GLfloat view_rotx = 20.0
static

Definition at line 36 of file GHOST_C-Test.c.

Referenced by drawGL().

◆ view_roty

GLfloat view_roty = 30.0
static

Definition at line 36 of file GHOST_C-Test.c.

Referenced by drawGL(), and gearsTimerProc().

◆ view_rotz

GLfloat view_rotz = 0.0
static

Definition at line 36 of file GHOST_C-Test.c.

Referenced by drawGL(), and processEvent().