Blender  V2.93
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, GHOST_TUns64 time)
 
int processEvent (GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData)
 
static void testTimerProc (GHOST_TimerTaskHandle task, GHOST_TUns64 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 33 of file GHOST_C-Test.c.

Function Documentation

◆ drawGearGL()

static void drawGearGL ( int  id)
static

Definition at line 197 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 229 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 68 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,
GHOST_TUns64  time 
)
static

◆ main()

int main ( int  argc,
char **  argv 
)

◆ processEvent()

int processEvent ( GHOST_EventHandle  hEvent,
GHOST_TUserDataPtr  userData 
)

◆ setViewPortGL()

static void setViewPortGL ( GHOST_WindowHandle  hWindow)
static

◆ testTimerProc()

static void testTimerProc ( GHOST_TimerTaskHandle  task,
GHOST_TUns64  time 
)
static

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

References time.

Referenced by processEvent().

Variable Documentation

◆ fAngle

GLfloat fAngle = 0.0
static

◆ sCursor

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

Referenced by processEvent().

◆ sExitRequested

int sExitRequested = 0
static

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

Referenced by main(), and processEvent().

◆ sFullScreenWindow

GHOST_WindowHandle sFullScreenWindow = NULL
static

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

Referenced by gearsTimerProc(), and processEvent().

◆ sGearsTimer

GHOST_TimerTaskHandle sGearsTimer
static

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

Referenced by main(), and processEvent().

◆ shSystem

GHOST_SystemHandle shSystem = NULL
static

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

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

◆ sMainWindow

GHOST_WindowHandle sMainWindow = NULL
static

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

Referenced by main(), and processEvent().

◆ sSecondaryWindow

GHOST_WindowHandle sSecondaryWindow = NULL
static

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

Referenced by main().

◆ sTestTimer

GHOST_TimerTaskHandle sTestTimer
static

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

Referenced by processEvent().

◆ view_rotx

GLfloat view_rotx = 20.0
static

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

Referenced by drawGL().

◆ view_roty

GLfloat view_roty = 30.0
static

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

Referenced by drawGL(), and gearsTimerProc().

◆ view_rotz

GLfloat view_rotz = 0.0
static

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

Referenced by drawGL(), and processEvent().