Blender V2.61 - r43446
|
#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 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.
Definition at line 44 of file GHOST_C-Test.c.
Referenced by main(), and processEvent().
static void drawGearGL | ( | int | id | ) | [static] |
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] |
Definition at line 539 of file GHOST_C-Test.c.
References fAngle, GHOST_GetFullScreen(), GHOST_GetTimerTaskUserData(), GHOST_InvalidateWindow(), GHOST_ValidWindow(), NULL, sFullScreenWindow, shSystem, and view_roty.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 454 of file GHOST_C-Test.c.
References FALSE, gearsTimerProc(), GHOST_AddEventConsumer(), GHOST_CreateEventConsumer(), GHOST_CreateSystem(), GHOST_CreateWindow(), GHOST_DispatchEvents(), GHOST_DisposeEventConsumer(), GHOST_DisposeSystem(), GHOST_DisposeWindow(), GHOST_InstallTimer(), GHOST_kDrawingContextTypeOpenGL, GHOST_kWindowStateNormal, GHOST_ProcessEvents(), GHOST_ValidWindow(), NULL, processEvent(), sExitRequested, sGearsTimer, shSystem, Sleep, sMainWindow, and sSecondaryWindow.
int processEvent | ( | GHOST_EventHandle | hEvent, |
GHOST_TUserDataPtr | userData | ||
) |
Definition at line 285 of file GHOST_C-Test.c.
References GHOST_DisplaySetting::bpp, drawGL(), FALSE, addon::engine::free(), GHOST_DisplaySetting::frequency, GHOST_BeginFullScreen(), GHOST_DisposeWindow(), GHOST_EndFullScreen(), GHOST_GetCursorVisibility(), GHOST_GetEventData(), GHOST_GetEventType(), GHOST_GetEventWindow(), GHOST_GetFullScreen(), GHOST_GetTitle(), GHOST_InstallTimer(), GHOST_kEventKeyDown, GHOST_kEventKeyUp, GHOST_kEventWheel, GHOST_kEventWindowActivate, GHOST_kEventWindowClose, GHOST_kEventWindowDeactivate, GHOST_kEventWindowUpdate, GHOST_kKeyC, GHOST_kKeyF, GHOST_kKeyH, GHOST_kKeyQ, GHOST_kKeyT, GHOST_kKeyW, GHOST_kStandardCursorFirstCursor, GHOST_kStandardCursorNumCursors, GHOST_RemoveTimer(), GHOST_SetCursorShape(), GHOST_SetCursorVisibility(), GHOST_SetTitle(), GHOST_SwapWindowBuffers(), GHOST_ValidWindow(), GHOST_TEventKeyData::key, NULL, sCursor, setViewPortGL(), sExitRequested, sFullScreenWindow, sGearsTimer, shSystem, sMainWindow, sTestTimer, strlen(), testTimerProc(), view_rotz, GHOST_DisplaySetting::xPixels, GHOST_DisplaySetting::yPixels, and GHOST_TEventWheelData::z.
Referenced by main().
static void setViewPortGL | ( | GHOST_WindowHandle | hWindow | ) | [static] |
Definition at line 256 of file GHOST_C-Test.c.
References GHOST_ActivateWindowDrawingContext(), GHOST_DisposeRectangle(), GHOST_GetClientBounds(), GHOST_GetHeightRectangle(), GHOST_GetWidthRectangle(), NULL, and simple_enum_gen::w.
Referenced by processEvent().
static void testTimerProc | ( | GHOST_TimerTaskHandle | task, |
GHOST_TUns64 | time | ||
) | [static] |
Definition at line 75 of file GHOST_C-Test.c.
Referenced by processEvent().
GLfloat fAngle = 0.0 [static] |
Definition at line 65 of file GHOST_C-Test.c.
Referenced by drawGL(), EvalTspace(), gearsTimerProc(), and btTransformUtil::integrateTransform().
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().