Blender V2.61 - r43446
Defines | Functions | Variables

GHOST_C-Test.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "GHOST_C-api.h"
#include <GL/gl.h>

Go to the source code of this file.

Defines

#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

Define Documentation

#define FALSE   0

***** BEGIN GPL LICENSE BLOCK *****

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. All rights reserved.

The Original Code is: all of this file.

Contributor(s): none yet.

***** END GPL LICENSE BLOCK *****

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.

Author:
Maarten Gribnau
Date:
May 31, 2001

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

Referenced by main(), and processEvent().


Function Documentation

static void drawGearGL ( int  id) [static]

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

References gearGL().

Referenced by drawGL().

static void drawGL ( void  ) [static]

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

References drawGearGL(), fAngle, view_rotx, view_roty, and view_rotz.

Referenced by processEvent().

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

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

References angle(), cos(), i, len(), sin(), and sqrt().

Referenced by drawGearGL().

static void gearsTimerProc ( GHOST_TimerTaskHandle  task,
GHOST_TUns64  time 
) [static]
int main ( int  argc,
char **  argv 
)
int processEvent ( GHOST_EventHandle  hEvent,
GHOST_TUserDataPtr  userData 
)
static void setViewPortGL ( GHOST_WindowHandle  hWindow) [static]
static void testTimerProc ( GHOST_TimerTaskHandle  task,
GHOST_TUns64  time 
) [static]

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

Referenced by processEvent().


Variable Documentation

GLfloat fAngle = 0.0 [static]
GHOST_TStandardCursor sCursor = GHOST_kStandardCursorFirstCursor [static]

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

Referenced by processEvent().

int sExitRequested = 0 [static]

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

Referenced by main(), and processEvent().

GHOST_WindowHandle sFullScreenWindow = NULL [static]

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

Referenced by gearsTimerProc(), and processEvent().

GHOST_TimerTaskHandle sGearsTimer [static]

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

Referenced by main(), and processEvent().

GHOST_SystemHandle shSystem = NULL [static]

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

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

GHOST_WindowHandle sMainWindow = NULL [static]

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

Referenced by main(), and processEvent().

GHOST_WindowHandle sSecondaryWindow = NULL [static]

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

Referenced by main().

GHOST_TimerTaskHandle sTestTimer [static]

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

Referenced by processEvent().

GLfloat view_rotx = 20.0 [static]

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

Referenced by drawGL().

GLfloat view_roty = 30.0

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

Referenced by drawGL(), gearsTimerProc(), and RenderCamera().

GLfloat view_rotz = 0.0

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

Referenced by drawGL(), processEvent(), Application::processEvent(), and RenderCamera().