commit
ee06d0d78c
After Width: | Height: | Size: 146 KiB |
Binary file not shown.
@ -0,0 +1,596 @@
|
|||||||
|
#ifndef __glut_h__
|
||||||
|
#define __glut_h__
|
||||||
|
|
||||||
|
/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */
|
||||||
|
|
||||||
|
/* This program is freely distributable without licensing fees and is
|
||||||
|
provided without guarantee or warrantee expressed or implied. This
|
||||||
|
program is -not- in the public domain. */
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
|
||||||
|
/* GLUT 3.7 now tries to avoid including <windows.h>
|
||||||
|
to avoid name space pollution, but Win32's <GL/gl.h>
|
||||||
|
needs APIENTRY and WINGDIAPI defined properly. */
|
||||||
|
# if 0
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# include <windows.h>
|
||||||
|
# else
|
||||||
|
/* XXX This is from Win32's <windef.h> */
|
||||||
|
# ifndef APIENTRY
|
||||||
|
# define GLUT_APIENTRY_DEFINED
|
||||||
|
# if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
|
||||||
|
# define APIENTRY __stdcall
|
||||||
|
# else
|
||||||
|
# define APIENTRY
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
/* XXX This is from Win32's <winnt.h> */
|
||||||
|
# ifndef CALLBACK
|
||||||
|
# if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
|
||||||
|
# define CALLBACK __stdcall
|
||||||
|
# else
|
||||||
|
# define CALLBACK
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
/* XXX This is from Win32's <wingdi.h> and <winnt.h> */
|
||||||
|
# ifndef WINGDIAPI
|
||||||
|
# define GLUT_WINGDIAPI_DEFINED
|
||||||
|
# define WINGDIAPI __declspec(dllimport)
|
||||||
|
# endif
|
||||||
|
/* XXX This is from Win32's <ctype.h> */
|
||||||
|
# ifndef _WCHAR_T_DEFINED
|
||||||
|
typedef unsigned short wchar_t;
|
||||||
|
# define _WCHAR_T_DEFINED
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */
|
||||||
|
#pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */
|
||||||
|
#pragma comment (lib, "glu32.lib") /* link with OpenGL Utility lib */
|
||||||
|
#pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */
|
||||||
|
|
||||||
|
#pragma warning (disable:4244) /* Disable bogus conversion warnings. */
|
||||||
|
#pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glu.h>
|
||||||
|
|
||||||
|
/* define APIENTRY and CALLBACK to null string if we aren't on Win32 */
|
||||||
|
#if !defined(_WIN32)
|
||||||
|
#define APIENTRY
|
||||||
|
#define GLUT_APIENTRY_DEFINED
|
||||||
|
#define CALLBACK
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
GLUT API revision history:
|
||||||
|
|
||||||
|
GLUT_API_VERSION is updated to reflect incompatible GLUT
|
||||||
|
API changes (interface changes, semantic changes, deletions,
|
||||||
|
or additions).
|
||||||
|
|
||||||
|
GLUT_API_VERSION=1 First public release of GLUT. 11/29/94
|
||||||
|
|
||||||
|
GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling,
|
||||||
|
extension. Supports new input devices like tablet, dial and button
|
||||||
|
box, and Spaceball. Easy to query OpenGL extensions.
|
||||||
|
|
||||||
|
GLUT_API_VERSION=3 glutMenuStatus added.
|
||||||
|
|
||||||
|
GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer,
|
||||||
|
glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
|
||||||
|
video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc,
|
||||||
|
glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat,
|
||||||
|
glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!).
|
||||||
|
**/
|
||||||
|
#ifndef GLUT_API_VERSION /* allow this to be overriden */
|
||||||
|
#define GLUT_API_VERSION 3
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
GLUT implementation revision history:
|
||||||
|
|
||||||
|
GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
|
||||||
|
API revisions and implementation revisions (ie, bug fixes).
|
||||||
|
|
||||||
|
GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of
|
||||||
|
GLUT Xlib-based implementation. 11/29/94
|
||||||
|
|
||||||
|
GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of
|
||||||
|
GLUT Xlib-based implementation providing GLUT version 2
|
||||||
|
interfaces.
|
||||||
|
|
||||||
|
GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95
|
||||||
|
|
||||||
|
GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95
|
||||||
|
|
||||||
|
GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95
|
||||||
|
|
||||||
|
GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96
|
||||||
|
|
||||||
|
GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner
|
||||||
|
and video resize. 1/3/97
|
||||||
|
|
||||||
|
GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
|
||||||
|
|
||||||
|
GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.
|
||||||
|
|
||||||
|
GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
|
||||||
|
|
||||||
|
GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 release with GameGLUT support.
|
||||||
|
**/
|
||||||
|
#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */
|
||||||
|
#define GLUT_XLIB_IMPLEMENTATION 13
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Display mode bit masks. */
|
||||||
|
#define GLUT_RGB 0
|
||||||
|
#define GLUT_RGBA GLUT_RGB
|
||||||
|
#define GLUT_INDEX 1
|
||||||
|
#define GLUT_SINGLE 0
|
||||||
|
#define GLUT_DOUBLE 2
|
||||||
|
#define GLUT_ACCUM 4
|
||||||
|
#define GLUT_ALPHA 8
|
||||||
|
#define GLUT_DEPTH 16
|
||||||
|
#define GLUT_STENCIL 32
|
||||||
|
#if (GLUT_API_VERSION >= 2)
|
||||||
|
#define GLUT_MULTISAMPLE 128
|
||||||
|
#define GLUT_STEREO 256
|
||||||
|
#endif
|
||||||
|
#if (GLUT_API_VERSION >= 3)
|
||||||
|
#define GLUT_LUMINANCE 512
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Mouse buttons. */
|
||||||
|
#define GLUT_LEFT_BUTTON 0
|
||||||
|
#define GLUT_MIDDLE_BUTTON 1
|
||||||
|
#define GLUT_RIGHT_BUTTON 2
|
||||||
|
|
||||||
|
/* Mouse button state. */
|
||||||
|
#define GLUT_DOWN 0
|
||||||
|
#define GLUT_UP 1
|
||||||
|
|
||||||
|
#if (GLUT_API_VERSION >= 2)
|
||||||
|
/* function keys */
|
||||||
|
#define GLUT_KEY_F1 1
|
||||||
|
#define GLUT_KEY_F2 2
|
||||||
|
#define GLUT_KEY_F3 3
|
||||||
|
#define GLUT_KEY_F4 4
|
||||||
|
#define GLUT_KEY_F5 5
|
||||||
|
#define GLUT_KEY_F6 6
|
||||||
|
#define GLUT_KEY_F7 7
|
||||||
|
#define GLUT_KEY_F8 8
|
||||||
|
#define GLUT_KEY_F9 9
|
||||||
|
#define GLUT_KEY_F10 10
|
||||||
|
#define GLUT_KEY_F11 11
|
||||||
|
#define GLUT_KEY_F12 12
|
||||||
|
/* directional keys */
|
||||||
|
#define GLUT_KEY_LEFT 100
|
||||||
|
#define GLUT_KEY_UP 101
|
||||||
|
#define GLUT_KEY_RIGHT 102
|
||||||
|
#define GLUT_KEY_DOWN 103
|
||||||
|
#define GLUT_KEY_PAGE_UP 104
|
||||||
|
#define GLUT_KEY_PAGE_DOWN 105
|
||||||
|
#define GLUT_KEY_HOME 106
|
||||||
|
#define GLUT_KEY_END 107
|
||||||
|
#define GLUT_KEY_INSERT 108
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Entry/exit state. */
|
||||||
|
#define GLUT_LEFT 0
|
||||||
|
#define GLUT_ENTERED 1
|
||||||
|
|
||||||
|
/* Menu usage state. */
|
||||||
|
#define GLUT_MENU_NOT_IN_USE 0
|
||||||
|
#define GLUT_MENU_IN_USE 1
|
||||||
|
|
||||||
|
/* Visibility state. */
|
||||||
|
#define GLUT_NOT_VISIBLE 0
|
||||||
|
#define GLUT_VISIBLE 1
|
||||||
|
|
||||||
|
/* Window status state. */
|
||||||
|
#define GLUT_HIDDEN 0
|
||||||
|
#define GLUT_FULLY_RETAINED 1
|
||||||
|
#define GLUT_PARTIALLY_RETAINED 2
|
||||||
|
#define GLUT_FULLY_COVERED 3
|
||||||
|
|
||||||
|
/* Color index component selection values. */
|
||||||
|
#define GLUT_RED 0
|
||||||
|
#define GLUT_GREEN 1
|
||||||
|
#define GLUT_BLUE 2
|
||||||
|
|
||||||
|
/* Layers for use. */
|
||||||
|
#define GLUT_NORMAL 0
|
||||||
|
#define GLUT_OVERLAY 1
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
/* Stroke font constants (use these in GLUT program). */
|
||||||
|
#define GLUT_STROKE_ROMAN ((void*)0)
|
||||||
|
#define GLUT_STROKE_MONO_ROMAN ((void*)1)
|
||||||
|
|
||||||
|
/* Bitmap font constants (use these in GLUT program). */
|
||||||
|
#define GLUT_BITMAP_9_BY_15 ((void*)2)
|
||||||
|
#define GLUT_BITMAP_8_BY_13 ((void*)3)
|
||||||
|
#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4)
|
||||||
|
#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5)
|
||||||
|
#if (GLUT_API_VERSION >= 3)
|
||||||
|
#define GLUT_BITMAP_HELVETICA_10 ((void*)6)
|
||||||
|
#define GLUT_BITMAP_HELVETICA_12 ((void*)7)
|
||||||
|
#define GLUT_BITMAP_HELVETICA_18 ((void*)8)
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
/* Stroke font opaque addresses (use constants instead in source code). */
|
||||||
|
extern void *glutStrokeRoman;
|
||||||
|
extern void *glutStrokeMonoRoman;
|
||||||
|
|
||||||
|
/* Stroke font constants (use these in GLUT program). */
|
||||||
|
#define GLUT_STROKE_ROMAN (&glutStrokeRoman)
|
||||||
|
#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
|
||||||
|
|
||||||
|
/* Bitmap font opaque addresses (use constants instead in source code). */
|
||||||
|
extern void *glutBitmap9By15;
|
||||||
|
extern void *glutBitmap8By13;
|
||||||
|
extern void *glutBitmapTimesRoman10;
|
||||||
|
extern void *glutBitmapTimesRoman24;
|
||||||
|
extern void *glutBitmapHelvetica10;
|
||||||
|
extern void *glutBitmapHelvetica12;
|
||||||
|
extern void *glutBitmapHelvetica18;
|
||||||
|
|
||||||
|
/* Bitmap font constants (use these in GLUT program). */
|
||||||
|
#define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15)
|
||||||
|
#define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13)
|
||||||
|
#define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10)
|
||||||
|
#define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24)
|
||||||
|
#if (GLUT_API_VERSION >= 3)
|
||||||
|
#define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10)
|
||||||
|
#define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12)
|
||||||
|
#define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* glutGet parameters. */
|
||||||
|
#define GLUT_WINDOW_X 100
|
||||||
|
#define GLUT_WINDOW_Y 101
|
||||||
|
#define GLUT_WINDOW_WIDTH 102
|
||||||
|
#define GLUT_WINDOW_HEIGHT 103
|
||||||
|
#define GLUT_WINDOW_BUFFER_SIZE 104
|
||||||
|
#define GLUT_WINDOW_STENCIL_SIZE 105
|
||||||
|
#define GLUT_WINDOW_DEPTH_SIZE 106
|
||||||
|
#define GLUT_WINDOW_RED_SIZE 107
|
||||||
|
#define GLUT_WINDOW_GREEN_SIZE 108
|
||||||
|
#define GLUT_WINDOW_BLUE_SIZE 109
|
||||||
|
#define GLUT_WINDOW_ALPHA_SIZE 110
|
||||||
|
#define GLUT_WINDOW_ACCUM_RED_SIZE 111
|
||||||
|
#define GLUT_WINDOW_ACCUM_GREEN_SIZE 112
|
||||||
|
#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113
|
||||||
|
#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114
|
||||||
|
#define GLUT_WINDOW_DOUBLEBUFFER 115
|
||||||
|
#define GLUT_WINDOW_RGBA 116
|
||||||
|
#define GLUT_WINDOW_PARENT 117
|
||||||
|
#define GLUT_WINDOW_NUM_CHILDREN 118
|
||||||
|
#define GLUT_WINDOW_COLORMAP_SIZE 119
|
||||||
|
#if (GLUT_API_VERSION >= 2)
|
||||||
|
#define GLUT_WINDOW_NUM_SAMPLES 120
|
||||||
|
#define GLUT_WINDOW_STEREO 121
|
||||||
|
#endif
|
||||||
|
#if (GLUT_API_VERSION >= 3)
|
||||||
|
#define GLUT_WINDOW_CURSOR 122
|
||||||
|
#endif
|
||||||
|
#define GLUT_SCREEN_WIDTH 200
|
||||||
|
#define GLUT_SCREEN_HEIGHT 201
|
||||||
|
#define GLUT_SCREEN_WIDTH_MM 202
|
||||||
|
#define GLUT_SCREEN_HEIGHT_MM 203
|
||||||
|
#define GLUT_MENU_NUM_ITEMS 300
|
||||||
|
#define GLUT_DISPLAY_MODE_POSSIBLE 400
|
||||||
|
#define GLUT_INIT_WINDOW_X 500
|
||||||
|
#define GLUT_INIT_WINDOW_Y 501
|
||||||
|
#define GLUT_INIT_WINDOW_WIDTH 502
|
||||||
|
#define GLUT_INIT_WINDOW_HEIGHT 503
|
||||||
|
#define GLUT_INIT_DISPLAY_MODE 504
|
||||||
|
#if (GLUT_API_VERSION >= 2)
|
||||||
|
#define GLUT_ELAPSED_TIME 700
|
||||||
|
#endif
|
||||||
|
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||||
|
#define GLUT_WINDOW_FORMAT_ID 123
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (GLUT_API_VERSION >= 2)
|
||||||
|
/* glutDeviceGet parameters. */
|
||||||
|
#define GLUT_HAS_KEYBOARD 600
|
||||||
|
#define GLUT_HAS_MOUSE 601
|
||||||
|
#define GLUT_HAS_SPACEBALL 602
|
||||||
|
#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603
|
||||||
|
#define GLUT_HAS_TABLET 604
|
||||||
|
#define GLUT_NUM_MOUSE_BUTTONS 605
|
||||||
|
#define GLUT_NUM_SPACEBALL_BUTTONS 606
|
||||||
|
#define GLUT_NUM_BUTTON_BOX_BUTTONS 607
|
||||||
|
#define GLUT_NUM_DIALS 608
|
||||||
|
#define GLUT_NUM_TABLET_BUTTONS 609
|
||||||
|
#endif
|
||||||
|
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||||
|
#define GLUT_DEVICE_IGNORE_KEY_REPEAT 610
|
||||||
|
#define GLUT_DEVICE_KEY_REPEAT 611
|
||||||
|
#define GLUT_HAS_JOYSTICK 612
|
||||||
|
#define GLUT_OWNS_JOYSTICK 613
|
||||||
|
#define GLUT_JOYSTICK_BUTTONS 614
|
||||||
|
#define GLUT_JOYSTICK_AXES 615
|
||||||
|
#define GLUT_JOYSTICK_POLL_RATE 616
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (GLUT_API_VERSION >= 3)
|
||||||
|
/* glutLayerGet parameters. */
|
||||||
|
#define GLUT_OVERLAY_POSSIBLE 800
|
||||||
|
#define GLUT_LAYER_IN_USE 801
|
||||||
|
#define GLUT_HAS_OVERLAY 802
|
||||||
|
#define GLUT_TRANSPARENT_INDEX 803
|
||||||
|
#define GLUT_NORMAL_DAMAGED 804
|
||||||
|
#define GLUT_OVERLAY_DAMAGED 805
|
||||||
|
|
||||||
|
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||||
|
/* glutVideoResizeGet parameters. */
|
||||||
|
#define GLUT_VIDEO_RESIZE_POSSIBLE 900
|
||||||
|
#define GLUT_VIDEO_RESIZE_IN_USE 901
|
||||||
|
#define GLUT_VIDEO_RESIZE_X_DELTA 902
|
||||||
|
#define GLUT_VIDEO_RESIZE_Y_DELTA 903
|
||||||
|
#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904
|
||||||
|
#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905
|
||||||
|
#define GLUT_VIDEO_RESIZE_X 906
|
||||||
|
#define GLUT_VIDEO_RESIZE_Y 907
|
||||||
|
#define GLUT_VIDEO_RESIZE_WIDTH 908
|
||||||
|
#define GLUT_VIDEO_RESIZE_HEIGHT 909
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* glutUseLayer parameters. */
|
||||||
|
#define GLUT_NORMAL 0
|
||||||
|
#define GLUT_OVERLAY 1
|
||||||
|
|
||||||
|
/* glutGetModifiers return mask. */
|
||||||
|
#define GLUT_ACTIVE_SHIFT 1
|
||||||
|
#define GLUT_ACTIVE_CTRL 2
|
||||||
|
#define GLUT_ACTIVE_ALT 4
|
||||||
|
|
||||||
|
/* glutSetCursor parameters. */
|
||||||
|
/* Basic arrows. */
|
||||||
|
#define GLUT_CURSOR_RIGHT_ARROW 0
|
||||||
|
#define GLUT_CURSOR_LEFT_ARROW 1
|
||||||
|
/* Symbolic cursor shapes. */
|
||||||
|
#define GLUT_CURSOR_INFO 2
|
||||||
|
#define GLUT_CURSOR_DESTROY 3
|
||||||
|
#define GLUT_CURSOR_HELP 4
|
||||||
|
#define GLUT_CURSOR_CYCLE 5
|
||||||
|
#define GLUT_CURSOR_SPRAY 6
|
||||||
|
#define GLUT_CURSOR_WAIT 7
|
||||||
|
#define GLUT_CURSOR_TEXT 8
|
||||||
|
#define GLUT_CURSOR_CROSSHAIR 9
|
||||||
|
/* Directional cursors. */
|
||||||
|
#define GLUT_CURSOR_UP_DOWN 10
|
||||||
|
#define GLUT_CURSOR_LEFT_RIGHT 11
|
||||||
|
/* Sizing cursors. */
|
||||||
|
#define GLUT_CURSOR_TOP_SIDE 12
|
||||||
|
#define GLUT_CURSOR_BOTTOM_SIDE 13
|
||||||
|
#define GLUT_CURSOR_LEFT_SIDE 14
|
||||||
|
#define GLUT_CURSOR_RIGHT_SIDE 15
|
||||||
|
#define GLUT_CURSOR_TOP_LEFT_CORNER 16
|
||||||
|
#define GLUT_CURSOR_TOP_RIGHT_CORNER 17
|
||||||
|
#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
|
||||||
|
#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
|
||||||
|
/* Inherit from parent window. */
|
||||||
|
#define GLUT_CURSOR_INHERIT 100
|
||||||
|
/* Blank cursor. */
|
||||||
|
#define GLUT_CURSOR_NONE 101
|
||||||
|
/* Fullscreen crosshair (if available). */
|
||||||
|
#define GLUT_CURSOR_FULL_CROSSHAIR 102
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* GLUT initialization sub-API. */
|
||||||
|
extern void APIENTRY glutInit(int *argcp, char **argv);
|
||||||
|
extern void APIENTRY glutInitDisplayMode(unsigned int mode);
|
||||||
|
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||||
|
extern void APIENTRY glutInitDisplayString(const char *string);
|
||||||
|
#endif
|
||||||
|
extern void APIENTRY glutInitWindowPosition(int x, int y);
|
||||||
|
extern void APIENTRY glutInitWindowSize(int width, int height);
|
||||||
|
extern void APIENTRY glutMainLoop(void);
|
||||||
|
|
||||||
|
/* GLUT window sub-API. */
|
||||||
|
extern int APIENTRY glutCreateWindow(const char *title);
|
||||||
|
extern int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
|
||||||
|
extern void APIENTRY glutDestroyWindow(int win);
|
||||||
|
extern void APIENTRY glutPostRedisplay(void);
|
||||||
|
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
|
||||||
|
extern void APIENTRY glutPostWindowRedisplay(int win);
|
||||||
|
#endif
|
||||||
|
extern void APIENTRY glutSwapBuffers(void);
|
||||||
|
extern int APIENTRY glutGetWindow(void);
|
||||||
|
extern void APIENTRY glutSetWindow(int win);
|
||||||
|
extern void APIENTRY glutSetWindowTitle(const char *title);
|
||||||
|
extern void APIENTRY glutSetIconTitle(const char *title);
|
||||||
|
extern void APIENTRY glutPositionWindow(int x, int y);
|
||||||
|
extern void APIENTRY glutReshapeWindow(int width, int height);
|
||||||
|
extern void APIENTRY glutPopWindow(void);
|
||||||
|
extern void APIENTRY glutPushWindow(void);
|
||||||
|
extern void APIENTRY glutIconifyWindow(void);
|
||||||
|
extern void APIENTRY glutShowWindow(void);
|
||||||
|
extern void APIENTRY glutHideWindow(void);
|
||||||
|
#if (GLUT_API_VERSION >= 3)
|
||||||
|
extern void APIENTRY glutFullScreen(void);
|
||||||
|
extern void APIENTRY glutSetCursor(int cursor);
|
||||||
|
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||||
|
extern void APIENTRY glutWarpPointer(int x, int y);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* GLUT overlay sub-API. */
|
||||||
|
extern void APIENTRY glutEstablishOverlay(void);
|
||||||
|
extern void APIENTRY glutRemoveOverlay(void);
|
||||||
|
extern void APIENTRY glutUseLayer(GLenum layer);
|
||||||
|
extern void APIENTRY glutPostOverlayRedisplay(void);
|
||||||
|
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
|
||||||
|
extern void APIENTRY glutPostWindowOverlayRedisplay(int win);
|
||||||
|
#endif
|
||||||
|
extern void APIENTRY glutShowOverlay(void);
|
||||||
|
extern void APIENTRY glutHideOverlay(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* GLUT menu sub-API. */
|
||||||
|
extern int APIENTRY glutCreateMenu(void (*)(int));
|
||||||
|
extern void APIENTRY glutDestroyMenu(int menu);
|
||||||
|
extern int APIENTRY glutGetMenu(void);
|
||||||
|
extern void APIENTRY glutSetMenu(int menu);
|
||||||
|
extern void APIENTRY glutAddMenuEntry(const char *label, int value);
|
||||||
|
extern void APIENTRY glutAddSubMenu(const char *label, int submenu);
|
||||||
|
extern void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
|
||||||
|
extern void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
|
||||||
|
extern void APIENTRY glutRemoveMenuItem(int item);
|
||||||
|
extern void APIENTRY glutAttachMenu(int button);
|
||||||
|
extern void APIENTRY glutDetachMenu(int button);
|
||||||
|
|
||||||
|
/* GLUT window callback sub-API. */
|
||||||
|
extern void APIENTRY glutDisplayFunc(void (*func)(void));
|
||||||
|
extern void APIENTRY glutReshapeFunc(void (*func)(int width, int height));
|
||||||
|
extern void APIENTRY glutKeyboardFunc(void (*func)(unsigned char key, int x, int y));
|
||||||
|
extern void APIENTRY glutMouseFunc(void (*func)(int button, int state, int x, int y));
|
||||||
|
extern void APIENTRY glutMotionFunc(void (*func)(int x, int y));
|
||||||
|
extern void APIENTRY glutPassiveMotionFunc(void (*func)(int x, int y));
|
||||||
|
extern void APIENTRY glutEntryFunc(void (*func)(int state));
|
||||||
|
extern void APIENTRY glutVisibilityFunc(void (*func)(int state));
|
||||||
|
extern void APIENTRY glutIdleFunc(void (*func)(void));
|
||||||
|
extern void APIENTRY glutTimerFunc(unsigned int millis, void (*func)(int value), int value);
|
||||||
|
extern void APIENTRY glutMenuStateFunc(void (*func)(int state));
|
||||||
|
#if (GLUT_API_VERSION >= 2)
|
||||||
|
extern void APIENTRY glutSpecialFunc(void (*func)(int key, int x, int y));
|
||||||
|
extern void APIENTRY glutSpaceballMotionFunc(void (*func)(int x, int y, int z));
|
||||||
|
extern void APIENTRY glutSpaceballRotateFunc(void (*func)(int x, int y, int z));
|
||||||
|
extern void APIENTRY glutSpaceballButtonFunc(void (*func)(int button, int state));
|
||||||
|
extern void APIENTRY glutButtonBoxFunc(void (*func)(int button, int state));
|
||||||
|
extern void APIENTRY glutDialsFunc(void (*func)(int dial, int value));
|
||||||
|
extern void APIENTRY glutTabletMotionFunc(void (*func)(int x, int y));
|
||||||
|
extern void APIENTRY glutTabletButtonFunc(void (*func)(int button, int state, int x, int y));
|
||||||
|
#if (GLUT_API_VERSION >= 3)
|
||||||
|
extern void APIENTRY glutMenuStatusFunc(void (*func)(int status, int x, int y));
|
||||||
|
extern void APIENTRY glutOverlayDisplayFunc(void (*func)(void));
|
||||||
|
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||||
|
extern void APIENTRY glutWindowStatusFunc(void (*func)(int state));
|
||||||
|
#endif
|
||||||
|
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||||
|
extern void APIENTRY glutKeyboardUpFunc(void (*func)(unsigned char key, int x, int y));
|
||||||
|
extern void APIENTRY glutSpecialUpFunc(void (*func)(int key, int x, int y));
|
||||||
|
extern void APIENTRY glutJoystickFunc(void (*func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* GLUT color index sub-API. */
|
||||||
|
extern void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue);
|
||||||
|
extern GLfloat APIENTRY glutGetColor(int ndx, int component);
|
||||||
|
extern void APIENTRY glutCopyColormap(int win);
|
||||||
|
|
||||||
|
/* GLUT state retrieval sub-API. */
|
||||||
|
extern int APIENTRY glutGet(GLenum type);
|
||||||
|
extern int APIENTRY glutDeviceGet(GLenum type);
|
||||||
|
#if (GLUT_API_VERSION >= 2)
|
||||||
|
/* GLUT extension support sub-API */
|
||||||
|
extern int APIENTRY glutExtensionSupported(const char *name);
|
||||||
|
#endif
|
||||||
|
#if (GLUT_API_VERSION >= 3)
|
||||||
|
extern int APIENTRY glutGetModifiers(void);
|
||||||
|
extern int APIENTRY glutLayerGet(GLenum type);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* GLUT font sub-API */
|
||||||
|
extern void APIENTRY glutBitmapCharacter(void *font, int character);
|
||||||
|
extern int APIENTRY glutBitmapWidth(void *font, int character);
|
||||||
|
extern void APIENTRY glutStrokeCharacter(void *font, int character);
|
||||||
|
extern int APIENTRY glutStrokeWidth(void *font, int character);
|
||||||
|
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||||
|
extern int APIENTRY glutBitmapLength(void *font, const unsigned char *string);
|
||||||
|
extern int APIENTRY glutStrokeLength(void *font, const unsigned char *string);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* GLUT pre-built models sub-API */
|
||||||
|
extern void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
|
||||||
|
extern void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
|
||||||
|
extern void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
|
||||||
|
extern void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
|
||||||
|
extern void APIENTRY glutWireCube(GLdouble size);
|
||||||
|
extern void APIENTRY glutSolidCube(GLdouble size);
|
||||||
|
extern void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
|
||||||
|
extern void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
|
||||||
|
extern void APIENTRY glutWireDodecahedron(void);
|
||||||
|
extern void APIENTRY glutSolidDodecahedron(void);
|
||||||
|
extern void APIENTRY glutWireTeapot(GLdouble size);
|
||||||
|
extern void APIENTRY glutSolidTeapot(GLdouble size);
|
||||||
|
extern void APIENTRY glutWireOctahedron(void);
|
||||||
|
extern void APIENTRY glutSolidOctahedron(void);
|
||||||
|
extern void APIENTRY glutWireTetrahedron(void);
|
||||||
|
extern void APIENTRY glutSolidTetrahedron(void);
|
||||||
|
extern void APIENTRY glutWireIcosahedron(void);
|
||||||
|
extern void APIENTRY glutSolidIcosahedron(void);
|
||||||
|
|
||||||
|
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||||
|
/* GLUT video resize sub-API. */
|
||||||
|
extern int APIENTRY glutVideoResizeGet(GLenum param);
|
||||||
|
extern void APIENTRY glutSetupVideoResizing(void);
|
||||||
|
extern void APIENTRY glutStopVideoResizing(void);
|
||||||
|
extern void APIENTRY glutVideoResize(int x, int y, int width, int height);
|
||||||
|
extern void APIENTRY glutVideoPan(int x, int y, int width, int height);
|
||||||
|
|
||||||
|
/* GLUT debugging sub-API. */
|
||||||
|
extern void APIENTRY glutReportErrors(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||||
|
/* GLUT device control sub-API. */
|
||||||
|
/* glutSetKeyRepeat modes. */
|
||||||
|
#define GLUT_KEY_REPEAT_OFF 0
|
||||||
|
#define GLUT_KEY_REPEAT_ON 1
|
||||||
|
#define GLUT_KEY_REPEAT_DEFAULT 2
|
||||||
|
|
||||||
|
/* Joystick button masks. */
|
||||||
|
#define GLUT_JOYSTICK_BUTTON_A 1
|
||||||
|
#define GLUT_JOYSTICK_BUTTON_B 2
|
||||||
|
#define GLUT_JOYSTICK_BUTTON_C 4
|
||||||
|
#define GLUT_JOYSTICK_BUTTON_D 8
|
||||||
|
|
||||||
|
extern void APIENTRY glutIgnoreKeyRepeat(int ignore);
|
||||||
|
extern void APIENTRY glutSetKeyRepeat(int repeatMode);
|
||||||
|
extern void APIENTRY glutForceJoystickFunc(void);
|
||||||
|
|
||||||
|
/* GLUT game mode sub-API. */
|
||||||
|
/* glutGameModeGet. */
|
||||||
|
#define GLUT_GAME_MODE_ACTIVE 0
|
||||||
|
#define GLUT_GAME_MODE_POSSIBLE 1
|
||||||
|
#define GLUT_GAME_MODE_WIDTH 2
|
||||||
|
#define GLUT_GAME_MODE_HEIGHT 3
|
||||||
|
#define GLUT_GAME_MODE_PIXEL_DEPTH 4
|
||||||
|
#define GLUT_GAME_MODE_REFRESH_RATE 5
|
||||||
|
#define GLUT_GAME_MODE_DISPLAY_CHANGED 6
|
||||||
|
|
||||||
|
extern void APIENTRY glutGameModeString(const char *string);
|
||||||
|
extern int APIENTRY glutEnterGameMode(void);
|
||||||
|
extern void APIENTRY glutLeaveGameMode(void);
|
||||||
|
extern int APIENTRY glutGameModeGet(GLenum mode);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef GLUT_APIENTRY_DEFINED
|
||||||
|
# undef GLUT_APIENTRY_DEFINED
|
||||||
|
# undef APIENTRY
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef GLUT_WINGDIAPI_DEFINED
|
||||||
|
# undef GLUT_WINGDIAPI_DEFINED
|
||||||
|
# undef WINGDIAPI
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __glut_h__ */
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 3.0 MiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,8 @@
|
|||||||
|
configurations {
|
||||||
|
Platform {
|
||||||
|
key : "Platform";
|
||||||
|
choices : { Win32, x64 };
|
||||||
|
Win32.aliases : { x86, win32, ia32, 386 };
|
||||||
|
x64.aliases : { x64, amd64, em64t, intel64, x86-64, x86_64 };
|
||||||
|
};
|
||||||
|
};
|
@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework">
|
||||||
|
<Rule Name="ProjectSettings_globals" PageTemplate="tool" DisplayName="Project Master Settings" SwitchPrefix="/" Order="1">
|
||||||
|
<Rule.Categories>
|
||||||
|
<Category Name="cpp" DisplayName="C/C++ Settings" />
|
||||||
|
</Rule.Categories>
|
||||||
|
<Rule.DataSource>
|
||||||
|
<DataSource Persistence="ProjectFile" ItemType="" />
|
||||||
|
</Rule.DataSource>
|
||||||
|
<EnumProperty Name="RuntimeLibrary" DisplayName="Runtime Library" Description="Specify runtime library for linking." Category="cpp" >
|
||||||
|
<EnumValue Name="MultiThreaded" DisplayName="Multi-threaded" Description="Causes your application to use the multithread, static version of the run-time library.">
|
||||||
|
</EnumValue>
|
||||||
|
<EnumValue Name="MultiThreadedDebug" DisplayName="Multi-threaded Debug" Description="Defines _DEBUG and _MT. This option also causes the compiler to place the library name LIBCMTD.lib into the .obj file so that the linker will use LIBCMTD.lib to resolve external symbols.">
|
||||||
|
</EnumValue>
|
||||||
|
<EnumValue Name="MultiThreadedDLL" DisplayName="Multi-threaded DLL" Description="Causes your application to use the multithread- and DLL-specific version of the run-time library. Defines _MT and _DLL and causes the compiler to place the library name MSVCRT.lib into the .obj file.">
|
||||||
|
</EnumValue>
|
||||||
|
<EnumValue Name="MultiThreadedDebugDLL" DisplayName="Multi-threaded Debug DLL" Description="Defines _DEBUG, _MT, and _DLL and causes your application to use the debug multithread- and DLL-specific version of the run-time library. It also causes the compiler to place the library name MSVCRTD.lib into the .obj file.">
|
||||||
|
</EnumValue>
|
||||||
|
</EnumProperty>
|
||||||
|
</Rule>
|
||||||
|
</ProjectSchemaDefinitions>
|
@ -0,0 +1,162 @@
|
|||||||
|
NupenGL Copyright
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
Copyright (c) 2014, NupenGL
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of NupenGL Project nor the names of its contributors
|
||||||
|
may be used to endorse or promote products derived from this software
|
||||||
|
without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
Freeglut Copyright
|
||||||
|
------------------
|
||||||
|
|
||||||
|
Freeglut code without an explicit copyright is covered by the following
|
||||||
|
copyright:
|
||||||
|
|
||||||
|
Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
Except as contained in this notice, the name of Pawel W. Olszta shall not be
|
||||||
|
used in advertising or otherwise to promote the sale, use or other dealings
|
||||||
|
in this Software without prior written authorization from Pawel W. Olszta.
|
||||||
|
|
||||||
|
GLFW Copyright
|
||||||
|
--------------
|
||||||
|
|
||||||
|
Copyright (c) 2002-2006 Marcus Geelnard
|
||||||
|
Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
||||||
|
|
||||||
|
This software is provided 'as-is', without any express or implied
|
||||||
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
arising from the use of this software.
|
||||||
|
|
||||||
|
Permission is granted to anyone to use this software for any purpose,
|
||||||
|
including commercial applications, and to alter it and redistribute it
|
||||||
|
freely, subject to the following restrictions:
|
||||||
|
|
||||||
|
1. The origin of this software must not be misrepresented; you must not
|
||||||
|
claim that you wrote the original software. If you use this software
|
||||||
|
in a product, an acknowledgment in the product documentation would
|
||||||
|
be appreciated but is not required.
|
||||||
|
|
||||||
|
2. Altered source versions must be plainly marked as such, and must not
|
||||||
|
be misrepresented as being the original software.
|
||||||
|
|
||||||
|
3. This notice may not be removed or altered from any source
|
||||||
|
distribution.
|
||||||
|
|
||||||
|
GLEW Copyright: GLEW
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
The OpenGL Extension Wrangler Library
|
||||||
|
Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
|
||||||
|
Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
|
||||||
|
Copyright (C) 2002, Lev Povalahev
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
* The name of the author may be used to endorse or promote products
|
||||||
|
derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
GLEW Copyright: MESA
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
Mesa 3-D graphics library
|
||||||
|
Version: 7.0
|
||||||
|
|
||||||
|
Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||||
|
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
GLEW Copyright: Khronos
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
Copyright (c) 2007 The Khronos Group Inc.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
copy of this software and/or associated documentation files (the
|
||||||
|
"Materials"), to deal in the Materials without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Materials, and to
|
||||||
|
permit persons to whom the Materials are furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Materials.
|
||||||
|
|
||||||
|
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
@ -0,0 +1,22 @@
|
|||||||
|
#ifndef __FREEGLUT_H__
|
||||||
|
#define __FREEGLUT_H__
|
||||||
|
|
||||||
|
/*
|
||||||
|
* freeglut.h
|
||||||
|
*
|
||||||
|
* The freeglut library include file
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "freeglut_std.h"
|
||||||
|
#include "freeglut_ext.h"
|
||||||
|
|
||||||
|
/*** END OF FILE ***/
|
||||||
|
|
||||||
|
#endif /* __FREEGLUT_H__ */
|
@ -0,0 +1,239 @@
|
|||||||
|
#ifndef __FREEGLUT_EXT_H__
|
||||||
|
#define __FREEGLUT_EXT_H__
|
||||||
|
|
||||||
|
/*
|
||||||
|
* freeglut_ext.h
|
||||||
|
*
|
||||||
|
* The non-GLUT-compatible extensions to the freeglut library include file
|
||||||
|
*
|
||||||
|
* Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
|
||||||
|
* Written by Pawel W. Olszta, <olszta@sourceforge.net>
|
||||||
|
* Creation date: Thu Dec 2 1999
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included
|
||||||
|
* in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Additional GLUT Key definitions for the Special key function
|
||||||
|
*/
|
||||||
|
#define GLUT_KEY_NUM_LOCK 0x006D
|
||||||
|
#define GLUT_KEY_BEGIN 0x006E
|
||||||
|
#define GLUT_KEY_DELETE 0x006F
|
||||||
|
#define GLUT_KEY_SHIFT_L 0x0070
|
||||||
|
#define GLUT_KEY_SHIFT_R 0x0071
|
||||||
|
#define GLUT_KEY_CTRL_L 0x0072
|
||||||
|
#define GLUT_KEY_CTRL_R 0x0073
|
||||||
|
#define GLUT_KEY_ALT_L 0x0074
|
||||||
|
#define GLUT_KEY_ALT_R 0x0075
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API Extension macro definitions -- behaviour when the user clicks on an "x" to close a window
|
||||||
|
*/
|
||||||
|
#define GLUT_ACTION_EXIT 0
|
||||||
|
#define GLUT_ACTION_GLUTMAINLOOP_RETURNS 1
|
||||||
|
#define GLUT_ACTION_CONTINUE_EXECUTION 2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create a new rendering context when the user opens a new window?
|
||||||
|
*/
|
||||||
|
#define GLUT_CREATE_NEW_CONTEXT 0
|
||||||
|
#define GLUT_USE_CURRENT_CONTEXT 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Direct/Indirect rendering context options (has meaning only in Unix/X11)
|
||||||
|
*/
|
||||||
|
#define GLUT_FORCE_INDIRECT_CONTEXT 0
|
||||||
|
#define GLUT_ALLOW_DIRECT_CONTEXT 1
|
||||||
|
#define GLUT_TRY_DIRECT_CONTEXT 2
|
||||||
|
#define GLUT_FORCE_DIRECT_CONTEXT 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API Extension macro definitions -- the glutGet parameters
|
||||||
|
*/
|
||||||
|
#define GLUT_INIT_STATE 0x007C
|
||||||
|
|
||||||
|
#define GLUT_ACTION_ON_WINDOW_CLOSE 0x01F9
|
||||||
|
|
||||||
|
#define GLUT_WINDOW_BORDER_WIDTH 0x01FA
|
||||||
|
#define GLUT_WINDOW_BORDER_HEIGHT 0x01FB
|
||||||
|
#define GLUT_WINDOW_HEADER_HEIGHT 0x01FB /* Docs say it should always have been GLUT_WINDOW_BORDER_HEIGHT, keep this for backward compatibility */
|
||||||
|
|
||||||
|
#define GLUT_VERSION 0x01FC
|
||||||
|
|
||||||
|
#define GLUT_RENDERING_CONTEXT 0x01FD
|
||||||
|
#define GLUT_DIRECT_RENDERING 0x01FE
|
||||||
|
|
||||||
|
#define GLUT_FULL_SCREEN 0x01FF
|
||||||
|
|
||||||
|
#define GLUT_SKIP_STALE_MOTION_EVENTS 0x0204
|
||||||
|
|
||||||
|
/*
|
||||||
|
* New tokens for glutInitDisplayMode.
|
||||||
|
* Only one GLUT_AUXn bit may be used at a time.
|
||||||
|
* Value 0x0400 is defined in OpenGLUT.
|
||||||
|
*/
|
||||||
|
#define GLUT_AUX 0x1000
|
||||||
|
|
||||||
|
#define GLUT_AUX1 0x1000
|
||||||
|
#define GLUT_AUX2 0x2000
|
||||||
|
#define GLUT_AUX3 0x4000
|
||||||
|
#define GLUT_AUX4 0x8000
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Context-related flags, see freeglut_state.c
|
||||||
|
*/
|
||||||
|
#define GLUT_INIT_MAJOR_VERSION 0x0200
|
||||||
|
#define GLUT_INIT_MINOR_VERSION 0x0201
|
||||||
|
#define GLUT_INIT_FLAGS 0x0202
|
||||||
|
#define GLUT_INIT_PROFILE 0x0203
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Flags for glutInitContextFlags, see freeglut_init.c
|
||||||
|
*/
|
||||||
|
#define GLUT_DEBUG 0x0001
|
||||||
|
#define GLUT_FORWARD_COMPATIBLE 0x0002
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Flags for glutInitContextProfile, see freeglut_init.c
|
||||||
|
*/
|
||||||
|
#define GLUT_CORE_PROFILE 0x0001
|
||||||
|
#define GLUT_COMPATIBILITY_PROFILE 0x0002
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Process loop function, see freeglut_main.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutMainLoopEvent( void );
|
||||||
|
FGAPI void FGAPIENTRY glutLeaveMainLoop( void );
|
||||||
|
FGAPI void FGAPIENTRY glutExit ( void );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Window management functions, see freeglut_window.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutFullScreenToggle( void );
|
||||||
|
FGAPI void FGAPIENTRY glutLeaveFullScreen( void );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Window-specific callback functions, see freeglut_callbacks.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutMouseWheelFunc( void (* callback)( int, int, int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutCloseFunc( void (* callback)( void ) );
|
||||||
|
FGAPI void FGAPIENTRY glutWMCloseFunc( void (* callback)( void ) );
|
||||||
|
/* A. Donev: Also a destruction callback for menus */
|
||||||
|
FGAPI void FGAPIENTRY glutMenuDestroyFunc( void (* callback)( void ) );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* State setting and retrieval functions, see freeglut_state.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutSetOption ( GLenum option_flag, int value );
|
||||||
|
FGAPI int * FGAPIENTRY glutGetModeValues(GLenum mode, int * size);
|
||||||
|
/* A.Donev: User-data manipulation */
|
||||||
|
FGAPI void* FGAPIENTRY glutGetWindowData( void );
|
||||||
|
FGAPI void FGAPIENTRY glutSetWindowData(void* data);
|
||||||
|
FGAPI void* FGAPIENTRY glutGetMenuData( void );
|
||||||
|
FGAPI void FGAPIENTRY glutSetMenuData(void* data);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Font stuff, see freeglut_font.c
|
||||||
|
*/
|
||||||
|
FGAPI int FGAPIENTRY glutBitmapHeight( void* font );
|
||||||
|
FGAPI GLfloat FGAPIENTRY glutStrokeHeight( void* font );
|
||||||
|
FGAPI void FGAPIENTRY glutBitmapString( void* font, const unsigned char *string );
|
||||||
|
FGAPI void FGAPIENTRY glutStrokeString( void* font, const unsigned char *string );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Geometry functions, see freeglut_geometry.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutWireRhombicDodecahedron( void );
|
||||||
|
FGAPI void FGAPIENTRY glutSolidRhombicDodecahedron( void );
|
||||||
|
FGAPI void FGAPIENTRY glutWireSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale );
|
||||||
|
FGAPI void FGAPIENTRY glutSolidSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale );
|
||||||
|
FGAPI void FGAPIENTRY glutWireCylinder( GLdouble radius, GLdouble height, GLint slices, GLint stacks);
|
||||||
|
FGAPI void FGAPIENTRY glutSolidCylinder( GLdouble radius, GLdouble height, GLint slices, GLint stacks);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Extension functions, see freeglut_ext.c
|
||||||
|
*/
|
||||||
|
typedef void (*GLUTproc)();
|
||||||
|
FGAPI GLUTproc FGAPIENTRY glutGetProcAddress( const char *procName );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Multi-touch/multi-pointer extensions
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define GLUT_HAS_MULTI 1
|
||||||
|
|
||||||
|
FGAPI void FGAPIENTRY glutMultiEntryFunc( void (* callback)( int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutMultiButtonFunc( void (* callback)( int, int, int, int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutMultiMotionFunc( void (* callback)( int, int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutMultiPassiveFunc( void (* callback)( int, int, int ) );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Joystick functions, see freeglut_joystick.c
|
||||||
|
*/
|
||||||
|
/* USE OF THESE FUNCTIONS IS DEPRECATED !!!!! */
|
||||||
|
/* If you have a serious need for these functions in your application, please either
|
||||||
|
* contact the "freeglut" developer community at freeglut-developer@lists.sourceforge.net,
|
||||||
|
* switch to the OpenGLUT library, or else port your joystick functionality over to PLIB's
|
||||||
|
* "js" library.
|
||||||
|
*/
|
||||||
|
int glutJoystickGetNumAxes( int ident );
|
||||||
|
int glutJoystickGetNumButtons( int ident );
|
||||||
|
int glutJoystickNotWorking( int ident );
|
||||||
|
float glutJoystickGetDeadBand( int ident, int axis );
|
||||||
|
void glutJoystickSetDeadBand( int ident, int axis, float db );
|
||||||
|
float glutJoystickGetSaturation( int ident, int axis );
|
||||||
|
void glutJoystickSetSaturation( int ident, int axis, float st );
|
||||||
|
void glutJoystickSetMinRange( int ident, float *axes );
|
||||||
|
void glutJoystickSetMaxRange( int ident, float *axes );
|
||||||
|
void glutJoystickSetCenter( int ident, float *axes );
|
||||||
|
void glutJoystickGetMinRange( int ident, float *axes );
|
||||||
|
void glutJoystickGetMaxRange( int ident, float *axes );
|
||||||
|
void glutJoystickGetCenter( int ident, float *axes );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Initialization functions, see freeglut_init.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutInitContextVersion( int majorVersion, int minorVersion );
|
||||||
|
FGAPI void FGAPIENTRY glutInitContextFlags( int flags );
|
||||||
|
FGAPI void FGAPIENTRY glutInitContextProfile( int profile );
|
||||||
|
|
||||||
|
/* to get the typedef for va_list */
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
FGAPI void FGAPIENTRY glutInitErrorFunc( void (* vError)( const char *fmt, va_list ap ) );
|
||||||
|
FGAPI void FGAPIENTRY glutInitWarningFunc( void (* vWarning)( const char *fmt, va_list ap ) );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- the display mode definitions
|
||||||
|
*/
|
||||||
|
#define GLUT_CAPTIONLESS 0x0400
|
||||||
|
#define GLUT_BORDERLESS 0x0800
|
||||||
|
#define GLUT_SRGB 0x1000
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*** END OF FILE ***/
|
||||||
|
|
||||||
|
#endif /* __FREEGLUT_EXT_H__ */
|
@ -0,0 +1,630 @@
|
|||||||
|
#ifndef __FREEGLUT_STD_H__
|
||||||
|
#define __FREEGLUT_STD_H__
|
||||||
|
|
||||||
|
/*
|
||||||
|
* freeglut_std.h
|
||||||
|
*
|
||||||
|
* The GLUT-compatible part of the freeglut library include file
|
||||||
|
*
|
||||||
|
* Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
|
||||||
|
* Written by Pawel W. Olszta, <olszta@sourceforge.net>
|
||||||
|
* Creation date: Thu Dec 2 1999
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included
|
||||||
|
* in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Under windows, we have to differentiate between static and dynamic libraries
|
||||||
|
*/
|
||||||
|
#ifdef _WIN32
|
||||||
|
/* #pragma may not be supported by some compilers.
|
||||||
|
* Discussion by FreeGLUT developers suggests that
|
||||||
|
* Visual C++ specific code involving pragmas may
|
||||||
|
* need to move to a separate header. 24th Dec 2003
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define FREEGLUT_LIB_PRAGMAS to 1 to include library
|
||||||
|
* pragmas or to 0 to exclude library pragmas.
|
||||||
|
* The default behavior depends on the compiler/platform.
|
||||||
|
*/
|
||||||
|
# ifndef FREEGLUT_LIB_PRAGMAS
|
||||||
|
# if ( defined(_MSC_VER) || defined(__WATCOMC__) ) && !defined(_WIN32_WCE)
|
||||||
|
# define FREEGLUT_LIB_PRAGMAS 1
|
||||||
|
# else
|
||||||
|
# define FREEGLUT_LIB_PRAGMAS 0
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
# define WIN32_LEAN_AND_MEAN 1
|
||||||
|
# endif
|
||||||
|
# ifndef NOMINMAX
|
||||||
|
# define NOMINMAX
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
|
||||||
|
/* Windows static library */
|
||||||
|
# ifdef FREEGLUT_STATIC
|
||||||
|
|
||||||
|
#error Static linking is not supported with this build. Please remove the FREEGLUT_STATIC preprocessor directive, or download the source code from http://freeglut.sf.net/ and build against that.
|
||||||
|
|
||||||
|
/* Windows shared library (DLL) */
|
||||||
|
# else
|
||||||
|
|
||||||
|
# define FGAPIENTRY __stdcall
|
||||||
|
# if defined(FREEGLUT_EXPORTS)
|
||||||
|
# define FGAPI __declspec(dllexport)
|
||||||
|
# else
|
||||||
|
# define FGAPI __declspec(dllimport)
|
||||||
|
|
||||||
|
/* Link with Win32 shared freeglut lib */
|
||||||
|
# if FREEGLUT_LIB_PRAGMAS
|
||||||
|
# pragma comment (lib, "freeglut.lib")
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/* Drag in other Windows libraries as required by FreeGLUT */
|
||||||
|
# if FREEGLUT_LIB_PRAGMAS
|
||||||
|
# pragma comment (lib, "glu32.lib") /* link OpenGL Utility lib */
|
||||||
|
# pragma comment (lib, "opengl32.lib") /* link Microsoft OpenGL lib */
|
||||||
|
# pragma comment (lib, "gdi32.lib") /* link Windows GDI lib */
|
||||||
|
# pragma comment (lib, "winmm.lib") /* link Windows MultiMedia lib */
|
||||||
|
# pragma comment (lib, "user32.lib") /* link Windows user lib */
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
/* Non-Windows definition of FGAPI and FGAPIENTRY */
|
||||||
|
# define FGAPI
|
||||||
|
# define FGAPIENTRY
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The freeglut and GLUT API versions
|
||||||
|
*/
|
||||||
|
#define FREEGLUT 1
|
||||||
|
#define GLUT_API_VERSION 4
|
||||||
|
#define GLUT_XLIB_IMPLEMENTATION 13
|
||||||
|
/* Deprecated:
|
||||||
|
cf. http://sourceforge.net/mailarchive/forum.php?thread_name=CABcAi1hw7cr4xtigckaGXB5X8wddLfMcbA_rZ3NAuwMrX_zmsw%40mail.gmail.com&forum_name=freeglut-developer */
|
||||||
|
#define FREEGLUT_VERSION_2_0 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Always include OpenGL and GLU headers
|
||||||
|
*/
|
||||||
|
#if __APPLE__
|
||||||
|
# include <OpenGL/gl.h>
|
||||||
|
# include <OpenGL/glu.h>
|
||||||
|
#else
|
||||||
|
# include <GL/gl.h>
|
||||||
|
# include <GL/glu.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- the special key codes:
|
||||||
|
*/
|
||||||
|
#define GLUT_KEY_F1 0x0001
|
||||||
|
#define GLUT_KEY_F2 0x0002
|
||||||
|
#define GLUT_KEY_F3 0x0003
|
||||||
|
#define GLUT_KEY_F4 0x0004
|
||||||
|
#define GLUT_KEY_F5 0x0005
|
||||||
|
#define GLUT_KEY_F6 0x0006
|
||||||
|
#define GLUT_KEY_F7 0x0007
|
||||||
|
#define GLUT_KEY_F8 0x0008
|
||||||
|
#define GLUT_KEY_F9 0x0009
|
||||||
|
#define GLUT_KEY_F10 0x000A
|
||||||
|
#define GLUT_KEY_F11 0x000B
|
||||||
|
#define GLUT_KEY_F12 0x000C
|
||||||
|
#define GLUT_KEY_LEFT 0x0064
|
||||||
|
#define GLUT_KEY_UP 0x0065
|
||||||
|
#define GLUT_KEY_RIGHT 0x0066
|
||||||
|
#define GLUT_KEY_DOWN 0x0067
|
||||||
|
#define GLUT_KEY_PAGE_UP 0x0068
|
||||||
|
#define GLUT_KEY_PAGE_DOWN 0x0069
|
||||||
|
#define GLUT_KEY_HOME 0x006A
|
||||||
|
#define GLUT_KEY_END 0x006B
|
||||||
|
#define GLUT_KEY_INSERT 0x006C
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- mouse state definitions
|
||||||
|
*/
|
||||||
|
#define GLUT_LEFT_BUTTON 0x0000
|
||||||
|
#define GLUT_MIDDLE_BUTTON 0x0001
|
||||||
|
#define GLUT_RIGHT_BUTTON 0x0002
|
||||||
|
#define GLUT_DOWN 0x0000
|
||||||
|
#define GLUT_UP 0x0001
|
||||||
|
#define GLUT_LEFT 0x0000
|
||||||
|
#define GLUT_ENTERED 0x0001
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- the display mode definitions
|
||||||
|
*/
|
||||||
|
#define GLUT_RGB 0x0000
|
||||||
|
#define GLUT_RGBA 0x0000
|
||||||
|
#define GLUT_INDEX 0x0001
|
||||||
|
#define GLUT_SINGLE 0x0000
|
||||||
|
#define GLUT_DOUBLE 0x0002
|
||||||
|
#define GLUT_ACCUM 0x0004
|
||||||
|
#define GLUT_ALPHA 0x0008
|
||||||
|
#define GLUT_DEPTH 0x0010
|
||||||
|
#define GLUT_STENCIL 0x0020
|
||||||
|
#define GLUT_MULTISAMPLE 0x0080
|
||||||
|
#define GLUT_STEREO 0x0100
|
||||||
|
#define GLUT_LUMINANCE 0x0200
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- windows and menu related definitions
|
||||||
|
*/
|
||||||
|
#define GLUT_MENU_NOT_IN_USE 0x0000
|
||||||
|
#define GLUT_MENU_IN_USE 0x0001
|
||||||
|
#define GLUT_NOT_VISIBLE 0x0000
|
||||||
|
#define GLUT_VISIBLE 0x0001
|
||||||
|
#define GLUT_HIDDEN 0x0000
|
||||||
|
#define GLUT_FULLY_RETAINED 0x0001
|
||||||
|
#define GLUT_PARTIALLY_RETAINED 0x0002
|
||||||
|
#define GLUT_FULLY_COVERED 0x0003
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- fonts definitions
|
||||||
|
*
|
||||||
|
* Steve Baker suggested to make it binary compatible with GLUT:
|
||||||
|
*/
|
||||||
|
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__WATCOMC__)
|
||||||
|
# define GLUT_STROKE_ROMAN ((void *)0x0000)
|
||||||
|
# define GLUT_STROKE_MONO_ROMAN ((void *)0x0001)
|
||||||
|
# define GLUT_BITMAP_9_BY_15 ((void *)0x0002)
|
||||||
|
# define GLUT_BITMAP_8_BY_13 ((void *)0x0003)
|
||||||
|
# define GLUT_BITMAP_TIMES_ROMAN_10 ((void *)0x0004)
|
||||||
|
# define GLUT_BITMAP_TIMES_ROMAN_24 ((void *)0x0005)
|
||||||
|
# define GLUT_BITMAP_HELVETICA_10 ((void *)0x0006)
|
||||||
|
# define GLUT_BITMAP_HELVETICA_12 ((void *)0x0007)
|
||||||
|
# define GLUT_BITMAP_HELVETICA_18 ((void *)0x0008)
|
||||||
|
#else
|
||||||
|
/*
|
||||||
|
* I don't really know if it's a good idea... But here it goes:
|
||||||
|
*/
|
||||||
|
extern void* glutStrokeRoman;
|
||||||
|
extern void* glutStrokeMonoRoman;
|
||||||
|
extern void* glutBitmap9By15;
|
||||||
|
extern void* glutBitmap8By13;
|
||||||
|
extern void* glutBitmapTimesRoman10;
|
||||||
|
extern void* glutBitmapTimesRoman24;
|
||||||
|
extern void* glutBitmapHelvetica10;
|
||||||
|
extern void* glutBitmapHelvetica12;
|
||||||
|
extern void* glutBitmapHelvetica18;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Those pointers will be used by following definitions:
|
||||||
|
*/
|
||||||
|
# define GLUT_STROKE_ROMAN ((void *) &glutStrokeRoman)
|
||||||
|
# define GLUT_STROKE_MONO_ROMAN ((void *) &glutStrokeMonoRoman)
|
||||||
|
# define GLUT_BITMAP_9_BY_15 ((void *) &glutBitmap9By15)
|
||||||
|
# define GLUT_BITMAP_8_BY_13 ((void *) &glutBitmap8By13)
|
||||||
|
# define GLUT_BITMAP_TIMES_ROMAN_10 ((void *) &glutBitmapTimesRoman10)
|
||||||
|
# define GLUT_BITMAP_TIMES_ROMAN_24 ((void *) &glutBitmapTimesRoman24)
|
||||||
|
# define GLUT_BITMAP_HELVETICA_10 ((void *) &glutBitmapHelvetica10)
|
||||||
|
# define GLUT_BITMAP_HELVETICA_12 ((void *) &glutBitmapHelvetica12)
|
||||||
|
# define GLUT_BITMAP_HELVETICA_18 ((void *) &glutBitmapHelvetica18)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- the glutGet parameters
|
||||||
|
*/
|
||||||
|
#define GLUT_WINDOW_X 0x0064
|
||||||
|
#define GLUT_WINDOW_Y 0x0065
|
||||||
|
#define GLUT_WINDOW_WIDTH 0x0066
|
||||||
|
#define GLUT_WINDOW_HEIGHT 0x0067
|
||||||
|
#define GLUT_WINDOW_BUFFER_SIZE 0x0068
|
||||||
|
#define GLUT_WINDOW_STENCIL_SIZE 0x0069
|
||||||
|
#define GLUT_WINDOW_DEPTH_SIZE 0x006A
|
||||||
|
#define GLUT_WINDOW_RED_SIZE 0x006B
|
||||||
|
#define GLUT_WINDOW_GREEN_SIZE 0x006C
|
||||||
|
#define GLUT_WINDOW_BLUE_SIZE 0x006D
|
||||||
|
#define GLUT_WINDOW_ALPHA_SIZE 0x006E
|
||||||
|
#define GLUT_WINDOW_ACCUM_RED_SIZE 0x006F
|
||||||
|
#define GLUT_WINDOW_ACCUM_GREEN_SIZE 0x0070
|
||||||
|
#define GLUT_WINDOW_ACCUM_BLUE_SIZE 0x0071
|
||||||
|
#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 0x0072
|
||||||
|
#define GLUT_WINDOW_DOUBLEBUFFER 0x0073
|
||||||
|
#define GLUT_WINDOW_RGBA 0x0074
|
||||||
|
#define GLUT_WINDOW_PARENT 0x0075
|
||||||
|
#define GLUT_WINDOW_NUM_CHILDREN 0x0076
|
||||||
|
#define GLUT_WINDOW_COLORMAP_SIZE 0x0077
|
||||||
|
#define GLUT_WINDOW_NUM_SAMPLES 0x0078
|
||||||
|
#define GLUT_WINDOW_STEREO 0x0079
|
||||||
|
#define GLUT_WINDOW_CURSOR 0x007A
|
||||||
|
|
||||||
|
#define GLUT_SCREEN_WIDTH 0x00C8
|
||||||
|
#define GLUT_SCREEN_HEIGHT 0x00C9
|
||||||
|
#define GLUT_SCREEN_WIDTH_MM 0x00CA
|
||||||
|
#define GLUT_SCREEN_HEIGHT_MM 0x00CB
|
||||||
|
#define GLUT_MENU_NUM_ITEMS 0x012C
|
||||||
|
#define GLUT_DISPLAY_MODE_POSSIBLE 0x0190
|
||||||
|
#define GLUT_INIT_WINDOW_X 0x01F4
|
||||||
|
#define GLUT_INIT_WINDOW_Y 0x01F5
|
||||||
|
#define GLUT_INIT_WINDOW_WIDTH 0x01F6
|
||||||
|
#define GLUT_INIT_WINDOW_HEIGHT 0x01F7
|
||||||
|
#define GLUT_INIT_DISPLAY_MODE 0x01F8
|
||||||
|
#define GLUT_ELAPSED_TIME 0x02BC
|
||||||
|
#define GLUT_WINDOW_FORMAT_ID 0x007B
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- the glutDeviceGet parameters
|
||||||
|
*/
|
||||||
|
#define GLUT_HAS_KEYBOARD 0x0258
|
||||||
|
#define GLUT_HAS_MOUSE 0x0259
|
||||||
|
#define GLUT_HAS_SPACEBALL 0x025A
|
||||||
|
#define GLUT_HAS_DIAL_AND_BUTTON_BOX 0x025B
|
||||||
|
#define GLUT_HAS_TABLET 0x025C
|
||||||
|
#define GLUT_NUM_MOUSE_BUTTONS 0x025D
|
||||||
|
#define GLUT_NUM_SPACEBALL_BUTTONS 0x025E
|
||||||
|
#define GLUT_NUM_BUTTON_BOX_BUTTONS 0x025F
|
||||||
|
#define GLUT_NUM_DIALS 0x0260
|
||||||
|
#define GLUT_NUM_TABLET_BUTTONS 0x0261
|
||||||
|
#define GLUT_DEVICE_IGNORE_KEY_REPEAT 0x0262
|
||||||
|
#define GLUT_DEVICE_KEY_REPEAT 0x0263
|
||||||
|
#define GLUT_HAS_JOYSTICK 0x0264
|
||||||
|
#define GLUT_OWNS_JOYSTICK 0x0265
|
||||||
|
#define GLUT_JOYSTICK_BUTTONS 0x0266
|
||||||
|
#define GLUT_JOYSTICK_AXES 0x0267
|
||||||
|
#define GLUT_JOYSTICK_POLL_RATE 0x0268
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- the glutLayerGet parameters
|
||||||
|
*/
|
||||||
|
#define GLUT_OVERLAY_POSSIBLE 0x0320
|
||||||
|
#define GLUT_LAYER_IN_USE 0x0321
|
||||||
|
#define GLUT_HAS_OVERLAY 0x0322
|
||||||
|
#define GLUT_TRANSPARENT_INDEX 0x0323
|
||||||
|
#define GLUT_NORMAL_DAMAGED 0x0324
|
||||||
|
#define GLUT_OVERLAY_DAMAGED 0x0325
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- the glutVideoResizeGet parameters
|
||||||
|
*/
|
||||||
|
#define GLUT_VIDEO_RESIZE_POSSIBLE 0x0384
|
||||||
|
#define GLUT_VIDEO_RESIZE_IN_USE 0x0385
|
||||||
|
#define GLUT_VIDEO_RESIZE_X_DELTA 0x0386
|
||||||
|
#define GLUT_VIDEO_RESIZE_Y_DELTA 0x0387
|
||||||
|
#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 0x0388
|
||||||
|
#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 0x0389
|
||||||
|
#define GLUT_VIDEO_RESIZE_X 0x038A
|
||||||
|
#define GLUT_VIDEO_RESIZE_Y 0x038B
|
||||||
|
#define GLUT_VIDEO_RESIZE_WIDTH 0x038C
|
||||||
|
#define GLUT_VIDEO_RESIZE_HEIGHT 0x038D
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- the glutUseLayer parameters
|
||||||
|
*/
|
||||||
|
#define GLUT_NORMAL 0x0000
|
||||||
|
#define GLUT_OVERLAY 0x0001
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- the glutGetModifiers parameters
|
||||||
|
*/
|
||||||
|
#define GLUT_ACTIVE_SHIFT 0x0001
|
||||||
|
#define GLUT_ACTIVE_CTRL 0x0002
|
||||||
|
#define GLUT_ACTIVE_ALT 0x0004
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- the glutSetCursor parameters
|
||||||
|
*/
|
||||||
|
#define GLUT_CURSOR_RIGHT_ARROW 0x0000
|
||||||
|
#define GLUT_CURSOR_LEFT_ARROW 0x0001
|
||||||
|
#define GLUT_CURSOR_INFO 0x0002
|
||||||
|
#define GLUT_CURSOR_DESTROY 0x0003
|
||||||
|
#define GLUT_CURSOR_HELP 0x0004
|
||||||
|
#define GLUT_CURSOR_CYCLE 0x0005
|
||||||
|
#define GLUT_CURSOR_SPRAY 0x0006
|
||||||
|
#define GLUT_CURSOR_WAIT 0x0007
|
||||||
|
#define GLUT_CURSOR_TEXT 0x0008
|
||||||
|
#define GLUT_CURSOR_CROSSHAIR 0x0009
|
||||||
|
#define GLUT_CURSOR_UP_DOWN 0x000A
|
||||||
|
#define GLUT_CURSOR_LEFT_RIGHT 0x000B
|
||||||
|
#define GLUT_CURSOR_TOP_SIDE 0x000C
|
||||||
|
#define GLUT_CURSOR_BOTTOM_SIDE 0x000D
|
||||||
|
#define GLUT_CURSOR_LEFT_SIDE 0x000E
|
||||||
|
#define GLUT_CURSOR_RIGHT_SIDE 0x000F
|
||||||
|
#define GLUT_CURSOR_TOP_LEFT_CORNER 0x0010
|
||||||
|
#define GLUT_CURSOR_TOP_RIGHT_CORNER 0x0011
|
||||||
|
#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 0x0012
|
||||||
|
#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 0x0013
|
||||||
|
#define GLUT_CURSOR_INHERIT 0x0064
|
||||||
|
#define GLUT_CURSOR_NONE 0x0065
|
||||||
|
#define GLUT_CURSOR_FULL_CROSSHAIR 0x0066
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- RGB color component specification definitions
|
||||||
|
*/
|
||||||
|
#define GLUT_RED 0x0000
|
||||||
|
#define GLUT_GREEN 0x0001
|
||||||
|
#define GLUT_BLUE 0x0002
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- additional keyboard and joystick definitions
|
||||||
|
*/
|
||||||
|
#define GLUT_KEY_REPEAT_OFF 0x0000
|
||||||
|
#define GLUT_KEY_REPEAT_ON 0x0001
|
||||||
|
#define GLUT_KEY_REPEAT_DEFAULT 0x0002
|
||||||
|
|
||||||
|
#define GLUT_JOYSTICK_BUTTON_A 0x0001
|
||||||
|
#define GLUT_JOYSTICK_BUTTON_B 0x0002
|
||||||
|
#define GLUT_JOYSTICK_BUTTON_C 0x0004
|
||||||
|
#define GLUT_JOYSTICK_BUTTON_D 0x0008
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GLUT API macro definitions -- game mode definitions
|
||||||
|
*/
|
||||||
|
#define GLUT_GAME_MODE_ACTIVE 0x0000
|
||||||
|
#define GLUT_GAME_MODE_POSSIBLE 0x0001
|
||||||
|
#define GLUT_GAME_MODE_WIDTH 0x0002
|
||||||
|
#define GLUT_GAME_MODE_HEIGHT 0x0003
|
||||||
|
#define GLUT_GAME_MODE_PIXEL_DEPTH 0x0004
|
||||||
|
#define GLUT_GAME_MODE_REFRESH_RATE 0x0005
|
||||||
|
#define GLUT_GAME_MODE_DISPLAY_CHANGED 0x0006
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Initialization functions, see fglut_init.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutInit( int* pargc, char** argv );
|
||||||
|
FGAPI void FGAPIENTRY glutInitWindowPosition( int x, int y );
|
||||||
|
FGAPI void FGAPIENTRY glutInitWindowSize( int width, int height );
|
||||||
|
FGAPI void FGAPIENTRY glutInitDisplayMode( unsigned int displayMode );
|
||||||
|
FGAPI void FGAPIENTRY glutInitDisplayString( const char* displayMode );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Process loop function, see freeglut_main.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutMainLoop( void );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Window management functions, see freeglut_window.c
|
||||||
|
*/
|
||||||
|
FGAPI int FGAPIENTRY glutCreateWindow( const char* title );
|
||||||
|
FGAPI int FGAPIENTRY glutCreateSubWindow( int window, int x, int y, int width, int height );
|
||||||
|
FGAPI void FGAPIENTRY glutDestroyWindow( int window );
|
||||||
|
FGAPI void FGAPIENTRY glutSetWindow( int window );
|
||||||
|
FGAPI int FGAPIENTRY glutGetWindow( void );
|
||||||
|
FGAPI void FGAPIENTRY glutSetWindowTitle( const char* title );
|
||||||
|
FGAPI void FGAPIENTRY glutSetIconTitle( const char* title );
|
||||||
|
FGAPI void FGAPIENTRY glutReshapeWindow( int width, int height );
|
||||||
|
FGAPI void FGAPIENTRY glutPositionWindow( int x, int y );
|
||||||
|
FGAPI void FGAPIENTRY glutShowWindow( void );
|
||||||
|
FGAPI void FGAPIENTRY glutHideWindow( void );
|
||||||
|
FGAPI void FGAPIENTRY glutIconifyWindow( void );
|
||||||
|
FGAPI void FGAPIENTRY glutPushWindow( void );
|
||||||
|
FGAPI void FGAPIENTRY glutPopWindow( void );
|
||||||
|
FGAPI void FGAPIENTRY glutFullScreen( void );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Display-connected functions, see freeglut_display.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutPostWindowRedisplay( int window );
|
||||||
|
FGAPI void FGAPIENTRY glutPostRedisplay( void );
|
||||||
|
FGAPI void FGAPIENTRY glutSwapBuffers( void );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Mouse cursor functions, see freeglut_cursor.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutWarpPointer( int x, int y );
|
||||||
|
FGAPI void FGAPIENTRY glutSetCursor( int cursor );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Overlay stuff, see freeglut_overlay.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutEstablishOverlay( void );
|
||||||
|
FGAPI void FGAPIENTRY glutRemoveOverlay( void );
|
||||||
|
FGAPI void FGAPIENTRY glutUseLayer( GLenum layer );
|
||||||
|
FGAPI void FGAPIENTRY glutPostOverlayRedisplay( void );
|
||||||
|
FGAPI void FGAPIENTRY glutPostWindowOverlayRedisplay( int window );
|
||||||
|
FGAPI void FGAPIENTRY glutShowOverlay( void );
|
||||||
|
FGAPI void FGAPIENTRY glutHideOverlay( void );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Menu stuff, see freeglut_menu.c
|
||||||
|
*/
|
||||||
|
FGAPI int FGAPIENTRY glutCreateMenu( void (* callback)( int menu ) );
|
||||||
|
FGAPI void FGAPIENTRY glutDestroyMenu( int menu );
|
||||||
|
FGAPI int FGAPIENTRY glutGetMenu( void );
|
||||||
|
FGAPI void FGAPIENTRY glutSetMenu( int menu );
|
||||||
|
FGAPI void FGAPIENTRY glutAddMenuEntry( const char* label, int value );
|
||||||
|
FGAPI void FGAPIENTRY glutAddSubMenu( const char* label, int subMenu );
|
||||||
|
FGAPI void FGAPIENTRY glutChangeToMenuEntry( int item, const char* label, int value );
|
||||||
|
FGAPI void FGAPIENTRY glutChangeToSubMenu( int item, const char* label, int value );
|
||||||
|
FGAPI void FGAPIENTRY glutRemoveMenuItem( int item );
|
||||||
|
FGAPI void FGAPIENTRY glutAttachMenu( int button );
|
||||||
|
FGAPI void FGAPIENTRY glutDetachMenu( int button );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Global callback functions, see freeglut_callbacks.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutTimerFunc( unsigned int time, void (* callback)( int ), int value );
|
||||||
|
FGAPI void FGAPIENTRY glutIdleFunc( void (* callback)( void ) );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Window-specific callback functions, see freeglut_callbacks.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutKeyboardFunc( void (* callback)( unsigned char, int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutSpecialFunc( void (* callback)( int, int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutReshapeFunc( void (* callback)( int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutVisibilityFunc( void (* callback)( int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutDisplayFunc( void (* callback)( void ) );
|
||||||
|
FGAPI void FGAPIENTRY glutMouseFunc( void (* callback)( int, int, int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutMotionFunc( void (* callback)( int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutPassiveMotionFunc( void (* callback)( int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutEntryFunc( void (* callback)( int ) );
|
||||||
|
|
||||||
|
FGAPI void FGAPIENTRY glutKeyboardUpFunc( void (* callback)( unsigned char, int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutSpecialUpFunc( void (* callback)( int, int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutJoystickFunc( void (* callback)( unsigned int, int, int, int ), int pollInterval );
|
||||||
|
FGAPI void FGAPIENTRY glutMenuStateFunc( void (* callback)( int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutMenuStatusFunc( void (* callback)( int, int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutOverlayDisplayFunc( void (* callback)( void ) );
|
||||||
|
FGAPI void FGAPIENTRY glutWindowStatusFunc( void (* callback)( int ) );
|
||||||
|
|
||||||
|
FGAPI void FGAPIENTRY glutSpaceballMotionFunc( void (* callback)( int, int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutSpaceballRotateFunc( void (* callback)( int, int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutSpaceballButtonFunc( void (* callback)( int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutButtonBoxFunc( void (* callback)( int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutDialsFunc( void (* callback)( int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutTabletMotionFunc( void (* callback)( int, int ) );
|
||||||
|
FGAPI void FGAPIENTRY glutTabletButtonFunc( void (* callback)( int, int, int, int ) );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* State setting and retrieval functions, see freeglut_state.c
|
||||||
|
*/
|
||||||
|
FGAPI int FGAPIENTRY glutGet( GLenum query );
|
||||||
|
FGAPI int FGAPIENTRY glutDeviceGet( GLenum query );
|
||||||
|
FGAPI int FGAPIENTRY glutGetModifiers( void );
|
||||||
|
FGAPI int FGAPIENTRY glutLayerGet( GLenum query );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Font stuff, see freeglut_font.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutBitmapCharacter( void* font, int character );
|
||||||
|
FGAPI int FGAPIENTRY glutBitmapWidth( void* font, int character );
|
||||||
|
FGAPI void FGAPIENTRY glutStrokeCharacter( void* font, int character );
|
||||||
|
FGAPI int FGAPIENTRY glutStrokeWidth( void* font, int character );
|
||||||
|
FGAPI int FGAPIENTRY glutBitmapLength( void* font, const unsigned char* string );
|
||||||
|
FGAPI int FGAPIENTRY glutStrokeLength( void* font, const unsigned char* string );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Geometry functions, see freeglut_geometry.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutWireCube( GLdouble size );
|
||||||
|
FGAPI void FGAPIENTRY glutSolidCube( GLdouble size );
|
||||||
|
FGAPI void FGAPIENTRY glutWireSphere( GLdouble radius, GLint slices, GLint stacks );
|
||||||
|
FGAPI void FGAPIENTRY glutSolidSphere( GLdouble radius, GLint slices, GLint stacks );
|
||||||
|
FGAPI void FGAPIENTRY glutWireCone( GLdouble base, GLdouble height, GLint slices, GLint stacks );
|
||||||
|
FGAPI void FGAPIENTRY glutSolidCone( GLdouble base, GLdouble height, GLint slices, GLint stacks );
|
||||||
|
|
||||||
|
FGAPI void FGAPIENTRY glutWireTorus( GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings );
|
||||||
|
FGAPI void FGAPIENTRY glutSolidTorus( GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings );
|
||||||
|
FGAPI void FGAPIENTRY glutWireDodecahedron( void );
|
||||||
|
FGAPI void FGAPIENTRY glutSolidDodecahedron( void );
|
||||||
|
FGAPI void FGAPIENTRY glutWireOctahedron( void );
|
||||||
|
FGAPI void FGAPIENTRY glutSolidOctahedron( void );
|
||||||
|
FGAPI void FGAPIENTRY glutWireTetrahedron( void );
|
||||||
|
FGAPI void FGAPIENTRY glutSolidTetrahedron( void );
|
||||||
|
FGAPI void FGAPIENTRY glutWireIcosahedron( void );
|
||||||
|
FGAPI void FGAPIENTRY glutSolidIcosahedron( void );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Teapot rendering functions, found in freeglut_teapot.c
|
||||||
|
* NB: front facing polygons have clockwise winding, not counter clockwise
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutWireTeapot( GLdouble size );
|
||||||
|
FGAPI void FGAPIENTRY glutSolidTeapot( GLdouble size );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Game mode functions, see freeglut_gamemode.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutGameModeString( const char* string );
|
||||||
|
FGAPI int FGAPIENTRY glutEnterGameMode( void );
|
||||||
|
FGAPI void FGAPIENTRY glutLeaveGameMode( void );
|
||||||
|
FGAPI int FGAPIENTRY glutGameModeGet( GLenum query );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Video resize functions, see freeglut_videoresize.c
|
||||||
|
*/
|
||||||
|
FGAPI int FGAPIENTRY glutVideoResizeGet( GLenum query );
|
||||||
|
FGAPI void FGAPIENTRY glutSetupVideoResizing( void );
|
||||||
|
FGAPI void FGAPIENTRY glutStopVideoResizing( void );
|
||||||
|
FGAPI void FGAPIENTRY glutVideoResize( int x, int y, int width, int height );
|
||||||
|
FGAPI void FGAPIENTRY glutVideoPan( int x, int y, int width, int height );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Colormap functions, see freeglut_misc.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutSetColor( int color, GLfloat red, GLfloat green, GLfloat blue );
|
||||||
|
FGAPI GLfloat FGAPIENTRY glutGetColor( int color, int component );
|
||||||
|
FGAPI void FGAPIENTRY glutCopyColormap( int window );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Misc keyboard and joystick functions, see freeglut_misc.c
|
||||||
|
*/
|
||||||
|
FGAPI void FGAPIENTRY glutIgnoreKeyRepeat( int ignore );
|
||||||
|
FGAPI void FGAPIENTRY glutSetKeyRepeat( int repeatMode );
|
||||||
|
FGAPI void FGAPIENTRY glutForceJoystickFunc( void );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Misc functions, see freeglut_misc.c
|
||||||
|
*/
|
||||||
|
FGAPI int FGAPIENTRY glutExtensionSupported( const char* extension );
|
||||||
|
FGAPI void FGAPIENTRY glutReportErrors( void );
|
||||||
|
|
||||||
|
/* Comment from glut.h of classic GLUT:
|
||||||
|
|
||||||
|
Win32 has an annoying issue where there are multiple C run-time
|
||||||
|
libraries (CRTs). If the executable is linked with a different CRT
|
||||||
|
from the GLUT DLL, the GLUT DLL will not share the same CRT static
|
||||||
|
data seen by the executable. In particular, atexit callbacks registered
|
||||||
|
in the executable will not be called if GLUT calls its (different)
|
||||||
|
exit routine). GLUT is typically built with the
|
||||||
|
"/MD" option (the CRT with multithreading DLL support), but the Visual
|
||||||
|
C++ linker default is "/ML" (the single threaded CRT).
|
||||||
|
|
||||||
|
One workaround to this issue is requiring users to always link with
|
||||||
|
the same CRT as GLUT is compiled with. That requires users supply a
|
||||||
|
non-standard option. GLUT 3.7 has its own built-in workaround where
|
||||||
|
the executable's "exit" function pointer is covertly passed to GLUT.
|
||||||
|
GLUT then calls the executable's exit function pointer to ensure that
|
||||||
|
any "atexit" calls registered by the application are called if GLUT
|
||||||
|
needs to exit.
|
||||||
|
|
||||||
|
Note that the __glut*WithExit routines should NEVER be called directly.
|
||||||
|
To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
|
||||||
|
|
||||||
|
/* to get the prototype for exit() */
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) && !defined(__WATCOMC__)
|
||||||
|
FGAPI void FGAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
|
||||||
|
FGAPI int FGAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
|
||||||
|
FGAPI int FGAPIENTRY __glutCreateMenuWithExit(void (* func)(int), void (__cdecl *exitfunc)(int));
|
||||||
|
#ifndef FREEGLUT_BUILDING_LIB
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#define FGUNUSED __attribute__((unused))
|
||||||
|
#else
|
||||||
|
#define FGUNUSED
|
||||||
|
#endif
|
||||||
|
static void FGAPIENTRY FGUNUSED glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); }
|
||||||
|
#define glutInit glutInit_ATEXIT_HACK
|
||||||
|
static int FGAPIENTRY FGUNUSED glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); }
|
||||||
|
#define glutCreateWindow glutCreateWindow_ATEXIT_HACK
|
||||||
|
static int FGAPIENTRY FGUNUSED glutCreateMenu_ATEXIT_HACK(void (* func)(int)) { return __glutCreateMenuWithExit(func, exit); }
|
||||||
|
#define glutCreateMenu glutCreateMenu_ATEXIT_HACK
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*** END OF FILE ***/
|
||||||
|
|
||||||
|
#endif /* __FREEGLUT_STD_H__ */
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,21 @@
|
|||||||
|
#ifndef __GLUT_H__
|
||||||
|
#define __GLUT_H__
|
||||||
|
|
||||||
|
/*
|
||||||
|
* glut.h
|
||||||
|
*
|
||||||
|
* The freeglut library include file
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "freeglut_std.h"
|
||||||
|
|
||||||
|
/*** END OF FILE ***/
|
||||||
|
|
||||||
|
#endif /* __GLUT_H__ */
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,180 @@
|
|||||||
|
/*************************************************************************
|
||||||
|
* GLFW 3.0 - www.glfw.org
|
||||||
|
* A library for OpenGL, window and input
|
||||||
|
*------------------------------------------------------------------------
|
||||||
|
* Copyright (c) 2002-2006 Marcus Geelnard
|
||||||
|
* Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
||||||
|
*
|
||||||
|
* This software is provided 'as-is', without any express or implied
|
||||||
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
* arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
|
* including commercial applications, and to alter it and redistribute it
|
||||||
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
|
* claim that you wrote the original software. If you use this software
|
||||||
|
* in a product, an acknowledgment in the product documentation would
|
||||||
|
* be appreciated but is not required.
|
||||||
|
*
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not
|
||||||
|
* be misrepresented as being the original software.
|
||||||
|
*
|
||||||
|
* 3. This notice may not be removed or altered from any source
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
*************************************************************************/
|
||||||
|
|
||||||
|
#ifndef _glfw3_native_h_
|
||||||
|
#define _glfw3_native_h_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* Doxygen documentation
|
||||||
|
*************************************************************************/
|
||||||
|
|
||||||
|
/*! @defgroup native Native access
|
||||||
|
*
|
||||||
|
* **By using the native API, you assert that you know what you're doing and
|
||||||
|
* how to fix problems caused by using it. If you don't, you shouldn't be
|
||||||
|
* using it.**
|
||||||
|
*
|
||||||
|
* Before the inclusion of @ref glfw3native.h, you must define exactly one
|
||||||
|
* window API macro and exactly one context API macro. Failure to do this
|
||||||
|
* will cause a compile-time error.
|
||||||
|
*
|
||||||
|
* The available window API macros are:
|
||||||
|
* * `GLFW_EXPOSE_NATIVE_WIN32`
|
||||||
|
* * `GLFW_EXPOSE_NATIVE_COCOA`
|
||||||
|
* * `GLFW_EXPOSE_NATIVE_X11`
|
||||||
|
*
|
||||||
|
* The available context API macros are:
|
||||||
|
* * `GLFW_EXPOSE_NATIVE_WGL`
|
||||||
|
* * `GLFW_EXPOSE_NATIVE_NSGL`
|
||||||
|
* * `GLFW_EXPOSE_NATIVE_GLX`
|
||||||
|
* * `GLFW_EXPOSE_NATIVE_EGL`
|
||||||
|
*
|
||||||
|
* These macros select which of the native access functions that are declared
|
||||||
|
* and which platform-specific headers to include. It is then up your (by
|
||||||
|
* definition platform-specific) code to handle which of these should be
|
||||||
|
* defined.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* System headers and types
|
||||||
|
*************************************************************************/
|
||||||
|
|
||||||
|
#if defined(GLFW_EXPOSE_NATIVE_WIN32)
|
||||||
|
#include <windows.h>
|
||||||
|
#elif defined(GLFW_EXPOSE_NATIVE_COCOA)
|
||||||
|
#if defined(__OBJC__)
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#else
|
||||||
|
typedef void* id;
|
||||||
|
#endif
|
||||||
|
#elif defined(GLFW_EXPOSE_NATIVE_X11)
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#else
|
||||||
|
#error "No window API specified"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(GLFW_EXPOSE_NATIVE_WGL)
|
||||||
|
/* WGL is declared by windows.h */
|
||||||
|
#elif defined(GLFW_EXPOSE_NATIVE_NSGL)
|
||||||
|
/* NSGL is declared by Cocoa.h */
|
||||||
|
#elif defined(GLFW_EXPOSE_NATIVE_GLX)
|
||||||
|
#include <GL/glx.h>
|
||||||
|
#elif defined(GLFW_EXPOSE_NATIVE_EGL)
|
||||||
|
#include <EGL/egl.h>
|
||||||
|
#else
|
||||||
|
#error "No context API specified"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* Functions
|
||||||
|
*************************************************************************/
|
||||||
|
|
||||||
|
#if defined(GLFW_EXPOSE_NATIVE_WIN32)
|
||||||
|
/*! @brief Returns the `HWND` of the specified window.
|
||||||
|
* @return The `HWND` of the specified window.
|
||||||
|
* @ingroup native
|
||||||
|
*/
|
||||||
|
GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(GLFW_EXPOSE_NATIVE_WGL)
|
||||||
|
/*! @brief Returns the `HGLRC` of the specified window.
|
||||||
|
* @return The `HGLRC` of the specified window.
|
||||||
|
* @ingroup native
|
||||||
|
*/
|
||||||
|
GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(GLFW_EXPOSE_NATIVE_COCOA)
|
||||||
|
/*! @brief Returns the `NSWindow` of the specified window.
|
||||||
|
* @return The `NSWindow` of the specified window.
|
||||||
|
* @ingroup native
|
||||||
|
*/
|
||||||
|
GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(GLFW_EXPOSE_NATIVE_NSGL)
|
||||||
|
/*! @brief Returns the `NSOpenGLContext` of the specified window.
|
||||||
|
* @return The `NSOpenGLContext` of the specified window.
|
||||||
|
* @ingroup native
|
||||||
|
*/
|
||||||
|
GLFWAPI id glfwGetNSGLContext(GLFWwindow* window);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(GLFW_EXPOSE_NATIVE_X11)
|
||||||
|
/*! @brief Returns the `Display` used by GLFW.
|
||||||
|
* @return The `Display` used by GLFW.
|
||||||
|
* @ingroup native
|
||||||
|
*/
|
||||||
|
GLFWAPI Display* glfwGetX11Display(void);
|
||||||
|
/*! @brief Returns the `Window` of the specified window.
|
||||||
|
* @return The `Window` of the specified window.
|
||||||
|
* @ingroup native
|
||||||
|
*/
|
||||||
|
GLFWAPI Window glfwGetX11Window(GLFWwindow* window);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(GLFW_EXPOSE_NATIVE_GLX)
|
||||||
|
/*! @brief Returns the `GLXContext` of the specified window.
|
||||||
|
* @return The `GLXContext` of the specified window.
|
||||||
|
* @ingroup native
|
||||||
|
*/
|
||||||
|
GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(GLFW_EXPOSE_NATIVE_EGL)
|
||||||
|
/*! @brief Returns the `EGLDisplay` used by GLFW.
|
||||||
|
* @return The `EGLDisplay` used by GLFW.
|
||||||
|
* @ingroup native
|
||||||
|
*/
|
||||||
|
GLFWAPI EGLDisplay glfwGetEGLDisplay(void);
|
||||||
|
/*! @brief Returns the `EGLContext` of the specified window.
|
||||||
|
* @return The `EGLContext` of the specified window.
|
||||||
|
* @ingroup native
|
||||||
|
*/
|
||||||
|
GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window);
|
||||||
|
/*! @brief Returns the `EGLSurface` of the specified window.
|
||||||
|
* @return The `EGLSurface` of the specified window.
|
||||||
|
* @ingroup native
|
||||||
|
*/
|
||||||
|
GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _glfw3_native_h_ */
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,68 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="nupengl_core_init">
|
||||||
|
<PropertyGroup Label="Default initializers for properties">
|
||||||
|
<Linkage-nupengl_core Condition="'$(Linkage-nupengl_core)' == ''">dynamic</Linkage-nupengl_core>
|
||||||
|
<CallingConvention-nupengl_core Condition="'$(CallingConvention-nupengl_core)' == ''">cdecl</CallingConvention-nupengl_core>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Label="x64" Condition="'$(Platform.ToLower())' == 'x64'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>$(MSBuildThisFileDirectory)../..//build/native/lib/x64\glew32.lib;$(MSBuildThisFileDirectory)../..//build/native/lib/x64\glfw3dll.lib;$(MSBuildThisFileDirectory)../..//build/native/lib/x64\freeglut.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Label="Win32" Condition="'$(Platform.ToLower())' == 'win32'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>$(MSBuildThisFileDirectory)../..//build/native/lib/Win32\glew32.lib;$(MSBuildThisFileDirectory)../..//build/native/lib/Win32\glfw3dll.lib;$(MSBuildThisFileDirectory)../..//build/native/lib/Win32\freeglut.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup>
|
||||||
|
<ClCompile>
|
||||||
|
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../..//build/native/include/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<ResourceCompile>
|
||||||
|
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../..//build/native/include/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)\default-propertiesui.xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<UsingTask TaskName="nupengl_core_Contains" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" TaskFactory="CodeTaskFactory">
|
||||||
|
<ParameterGroup>
|
||||||
|
<Text Output="false" ParameterType="System.String" />
|
||||||
|
<Library Output="false" Required="true" ParameterType="System.String" />
|
||||||
|
<Value Output="false" Required="true" ParameterType="System.String" />
|
||||||
|
<Result Output="true" ParameterType="System.String" />
|
||||||
|
</ParameterGroup>
|
||||||
|
<Task>
|
||||||
|
<Code>Result = ((Text ?? "").Split(';').Contains(Library) ) ? Value : String.Empty;</Code>
|
||||||
|
</Task>
|
||||||
|
</UsingTask>
|
||||||
|
<Target Name="nupengl_core_init">
|
||||||
|
<nupengl_core_Contains Text="Linkage-dynamic" Library="nupengl_core" Value="dynamic" Condition="'$(Linkage-nupengl_core)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="Linkage-nupengl_core" />
|
||||||
|
</nupengl_core_Contains>
|
||||||
|
<nupengl_core_Contains Text="Linkage-static" Library="nupengl_core" Value="static" Condition="'$(Linkage-nupengl_core)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="Linkage-nupengl_core" />
|
||||||
|
</nupengl_core_Contains>
|
||||||
|
<nupengl_core_Contains Text="Linkage-ltcg" Library="nupengl_core" Value="ltcg" Condition="'$(Linkage-nupengl_core)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="Linkage-nupengl_core" />
|
||||||
|
</nupengl_core_Contains>
|
||||||
|
<nupengl_core_Contains Text="Linkage-sxs" Library="nupengl_core" Value="sxs" Condition="'$(Linkage-nupengl_core)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="Linkage-nupengl_core" />
|
||||||
|
</nupengl_core_Contains>
|
||||||
|
<nupengl_core_Contains Text="CallingConvention-cdecl" Library="nupengl_core" Value="cdecl" Condition="'$(CallingConvention-nupengl_core)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="CallingConvention-nupengl_core" />
|
||||||
|
</nupengl_core_Contains>
|
||||||
|
<nupengl_core_Contains Text="CallingConvention-stdcall" Library="nupengl_core" Value="stdcall" Condition="'$(CallingConvention-nupengl_core)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="CallingConvention-nupengl_core" />
|
||||||
|
</nupengl_core_Contains>
|
||||||
|
<nupengl_core_Contains Text="CallingConvention-fastcall" Library="nupengl_core" Value="fastcall" Condition="'$(CallingConvention-nupengl_core)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="CallingConvention-nupengl_core" />
|
||||||
|
</nupengl_core_Contains>
|
||||||
|
<nupengl_core_Contains Text="CallingConvention-thiscall" Library="nupengl_core" Value="thiscall" Condition="'$(CallingConvention-nupengl_core)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="CallingConvention-nupengl_core" />
|
||||||
|
</nupengl_core_Contains>
|
||||||
|
<nupengl_core_Contains Text="CallingConvention-clrcall" Library="nupengl_core" Value="clrcall" Condition="'$(CallingConvention-nupengl_core)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="CallingConvention-nupengl_core" />
|
||||||
|
</nupengl_core_Contains>
|
||||||
|
</Target>
|
||||||
|
</Project>
|
@ -0,0 +1,2 @@
|
|||||||
|
Package Created: 10/14/2015 4:58:11 PM
|
||||||
|
CoApp tools version: 1.23.521.0
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,8 @@
|
|||||||
|
configurations {
|
||||||
|
Platform {
|
||||||
|
key : "Platform";
|
||||||
|
choices : { Win32, x64 };
|
||||||
|
Win32.aliases : { x86, win32, ia32, 386 };
|
||||||
|
x64.aliases : { x64, amd64, em64t, intel64, x86-64, x86_64 };
|
||||||
|
};
|
||||||
|
};
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework">
|
||||||
|
<Rule Name="ProjectSettings_globals" PageTemplate="tool" DisplayName="Project Master Settings" SwitchPrefix="/" Order="1">
|
||||||
|
<Rule.Categories>
|
||||||
|
<Category Name="cpp" DisplayName="C/C++ Settings" />
|
||||||
|
</Rule.Categories>
|
||||||
|
<Rule.DataSource>
|
||||||
|
<DataSource Persistence="ProjectFile" ItemType="" />
|
||||||
|
</Rule.DataSource>
|
||||||
|
<EnumProperty Name="RuntimeLibrary" DisplayName="Runtime Library" Description="Specify runtime library for linking." Category="cpp" >
|
||||||
|
<EnumValue Name="MultiThreaded" DisplayName="Multi-threaded" Description="Causes your application to use the multithread, static version of the run-time library.">
|
||||||
|
</EnumValue>
|
||||||
|
<EnumValue Name="MultiThreadedDebug" DisplayName="Multi-threaded Debug" Description="Defines _DEBUG and _MT. This option also causes the compiler to place the library name LIBCMTD.lib into the .obj file so that the linker will use LIBCMTD.lib to resolve external symbols.">
|
||||||
|
</EnumValue>
|
||||||
|
<EnumValue Name="MultiThreadedDLL" DisplayName="Multi-threaded DLL" Description="Causes your application to use the multithread- and DLL-specific version of the run-time library. Defines _MT and _DLL and causes the compiler to place the library name MSVCRT.lib into the .obj file.">
|
||||||
|
</EnumValue>
|
||||||
|
<EnumValue Name="MultiThreadedDebugDLL" DisplayName="Multi-threaded Debug DLL" Description="Defines _DEBUG, _MT, and _DLL and causes your application to use the debug multithread- and DLL-specific version of the run-time library. It also causes the compiler to place the library name MSVCRTD.lib into the .obj file.">
|
||||||
|
</EnumValue>
|
||||||
|
</EnumProperty>
|
||||||
|
</Rule>
|
||||||
|
</ProjectSchemaDefinitions>
|
@ -0,0 +1,107 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="nupengl_core_redist_init;nupengl_core_redist_init_2">
|
||||||
|
<PropertyGroup Label="Default initializers for properties">
|
||||||
|
<Linkage-nupengl_core_redist Condition="'$(Linkage-nupengl_core_redist)' == ''">dynamic</Linkage-nupengl_core_redist>
|
||||||
|
<CallingConvention-nupengl_core_redist Condition="'$(CallingConvention-nupengl_core_redist)' == ''">cdecl</CallingConvention-nupengl_core_redist>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Target Name="nupengl_core_redist_init">
|
||||||
|
<nupengl_core_redist_Contains Text="Linkage-dynamic" Library="nupengl_core_redist" Value="dynamic" Condition="'$(Linkage-nupengl_core_redist)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="Linkage-nupengl_core_redist" />
|
||||||
|
</nupengl_core_redist_Contains>
|
||||||
|
<nupengl_core_redist_Contains Text="Linkage-static" Library="nupengl_core_redist" Value="static" Condition="'$(Linkage-nupengl_core_redist)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="Linkage-nupengl_core_redist" />
|
||||||
|
</nupengl_core_redist_Contains>
|
||||||
|
<nupengl_core_redist_Contains Text="Linkage-ltcg" Library="nupengl_core_redist" Value="ltcg" Condition="'$(Linkage-nupengl_core_redist)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="Linkage-nupengl_core_redist" />
|
||||||
|
</nupengl_core_redist_Contains>
|
||||||
|
<nupengl_core_redist_Contains Text="Linkage-sxs" Library="nupengl_core_redist" Value="sxs" Condition="'$(Linkage-nupengl_core_redist)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="Linkage-nupengl_core_redist" />
|
||||||
|
</nupengl_core_redist_Contains>
|
||||||
|
<nupengl_core_redist_Contains Text="CallingConvention-cdecl" Library="nupengl_core_redist" Value="cdecl" Condition="'$(CallingConvention-nupengl_core_redist)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="CallingConvention-nupengl_core_redist" />
|
||||||
|
</nupengl_core_redist_Contains>
|
||||||
|
<nupengl_core_redist_Contains Text="CallingConvention-stdcall" Library="nupengl_core_redist" Value="stdcall" Condition="'$(CallingConvention-nupengl_core_redist)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="CallingConvention-nupengl_core_redist" />
|
||||||
|
</nupengl_core_redist_Contains>
|
||||||
|
<nupengl_core_redist_Contains Text="CallingConvention-fastcall" Library="nupengl_core_redist" Value="fastcall" Condition="'$(CallingConvention-nupengl_core_redist)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="CallingConvention-nupengl_core_redist" />
|
||||||
|
</nupengl_core_redist_Contains>
|
||||||
|
<nupengl_core_redist_Contains Text="CallingConvention-thiscall" Library="nupengl_core_redist" Value="thiscall" Condition="'$(CallingConvention-nupengl_core_redist)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="CallingConvention-nupengl_core_redist" />
|
||||||
|
</nupengl_core_redist_Contains>
|
||||||
|
<nupengl_core_redist_Contains Text="CallingConvention-clrcall" Library="nupengl_core_redist" Value="clrcall" Condition="'$(CallingConvention-nupengl_core_redist)'==''">
|
||||||
|
<Output TaskParameter="Result" PropertyName="CallingConvention-nupengl_core_redist" />
|
||||||
|
</nupengl_core_redist_Contains>
|
||||||
|
</Target>
|
||||||
|
<Target Name="nupengl_core_redist_init_2">
|
||||||
|
<SetEnv Condition="'$(Platform.ToLower())' == 'x64'" Name="PATH" Prefix="true" Value="$(MSBuildThisFileDirectory)../..//build/native/bin/x64">
|
||||||
|
<Output TaskParameter="OutputEnvironmentVariable" PropertyName="PATH" />
|
||||||
|
</SetEnv>
|
||||||
|
<SetEnv Condition="'$(Platform.ToLower())' == 'win32'" Name="PATH" Prefix="true" Value="$(MSBuildThisFileDirectory)../..//build/native/bin/Win32">
|
||||||
|
<Output TaskParameter="OutputEnvironmentVariable" PropertyName="PATH" />
|
||||||
|
</SetEnv>
|
||||||
|
</Target>
|
||||||
|
<ItemGroup Label="x64" Condition="'$(Platform.ToLower())' == 'x64'">
|
||||||
|
<None Include="$(MSBuildThisFileDirectory)../..//build/native/bin/x64\freeglut.dll" Condition="(('$(AppContainerApplication.ToLower())' == 'true')) OR (('$(TargetPlatformIdentifier.ToLower())' == 'windows phone' And '$(TargetPlatformVersion)' == '8.0'))">
|
||||||
|
<DeploymentContent>true</DeploymentContent>
|
||||||
|
</None>
|
||||||
|
<None Include="$(MSBuildThisFileDirectory)../..//build/native/bin/x64\glew32.dll" Condition="(('$(AppContainerApplication.ToLower())' == 'true')) OR (('$(TargetPlatformIdentifier.ToLower())' == 'windows phone' And '$(TargetPlatformVersion)' == '8.0'))">
|
||||||
|
<DeploymentContent>true</DeploymentContent>
|
||||||
|
</None>
|
||||||
|
<None Include="$(MSBuildThisFileDirectory)../..//build/native/bin/x64\glewinfo.exe" Condition="(('$(AppContainerApplication.ToLower())' == 'true')) OR (('$(TargetPlatformIdentifier.ToLower())' == 'windows phone' And '$(TargetPlatformVersion)' == '8.0'))">
|
||||||
|
<DeploymentContent>true</DeploymentContent>
|
||||||
|
</None>
|
||||||
|
<None Include="$(MSBuildThisFileDirectory)../..//build/native/bin/x64\glfw3.dll" Condition="(('$(AppContainerApplication.ToLower())' == 'true')) OR (('$(TargetPlatformIdentifier.ToLower())' == 'windows phone' And '$(TargetPlatformVersion)' == '8.0'))">
|
||||||
|
<DeploymentContent>true</DeploymentContent>
|
||||||
|
</None>
|
||||||
|
<None Include="$(MSBuildThisFileDirectory)../..//build/native/bin/x64\visualinfo.exe" Condition="(('$(AppContainerApplication.ToLower())' == 'true')) OR (('$(TargetPlatformIdentifier.ToLower())' == 'windows phone' And '$(TargetPlatformVersion)' == '8.0'))">
|
||||||
|
<DeploymentContent>true</DeploymentContent>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup Label="Win32" Condition="'$(Platform.ToLower())' == 'win32'">
|
||||||
|
<None Include="$(MSBuildThisFileDirectory)../..//build/native/bin/Win32\freeglut.dll" Condition="(('$(AppContainerApplication.ToLower())' == 'true')) OR (('$(TargetPlatformIdentifier.ToLower())' == 'windows phone' And '$(TargetPlatformVersion)' == '8.0'))">
|
||||||
|
<DeploymentContent>true</DeploymentContent>
|
||||||
|
</None>
|
||||||
|
<None Include="$(MSBuildThisFileDirectory)../..//build/native/bin/Win32\glew32.dll" Condition="(('$(AppContainerApplication.ToLower())' == 'true')) OR (('$(TargetPlatformIdentifier.ToLower())' == 'windows phone' And '$(TargetPlatformVersion)' == '8.0'))">
|
||||||
|
<DeploymentContent>true</DeploymentContent>
|
||||||
|
</None>
|
||||||
|
<None Include="$(MSBuildThisFileDirectory)../..//build/native/bin/Win32\glewinfo.exe" Condition="(('$(AppContainerApplication.ToLower())' == 'true')) OR (('$(TargetPlatformIdentifier.ToLower())' == 'windows phone' And '$(TargetPlatformVersion)' == '8.0'))">
|
||||||
|
<DeploymentContent>true</DeploymentContent>
|
||||||
|
</None>
|
||||||
|
<None Include="$(MSBuildThisFileDirectory)../..//build/native/bin/Win32\glfw3.dll" Condition="(('$(AppContainerApplication.ToLower())' == 'true')) OR (('$(TargetPlatformIdentifier.ToLower())' == 'windows phone' And '$(TargetPlatformVersion)' == '8.0'))">
|
||||||
|
<DeploymentContent>true</DeploymentContent>
|
||||||
|
</None>
|
||||||
|
<None Include="$(MSBuildThisFileDirectory)../..//build/native/bin/Win32\visualinfo.exe" Condition="(('$(AppContainerApplication.ToLower())' == 'true')) OR (('$(TargetPlatformIdentifier.ToLower())' == 'windows phone' And '$(TargetPlatformVersion)' == '8.0'))">
|
||||||
|
<DeploymentContent>true</DeploymentContent>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)\default-propertiesui.xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Target Name="nupengl_core_redist_AfterBuild" AfterTargets="AfterBuild" />
|
||||||
|
<Target Name="nupengl_core_redist_AfterBuild_x64" Label="x64" Condition="'$(Platform.ToLower())' == 'x64'" AfterTargets="nupengl_core_redist_AfterBuild">
|
||||||
|
<Copy SourceFiles="$(MSBuildThisFileDirectory)../..//build/native/bin/x64\freeglut.dll" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
|
||||||
|
<Copy SourceFiles="$(MSBuildThisFileDirectory)../..//build/native/bin/x64\glfw3.dll" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
|
||||||
|
<Copy SourceFiles="$(MSBuildThisFileDirectory)../..//build/native/bin/x64\glew32.dll" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
|
||||||
|
<Copy SourceFiles="$(MSBuildThisFileDirectory)../..//build/native/bin/x64\glewinfo.exe" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
|
||||||
|
<Copy SourceFiles="$(MSBuildThisFileDirectory)../..//build/native/bin/x64\visualinfo.exe" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
|
||||||
|
</Target>
|
||||||
|
<Target Name="nupengl_core_redist_AfterBuild_Win32" Label="Win32" Condition="'$(Platform.ToLower())' == 'win32'" AfterTargets="nupengl_core_redist_AfterBuild">
|
||||||
|
<Copy SourceFiles="$(MSBuildThisFileDirectory)../..//build/native/bin/Win32\freeglut.dll" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
|
||||||
|
<Copy SourceFiles="$(MSBuildThisFileDirectory)../..//build/native/bin/Win32\glfw3.dll" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
|
||||||
|
<Copy SourceFiles="$(MSBuildThisFileDirectory)../..//build/native/bin/Win32\glew32.dll" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
|
||||||
|
<Copy SourceFiles="$(MSBuildThisFileDirectory)../..//build/native/bin/Win32\glewinfo.exe" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
|
||||||
|
<Copy SourceFiles="$(MSBuildThisFileDirectory)../..//build/native/bin/Win32\visualinfo.exe" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
|
||||||
|
</Target>
|
||||||
|
<UsingTask TaskName="nupengl_core_redist_Contains" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" TaskFactory="CodeTaskFactory">
|
||||||
|
<ParameterGroup>
|
||||||
|
<Text Output="false" ParameterType="System.String" />
|
||||||
|
<Library Output="false" Required="true" ParameterType="System.String" />
|
||||||
|
<Value Output="false" Required="true" ParameterType="System.String" />
|
||||||
|
<Result Output="true" ParameterType="System.String" />
|
||||||
|
</ParameterGroup>
|
||||||
|
<Task>
|
||||||
|
<Code>Result = ((Text ?? "").Split(';').Contains(Library) ) ? Value : String.Empty;</Code>
|
||||||
|
</Task>
|
||||||
|
</UsingTask>
|
||||||
|
</Project>
|
@ -0,0 +1,2 @@
|
|||||||
|
Package Created: 10/14/2015 4:58:13 PM
|
||||||
|
CoApp tools version: 1.23.521.0
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,2 @@
|
|||||||
|
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
|
||||||
|
Debug|Win32|F:\C++\Lab02_秦思远\try\|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="nupengl.core" version="0.1.0.1" targetFramework="native" />
|
||||||
|
<package id="nupengl.core.redist" version="0.1.0.1" targetFramework="native" />
|
||||||
|
</packages>
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,142 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<VCProjectVersion>15.0</VCProjectVersion>
|
||||||
|
<ProjectGuid>{E764B027-5E70-446D-AD7B-45D5C7845466}</ProjectGuid>
|
||||||
|
<RootNamespace>try</RootNamespace>
|
||||||
|
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="Shared">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup />
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalLibraryDirectories>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\GL</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>glut32.lib;glut.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="源.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="stb_image.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
<Import Project="..\packages\nupengl.core.redist.0.1.0.1\build\native\nupengl.core.redist.targets" Condition="Exists('..\packages\nupengl.core.redist.0.1.0.1\build\native\nupengl.core.redist.targets')" />
|
||||||
|
<Import Project="..\packages\nupengl.core.0.1.0.1\build\native\nupengl.core.targets" Condition="Exists('..\packages\nupengl.core.0.1.0.1\build\native\nupengl.core.targets')" />
|
||||||
|
</ImportGroup>
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\packages\nupengl.core.redist.0.1.0.1\build\native\nupengl.core.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\nupengl.core.redist.0.1.0.1\build\native\nupengl.core.redist.targets'))" />
|
||||||
|
<Error Condition="!Exists('..\packages\nupengl.core.0.1.0.1\build\native\nupengl.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\nupengl.core.0.1.0.1\build\native\nupengl.core.targets'))" />
|
||||||
|
</Target>
|
||||||
|
</Project>
|
@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="源文件">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="头文件">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="资源文件">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="源.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="stb_image.h">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup />
|
||||||
|
</Project>
|
@ -0,0 +1,942 @@
|
|||||||
|
using namespace std;
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <GL/glut.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <windows.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <memory.h>
|
||||||
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
|
#include "stb_image.h"
|
||||||
|
|
||||||
|
#define ESCAPE 27
|
||||||
|
|
||||||
|
GLint window;
|
||||||
|
GLint window2;
|
||||||
|
GLint Xsize = 1000;
|
||||||
|
GLint Ysize = 800;
|
||||||
|
float i, theta;
|
||||||
|
GLint nml = 0, day = 1;
|
||||||
|
|
||||||
|
char name3[] = "PROJECT: 3D CAR";
|
||||||
|
|
||||||
|
GLfloat xt = 0.0, yt = 0.0, zt = 0.0, xw = 0.0;
|
||||||
|
GLfloat xs = 1.0, ys = 1.0, zs = 1.0;
|
||||||
|
GLfloat xangle = 0.0, yangle = 0.0, zangle = 0.0, angle = 0.0;
|
||||||
|
|
||||||
|
GLfloat r = 0, g = 0, b = 1;
|
||||||
|
GLint light = 1;
|
||||||
|
int count = 1, flg = 1;
|
||||||
|
int view = 0;
|
||||||
|
int flag1 = 0, aflag = 1; //to switch car driving mode
|
||||||
|
int flag2 = 0, wheelflag = 0; //to switch fog effect
|
||||||
|
|
||||||
|
|
||||||
|
GLfloat w[4][3] = { { 3.8,4.0,0.0 },{ 3.8,-4.0,0.0 },{ -3.8,4.0,0.0 },{ -3.8,-4.0,0.0 } };
|
||||||
|
//use in texture
|
||||||
|
GLuint toTextures[4];
|
||||||
|
GLUquadricObj *t;//for texure
|
||||||
|
|
||||||
|
|
||||||
|
static void SpecialKeyFunc(int Key, int x, int y);
|
||||||
|
|
||||||
|
|
||||||
|
GLvoid Transform(GLfloat Width, GLfloat Height)
|
||||||
|
{
|
||||||
|
glViewport(0, 0, Width, Height);
|
||||||
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
glLoadIdentity();
|
||||||
|
gluPerspective(45.0, Width / Height, 0.1, 100.0);//可视角45°最近观测距离0.1 最远100
|
||||||
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
}
|
||||||
|
|
||||||
|
void myReshape(int w, int h)
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
glViewport(0, 0, w, h);
|
||||||
|
|
||||||
|
//Use a perspective view
|
||||||
|
|
||||||
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
|
||||||
|
glLoadIdentity();
|
||||||
|
|
||||||
|
glFrustum(-5.0, 5.0, -5.0 * (GLfloat)h / (GLfloat)w, 5.0* (GLfloat)h / (GLfloat)w, 5.0, 500.0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
|
||||||
|
}
|
||||||
|
void sunLight()
|
||||||
|
{
|
||||||
|
//define the sun light is white
|
||||||
|
GLfloat sun_light_position[] = { 0.0f, 15.0f, 15.0f, 1.0f };
|
||||||
|
GLfloat sun_light_ambient[] = { 0.8f, 0.8f, 0.8f, 1.0f };
|
||||||
|
GLfloat sun_light_diffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||||
|
GLfloat sun_light_specular[] = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||||
|
|
||||||
|
glLightfv(GL_LIGHT0, GL_POSITION, sun_light_position);
|
||||||
|
glLightfv(GL_LIGHT0, GL_AMBIENT, sun_light_ambient);
|
||||||
|
glLightfv(GL_LIGHT0, GL_DIFFUSE, sun_light_diffuse);
|
||||||
|
glLightfv(GL_LIGHT0, GL_SPECULAR, sun_light_specular);
|
||||||
|
glLightf(GL_LIGHT0, GL_SPOT_EXPONENT, 0.0);
|
||||||
|
glLightf(GL_LIGHT0, GL_SPOT_CUTOFF, 360);
|
||||||
|
|
||||||
|
glEnable(GL_LIGHT0);
|
||||||
|
glEnable(GL_LIGHTING);
|
||||||
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
}
|
||||||
|
GLvoid InitGL(GLfloat Width, GLfloat Height)
|
||||||
|
{
|
||||||
|
|
||||||
|
glClearColor(1.0, 1.0, 1.0, 1.0);
|
||||||
|
glLineWidth(2.0); /* Add line width, ditto */
|
||||||
|
Transform(Width, Height); /* Perform the transformation */
|
||||||
|
t = gluNewQuadric();
|
||||||
|
gluQuadricDrawStyle(t, GLU_FILL);
|
||||||
|
|
||||||
|
glEnable(GL_LIGHTING);
|
||||||
|
|
||||||
|
glEnable(GL_LIGHT0);
|
||||||
|
|
||||||
|
GLfloat ambientLight[] = { 0.2f, 0.2f, 0.2f, 1.0f };
|
||||||
|
GLfloat diffuseLight[] = { 0.8f, 0.8f, 0.8, 1.0f };
|
||||||
|
GLfloat specularLight[] = { 0.5f, 0.5f, 0.5f, 1.0f };
|
||||||
|
GLfloat position[] = { 1.5f, 1.0f, 4.0f, 1.0f };
|
||||||
|
|
||||||
|
glLightfv(GL_LIGHT0, GL_AMBIENT, ambientLight);
|
||||||
|
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuseLight);
|
||||||
|
glLightfv(GL_LIGHT0, GL_SPECULAR, specularLight);
|
||||||
|
glLightfv(GL_LIGHT0, GL_POSITION, position);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void init()
|
||||||
|
{
|
||||||
|
glClearColor(0, 0, 0, 0);
|
||||||
|
glPointSize(5.0);
|
||||||
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
glLoadIdentity();
|
||||||
|
glOrtho(0.0, 900.0, 0.0, 600.0, 50.0, -50.0);
|
||||||
|
|
||||||
|
gluOrtho2D(-15.0, 15.0, -15.0, 15.0);
|
||||||
|
|
||||||
|
glutPostRedisplay();
|
||||||
|
}
|
||||||
|
void display_string(int x, int y, char *string, int font)
|
||||||
|
{
|
||||||
|
int len, i;
|
||||||
|
glColor3f(0.8, 0.52, 1.0);
|
||||||
|
glRasterPos2f(x, y);
|
||||||
|
len = (int)strlen(string);
|
||||||
|
for (i = 0; i < len; i++) {
|
||||||
|
if (font == 1)
|
||||||
|
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, string[i]);
|
||||||
|
if (font == 2)
|
||||||
|
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, string[i]);
|
||||||
|
if (font == 3)
|
||||||
|
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, string[i]);
|
||||||
|
if (font == 4)
|
||||||
|
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_10, string[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void display1(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
glClearColor(1.0, 1.0, 1.0, 1.0);
|
||||||
|
sunLight();
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
glutPostRedisplay();
|
||||||
|
glutSwapBuffers();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
GLvoid DrawGLScene()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
if (view == 0)
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
display1();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (count == 1)
|
||||||
|
InitGL(Xsize, Ysize);
|
||||||
|
if (aflag == 1)/* Initialize our window. */
|
||||||
|
glClearColor(1, 1, 1, 1);
|
||||||
|
else
|
||||||
|
glClearColor(0.1, 0.1, 0.1, 0);
|
||||||
|
glPushMatrix();
|
||||||
|
glLoadIdentity();
|
||||||
|
glTranslatef(-1.0, 0.0, -3.5);
|
||||||
|
glRotatef(xangle, 1.0, 0.0, 0.0);
|
||||||
|
glRotatef(yangle, 0.0, 1.0, 0.0);
|
||||||
|
glRotatef(zangle, 0.0, 0.0, 1.0);
|
||||||
|
glTranslatef(xt, yt, zt);
|
||||||
|
glScalef(xs, ys, zs);
|
||||||
|
glEnable(GL_COLOR_MATERIAL);
|
||||||
|
|
||||||
|
if (flag2 == 1)
|
||||||
|
{
|
||||||
|
GLfloat fogcolour[4] = { 1.0,1.0,1.0,1.0 };
|
||||||
|
|
||||||
|
glFogfv(GL_FOG_COLOR, fogcolour);
|
||||||
|
glFogf(GL_FOG_DENSITY, 0.1);
|
||||||
|
glFogi(GL_FOG_MODE, GL_EXP);
|
||||||
|
glFogf(GL_FOG_START, 3.0);
|
||||||
|
glFogf(GL_FOG_END, 100.0);
|
||||||
|
glHint(GL_FOG_HINT, GL_FASTEST);
|
||||||
|
glEnable(GL_FOG);
|
||||||
|
}
|
||||||
|
if (flag2 == 0)
|
||||||
|
{
|
||||||
|
glDisable(GL_FOG);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!aflag) {
|
||||||
|
glBegin(GL_POINTS);
|
||||||
|
glColor3f(1, 1, 1);
|
||||||
|
glPointSize(200.0);
|
||||||
|
int ccount = 0;
|
||||||
|
float x = 10, y = 10;
|
||||||
|
while (ccount<20)
|
||||||
|
{
|
||||||
|
glVertex2f(x, y);
|
||||||
|
x += 10;
|
||||||
|
y += 10;
|
||||||
|
if (y>Ysize) y -= 10;
|
||||||
|
if (x>Xsize) x -= 10;
|
||||||
|
ccount++;
|
||||||
|
}
|
||||||
|
glEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
glColor3f(1.0, .75, 0.0);
|
||||||
|
glPointSize(30.0);
|
||||||
|
glBegin(GL_POINTS);
|
||||||
|
glVertex3f(0.2, 0.3, 0.3);
|
||||||
|
glVertex3f(0.2, 0.3, 0.5);
|
||||||
|
glEnd();
|
||||||
|
glPointSize(200.0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
glBegin(GL_QUADS); /* OBJECT MODULE*/
|
||||||
|
|
||||||
|
/* top of cube*/
|
||||||
|
//************************FRONT BODY****************************************
|
||||||
|
glColor3f(r, g, b);
|
||||||
|
glVertex3f(0.2, 0.4, 0.6);
|
||||||
|
glVertex3f(0.6, 0.5, 0.6);
|
||||||
|
glVertex3f(0.6, 0.5, 0.2);
|
||||||
|
glVertex3f(0.2, 0.4, 0.2);
|
||||||
|
|
||||||
|
/* bottom of cube*/
|
||||||
|
glVertex3f(0.2, 0.4, 0.6);
|
||||||
|
glVertex3f(0.6, 0.2, 0.6);
|
||||||
|
glVertex3f(0.6, 0.2, 0.2);
|
||||||
|
glVertex3f(0.2, 0.2, 0.2);
|
||||||
|
|
||||||
|
/* front of cube*/
|
||||||
|
glVertex3f(0.2, 0.2, 0.6);
|
||||||
|
glVertex3f(0.2, 0.4, 0.6);
|
||||||
|
glVertex3f(0.2, 0.4, 0.2);
|
||||||
|
glVertex3f(0.2, 0.2, 0.2);
|
||||||
|
|
||||||
|
/* back of cube.*/
|
||||||
|
glVertex3f(0.6, 0.2, 0.6);
|
||||||
|
glVertex3f(0.6, 0.5, 0.6);
|
||||||
|
glVertex3f(0.6, 0.5, 0.2);
|
||||||
|
glVertex3f(0.6, 0.2, 0.2);
|
||||||
|
|
||||||
|
/* left of cube*/
|
||||||
|
glVertex3f(0.2, 0.2, 0.6);
|
||||||
|
glVertex3f(0.6, 0.2, 0.6);
|
||||||
|
glVertex3f(0.6, 0.5, 0.6);
|
||||||
|
glVertex3f(0.2, 0.4, 0.6);
|
||||||
|
|
||||||
|
/* Right of cube */
|
||||||
|
glVertex3f(0.2, 0.2, 0.2);
|
||||||
|
glVertex3f(0.6, 0.2, 0.2);
|
||||||
|
glVertex3f(0.6, 0.5, 0.2);
|
||||||
|
glVertex3f(0.2, 0.4, 0.2);
|
||||||
|
//****************************************************************************
|
||||||
|
glVertex3f(0.7, 0.65, 0.6);
|
||||||
|
glVertex3f(0.7, 0.65, 0.2);
|
||||||
|
glVertex3f(1.7, 0.65, 0.2); //top cover
|
||||||
|
glVertex3f(1.7, 0.65, 0.6);
|
||||||
|
//***************************back guard******************************
|
||||||
|
glColor3f(r, g, b); /* Set The Color To Blue*/
|
||||||
|
glVertex3f(1.8, 0.5, 0.6);
|
||||||
|
glVertex3f(1.8, 0.5, 0.2);
|
||||||
|
glVertex3f(2.1, 0.4, 0.2);
|
||||||
|
glVertex3f(2.1, 0.4, 0.6);
|
||||||
|
|
||||||
|
/* bottom of cube*/
|
||||||
|
glVertex3f(2.1, 0.2, 0.6);
|
||||||
|
glVertex3f(2.1, 0.2, 0.2);
|
||||||
|
glVertex3f(1.8, 0.2, 0.6);
|
||||||
|
glVertex3f(1.8, 0.2, 0.6);
|
||||||
|
|
||||||
|
/* back of cube.*/
|
||||||
|
glVertex3f(2.1, 0.4, 0.6);
|
||||||
|
glVertex3f(2.1, 0.4, 0.2);
|
||||||
|
glVertex3f(2.1, 0.2, 0.2);
|
||||||
|
glVertex3f(2.1, 0.2, 0.6);
|
||||||
|
|
||||||
|
/* left of cube*/
|
||||||
|
glVertex3f(1.8, 0.2, 0.2);
|
||||||
|
glVertex3f(1.8, 0.5, 0.2);
|
||||||
|
glVertex3f(2.1, 0.4, 0.2);
|
||||||
|
glVertex3f(2.1, 0.2, 0.2);
|
||||||
|
|
||||||
|
/* Right of cube */
|
||||||
|
glVertex3f(1.8, 0.2, 0.6);
|
||||||
|
glVertex3f(1.8, 0.5, 0.6);
|
||||||
|
glVertex3f(2.1, 0.4, 0.6);
|
||||||
|
glVertex3f(2.1, 0.2, 0.6);
|
||||||
|
//******************MIDDLE BODY************************************
|
||||||
|
glVertex3f(0.6, 0.5, 0.6);
|
||||||
|
glVertex3f(0.6, 0.2, 0.6);
|
||||||
|
glVertex3f(1.8, 0.2, 0.6);
|
||||||
|
glVertex3f(1.8, 0.5, 0.6);
|
||||||
|
|
||||||
|
/* bottom of cube*/
|
||||||
|
glVertex3f(0.6, 0.2, 0.6);
|
||||||
|
glVertex3f(0.6, 0.2, 0.2);
|
||||||
|
glVertex3f(1.8, 0.2, 0.2);
|
||||||
|
glVertex3f(1.8, 0.2, 0.6);
|
||||||
|
|
||||||
|
/* back of cube.*/
|
||||||
|
glVertex3f(0.6, 0.5, 0.2);
|
||||||
|
glVertex3f(0.6, 0.2, 0.2);
|
||||||
|
glVertex3f(1.8, 0.2, 0.2);
|
||||||
|
glVertex3f(1.8, 0.5, 0.2);
|
||||||
|
//*********************ENTER WINDOW**********************************
|
||||||
|
glColor3f(0.3, 0.3, 0.3);
|
||||||
|
glVertex3f(0.77, 0.63, 0.2);
|
||||||
|
glVertex3f(0.75, 0.5, 0.2); //quad front window
|
||||||
|
glVertex3f(1.2, 0.5, 0.2);
|
||||||
|
glVertex3f(1.22, 0.63, 0.2);
|
||||||
|
|
||||||
|
glVertex3f(1.27, 0.63, .2);
|
||||||
|
glVertex3f(1.25, 0.5, 0.2); //quad back window
|
||||||
|
glVertex3f(1.65, 0.5, 0.2);
|
||||||
|
glVertex3f(1.67, 0.63, 0.2);
|
||||||
|
|
||||||
|
glColor3f(r, g, b);
|
||||||
|
glVertex3f(0.7, 0.65, 0.2);
|
||||||
|
glVertex3f(0.7, 0.5, .2); //first separation
|
||||||
|
glVertex3f(0.75, 0.5, 0.2);
|
||||||
|
glVertex3f(0.77, 0.65, 0.2);
|
||||||
|
|
||||||
|
glVertex3f(1.2, 0.65, 0.2);
|
||||||
|
glVertex3f(1.2, 0.5, .2); //second separation
|
||||||
|
glVertex3f(1.25, 0.5, 0.2);
|
||||||
|
glVertex3f(1.27, 0.65, 0.2);
|
||||||
|
|
||||||
|
glVertex3f(1.65, 0.65, 0.2);
|
||||||
|
glVertex3f(1.65, 0.5, .2); //3d separation
|
||||||
|
glVertex3f(1.7, 0.5, 0.2);
|
||||||
|
glVertex3f(1.7, 0.65, 0.2);
|
||||||
|
|
||||||
|
glVertex3f(0.75, 0.65, 0.2);
|
||||||
|
glVertex3f(0.75, 0.63, 0.2); //line strip
|
||||||
|
glVertex3f(1.7, 0.63, 0.2);
|
||||||
|
glVertex3f(1.7, 0.65, 0.2);
|
||||||
|
|
||||||
|
glVertex3f(0.75, 0.65, 0.6);
|
||||||
|
glVertex3f(0.75, 0.63, 0.6); //line strip
|
||||||
|
glVertex3f(1.7, 0.63, 0.6);
|
||||||
|
glVertex3f(1.7, 0.65, 0.6);
|
||||||
|
|
||||||
|
glColor3f(0.3, 0.3, 0.3);
|
||||||
|
glVertex3f(0.77, 0.63, 0.6);
|
||||||
|
glVertex3f(0.75, 0.5, 0.6); //quad front window
|
||||||
|
glVertex3f(1.2, 0.5, 0.6);
|
||||||
|
glVertex3f(1.22, 0.63, 0.6);
|
||||||
|
|
||||||
|
glVertex3f(1.27, 0.63, .6);
|
||||||
|
glVertex3f(1.25, 0.5, 0.6); //quad back window
|
||||||
|
glVertex3f(1.65, 0.5, 0.6);
|
||||||
|
glVertex3f(1.67, 0.63, 0.6);
|
||||||
|
|
||||||
|
glColor3f(r, g, b);
|
||||||
|
glVertex3f(0.7, 0.65, 0.6);
|
||||||
|
glVertex3f(0.7, 0.5, .6); //first separation
|
||||||
|
glVertex3f(0.75, 0.5, 0.6);
|
||||||
|
glVertex3f(0.77, 0.65, 0.6);
|
||||||
|
|
||||||
|
glVertex3f(1.2, 0.65, 0.6);
|
||||||
|
glVertex3f(1.2, 0.5, .6); //second separation
|
||||||
|
glVertex3f(1.25, 0.5, 0.6);
|
||||||
|
glVertex3f(1.27, 0.65, 0.6);
|
||||||
|
|
||||||
|
glVertex3f(1.65, 0.65, 0.6);
|
||||||
|
glVertex3f(1.65, 0.5, .6);
|
||||||
|
glVertex3f(1.7, 0.5, 0.6);
|
||||||
|
glVertex3f(1.7, 0.65, 0.6);
|
||||||
|
glEnd();
|
||||||
|
|
||||||
|
|
||||||
|
//**************************************************************
|
||||||
|
glBegin(GL_QUADS);
|
||||||
|
|
||||||
|
/* top of cube*/
|
||||||
|
glColor3f(0.3, 0.3, 0.3);
|
||||||
|
glVertex3f(0.6, 0.5, 0.6);
|
||||||
|
glVertex3f(0.6, 0.5, 0.2); //quad front window
|
||||||
|
glVertex3f(0.7, 0.65, 0.2);
|
||||||
|
glVertex3f(0.7, 0.65, 0.6);
|
||||||
|
|
||||||
|
glVertex3f(1.7, 0.65, .6);
|
||||||
|
glVertex3f(1.7, 0.65, 0.2); //quad back window
|
||||||
|
glVertex3f(1.8, 0.5, 0.2);
|
||||||
|
glVertex3f(1.8, 0.5, 0.6);
|
||||||
|
|
||||||
|
|
||||||
|
//*****************************road and surrounding development***********************************
|
||||||
|
if (flag1)
|
||||||
|
{
|
||||||
|
glPushMatrix();
|
||||||
|
glTranslatef(xw, 0, 0);
|
||||||
|
glColor3f(0, 1, 0);
|
||||||
|
glVertex3f(-100, 0.1, -100);
|
||||||
|
glVertex3f(-100, 0.1, 0); //a green surroundings
|
||||||
|
glVertex3f(100, 0.1, 0);
|
||||||
|
glVertex3f(100, 0.1, -100);
|
||||||
|
|
||||||
|
glColor3f(0.7, 0.7, 0.7);
|
||||||
|
glVertex3f(-100, 0.1, 0);
|
||||||
|
glVertex3f(-100, 0.1, 0.45); //a long road
|
||||||
|
glVertex3f(100, 0.1, 0.45);
|
||||||
|
glVertex3f(100, 0.1, 0);
|
||||||
|
|
||||||
|
glColor3f(1.0, 0.75, 0.0);
|
||||||
|
glVertex3f(-100, 0.1, 0.45); //a median
|
||||||
|
glVertex3f(-100, 0.1, 0.55);
|
||||||
|
glVertex3f(100, 0.1, 0.55);
|
||||||
|
glVertex3f(100, 0.1, 0.45);
|
||||||
|
|
||||||
|
glColor3f(0.7, 0.7, 0.7);
|
||||||
|
glVertex3f(-100, 0.1, 0.55);
|
||||||
|
glVertex3f(-100, 0.1, 1); //a long road
|
||||||
|
glVertex3f(100, 0.1, 1);
|
||||||
|
glVertex3f(100, 0.1, 0.55);
|
||||||
|
|
||||||
|
glColor3f(0, 1, 0);
|
||||||
|
glVertex3f(-100, 0.1, 1);
|
||||||
|
glVertex3f(-100, 0.1, 100); //a green surroundings
|
||||||
|
glVertex3f(100, 0.1, 100);
|
||||||
|
glVertex3f(100, 0.1, 1);
|
||||||
|
glPopMatrix();
|
||||||
|
}
|
||||||
|
glEnd();
|
||||||
|
|
||||||
|
if (wheelflag)
|
||||||
|
{
|
||||||
|
glPushMatrix();
|
||||||
|
glTranslatef(xw, 0, 0);
|
||||||
|
glColor3f(0.5, .2, 0.3);
|
||||||
|
glBegin(GL_QUADS);
|
||||||
|
for (i = 0; i<200; i += 0.2)
|
||||||
|
{
|
||||||
|
glVertex3f(-100 + i, 0, 1);
|
||||||
|
glVertex3f(-99.9 + i, 0, 1);
|
||||||
|
glVertex3f(-99.9 + i, 0.2, 1);
|
||||||
|
glVertex3f(-100 + i, 0.2, 1);
|
||||||
|
i += 0.5;
|
||||||
|
}
|
||||||
|
for (i = 0; i<200; i += 0.2)
|
||||||
|
{
|
||||||
|
glVertex3f(-100 + i, 0, 0);
|
||||||
|
glVertex3f(-99.9 + i, 0, 0);
|
||||||
|
glVertex3f(-99.9 + i, 0.2, 0);
|
||||||
|
glVertex3f(-100 + i, 0.2, 0);
|
||||||
|
i += 0.5;
|
||||||
|
}
|
||||||
|
glEnd();
|
||||||
|
glPopMatrix();
|
||||||
|
}
|
||||||
|
//
|
||||||
|
glBegin(GL_TRIANGLES); /* start drawing the cube.*/
|
||||||
|
|
||||||
|
/* top of cube*/
|
||||||
|
glColor3f(0.3, 0.3, 0.3);
|
||||||
|
glVertex3f(0.6, 0.5, 0.6);
|
||||||
|
glVertex3f(0.7, 0.65, 0.6); //tri front window
|
||||||
|
glVertex3f(0.7, 0.5, 0.6);
|
||||||
|
|
||||||
|
glVertex3f(0.6, 0.5, 0.2);
|
||||||
|
glVertex3f(0.7, 0.65, 0.2); //tri front window
|
||||||
|
glVertex3f(0.7, 0.5, 0.2);
|
||||||
|
|
||||||
|
glVertex3f(1.7, 0.65, 0.2);
|
||||||
|
glVertex3f(1.8, 0.5, 0.2); //tri back window
|
||||||
|
glVertex3f(1.7, 0.5, 0.2);
|
||||||
|
|
||||||
|
glVertex3f(1.7, 0.65, 0.6);
|
||||||
|
glVertex3f(1.8, 0.5, 0.6); //tri back window
|
||||||
|
glVertex3f(1.7, 0.5, 0.6);
|
||||||
|
|
||||||
|
glEnd();
|
||||||
|
//************IGNITION SYSTEM
|
||||||
|
glPushMatrix();
|
||||||
|
glColor3f(0.3, 0.3, 0.7);
|
||||||
|
glTranslatef(1.65, 0.2, 0.3);
|
||||||
|
glRotatef(90.0, 0, 1, 0);
|
||||||
|
gluCylinder(t, 0.02, 0.03, .5, 10, 10);
|
||||||
|
glPopMatrix();
|
||||||
|
//********************WHEEL
|
||||||
|
|
||||||
|
glColor3f(0.7, 0.7, 0.7);
|
||||||
|
glPushMatrix();
|
||||||
|
glBegin(GL_LINE_STRIP);
|
||||||
|
for (theta = 0; theta<360; theta = theta + 40)
|
||||||
|
{
|
||||||
|
glVertex3f(0.6, 0.2, 0.62);
|
||||||
|
glVertex3f(0.6 + (0.08*(cos(((theta + angle)*3.14) / 180))), 0.2 + (0.08*(sin(((theta + angle)*3.14) / 180))), 0.62);
|
||||||
|
}
|
||||||
|
glEnd();
|
||||||
|
|
||||||
|
glBegin(GL_LINE_STRIP);
|
||||||
|
for (theta = 0; theta<360; theta = theta + 40)
|
||||||
|
{
|
||||||
|
glVertex3f(0.6, 0.2, 0.18);
|
||||||
|
glVertex3f(0.6 + (0.08*(cos(((theta + angle)*3.14) / 180))), 0.2 + (0.08*(sin(((theta + angle)*3.14) / 180))), 0.18);
|
||||||
|
}
|
||||||
|
glEnd();
|
||||||
|
|
||||||
|
glBegin(GL_LINE_STRIP);
|
||||||
|
for (theta = 0; theta<360; theta = theta + 40)
|
||||||
|
{
|
||||||
|
glVertex3f(1.7, 0.2, 0.18);
|
||||||
|
glVertex3f(1.7 + (0.08*(cos(((theta + angle)*3.14) / 180))), 0.2 + (0.08*(sin(((theta + angle)*3.14) / 180))), 0.18);
|
||||||
|
}
|
||||||
|
glEnd();
|
||||||
|
|
||||||
|
glBegin(GL_LINE_STRIP);
|
||||||
|
for (theta = 0; theta<360; theta = theta + 40)
|
||||||
|
{
|
||||||
|
glVertex3f(1.7, 0.2, 0.62);
|
||||||
|
glVertex3f(1.7 + (0.08*(cos(((theta + angle)*3.14) / 180))), 0.2 + (0.08*(sin(((theta + angle)*3.14) / 180))), 0.62);
|
||||||
|
}
|
||||||
|
glEnd();
|
||||||
|
glTranslatef(0.6, 0.2, 0.6);
|
||||||
|
glColor3f(0, 0, 0);
|
||||||
|
glutSolidTorus(0.025, 0.07, 10, 25);
|
||||||
|
|
||||||
|
glTranslatef(0, 0, -0.4);
|
||||||
|
glutSolidTorus(0.025, 0.07, 10, 25);
|
||||||
|
|
||||||
|
glTranslatef(1.1, 0, 0);
|
||||||
|
glutSolidTorus(0.025, 0.07, 10, 25);
|
||||||
|
|
||||||
|
glTranslatef(0, 0, 0.4);
|
||||||
|
glutSolidTorus(0.025, 0.07, 10, 25);
|
||||||
|
glPopMatrix();
|
||||||
|
//*************************************************************
|
||||||
|
glPopMatrix();
|
||||||
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
glutPostRedisplay();
|
||||||
|
glutSwapBuffers();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void NormalKey(GLubyte key, GLint x, GLint y)//按键的响应
|
||||||
|
{
|
||||||
|
switch (key) {
|
||||||
|
case ESCAPE: printf("escape pressed. exit.\n");
|
||||||
|
glutDestroyWindow(window);
|
||||||
|
exit(0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ' ':view = 1;
|
||||||
|
DrawGLScene();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'x': xangle += 1.0;
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'X':xangle -= 1.0;
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'y':
|
||||||
|
yangle += 1.0;
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Y':
|
||||||
|
yangle -= 1.0;
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'z':
|
||||||
|
zangle += 1.0;
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Z':
|
||||||
|
zangle -= 1.0;
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'u': /* Move up */
|
||||||
|
yt += 0.1;
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'U':
|
||||||
|
yt -= 0.1; /* Move down */
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'f': /* Move forward */
|
||||||
|
zt += 0.1;
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'F':
|
||||||
|
zt -= 0.1; /* Move away */
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
case 'w':
|
||||||
|
xt += 0.015;
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
case 'W':
|
||||||
|
xt += 0.03;
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
case 's':
|
||||||
|
xt -= 0.015;
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
case 'S':
|
||||||
|
xt -= 0.03;
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
case 't':
|
||||||
|
xangle += 90;
|
||||||
|
yangle += 90;
|
||||||
|
zangle += 90;
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SpecialKeyFunc(int Key, int x, int y)
|
||||||
|
{
|
||||||
|
switch (Key) {
|
||||||
|
case GLUT_KEY_RIGHT:
|
||||||
|
if (!wheelflag)
|
||||||
|
xt += 0.2;
|
||||||
|
if (wheelflag)
|
||||||
|
{
|
||||||
|
angle += 5;
|
||||||
|
xw += 0.2;
|
||||||
|
}
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GLUT_KEY_LEFT:
|
||||||
|
if (!wheelflag)
|
||||||
|
xt -= 0.2;
|
||||||
|
if (wheelflag)
|
||||||
|
{
|
||||||
|
angle += 5;
|
||||||
|
xw -= 0.2;
|
||||||
|
}
|
||||||
|
glutPostRedisplay();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void myMenu(int id) //右键菜单
|
||||||
|
{
|
||||||
|
if (id == 1)
|
||||||
|
{
|
||||||
|
flag1 = 0;
|
||||||
|
wheelflag = 0;
|
||||||
|
glutPostRedisplay();
|
||||||
|
|
||||||
|
}
|
||||||
|
if (id == 2)
|
||||||
|
{
|
||||||
|
flag1 = 1;
|
||||||
|
flag2 = 0;
|
||||||
|
wheelflag = 0;
|
||||||
|
xangle += 5.0;
|
||||||
|
glutPostRedisplay();
|
||||||
|
}
|
||||||
|
if (id == 4)
|
||||||
|
{
|
||||||
|
wheelflag = 1;
|
||||||
|
glutPostRedisplay();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (id == 12)
|
||||||
|
{
|
||||||
|
aflag = 1;
|
||||||
|
day = 1;
|
||||||
|
glClearColor(1, 1, 1, 1);
|
||||||
|
glDisable(GL_FOG);
|
||||||
|
glutPostRedisplay();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (id == 13)
|
||||||
|
{
|
||||||
|
aflag = 0;
|
||||||
|
day = 0;
|
||||||
|
flag2 = 2;
|
||||||
|
glClearColor(0.1, 0.1, 0.1, 0);
|
||||||
|
GLfloat fogcolour[4] = { 0.0,0.0,0.0,1.0 };
|
||||||
|
|
||||||
|
glFogfv(GL_FOG_COLOR, fogcolour);
|
||||||
|
glFogf(GL_FOG_DENSITY, 0.5);
|
||||||
|
glFogi(GL_FOG_MODE, GL_EXP);
|
||||||
|
glHint(GL_FOG_HINT, GL_FASTEST);
|
||||||
|
glEnable(GL_FOG);
|
||||||
|
|
||||||
|
glutPostRedisplay();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void colorMenu(int id) //设置车身颜色
|
||||||
|
{
|
||||||
|
if (id == 6)
|
||||||
|
{
|
||||||
|
r = g = 0;
|
||||||
|
b = 1;
|
||||||
|
glutPostRedisplay();
|
||||||
|
|
||||||
|
}
|
||||||
|
if (id == 7)
|
||||||
|
{
|
||||||
|
r = 0.8;
|
||||||
|
b = g = 0;
|
||||||
|
glutPostRedisplay();
|
||||||
|
}
|
||||||
|
if (id == 8)
|
||||||
|
{
|
||||||
|
g = 1;
|
||||||
|
r = b = 0;
|
||||||
|
glutPostRedisplay();
|
||||||
|
}
|
||||||
|
if (id == 9)
|
||||||
|
{
|
||||||
|
r = b = g = 0;
|
||||||
|
glutPostRedisplay();
|
||||||
|
}
|
||||||
|
if (id == 10)
|
||||||
|
{
|
||||||
|
b = 0;
|
||||||
|
r = g = 1;
|
||||||
|
glutPostRedisplay();
|
||||||
|
}
|
||||||
|
if (id == 11)
|
||||||
|
{
|
||||||
|
b = r = g = .7;
|
||||||
|
glutPostRedisplay();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//void textureMap() {
|
||||||
|
// glGenTextures(4, toTextures); // 分配5个纹理对象的编号
|
||||||
|
// GLubyte* pImage = NULL;
|
||||||
|
// GLubyte* pOutImage = NULL;
|
||||||
|
// int w, h;
|
||||||
|
// int scaleDim = 512;
|
||||||
|
//
|
||||||
|
// pImage = (GLubyte *)Read_PPM_Image("road.ppm", &w, &h);
|
||||||
|
// glBindTexture(GL_TEXTURE_2D, toTextures[0]);
|
||||||
|
// pOutImage = (unsigned char*)malloc(sizeof(unsigned char)*scaleDim*scaleDim * 3);
|
||||||
|
// //set some useful text
|
||||||
|
// gluScaleImage(GL_RGB, w, h, GL_UNSIGNED_BYTE, pImage, scaleDim, scaleDim, GL_UNSIGNED_BYTE, pOutImage);
|
||||||
|
// glTexImage2D(GL_TEXTURE_2D, 0, 3, scaleDim, scaleDim, 0, GL_RGB, GL_UNSIGNED_BYTE, pOutImage);
|
||||||
|
// free(pImage);
|
||||||
|
// free(pOutImage);
|
||||||
|
// pImage = pOutImage = NULL;
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
//
|
||||||
|
// pImage = (GLubyte *)Read_PPM_Image("top.ppm", &w, &h);
|
||||||
|
// glBindTexture(GL_TEXTURE_2D, toTextures[1]);
|
||||||
|
// pOutImage = (unsigned char*)malloc(sizeof(unsigned char)*scaleDim*scaleDim * 3);
|
||||||
|
// //set some useful text
|
||||||
|
// gluScaleImage(GL_RGB, w, h, GL_UNSIGNED_BYTE, pImage, scaleDim, scaleDim, GL_UNSIGNED_BYTE, pOutImage);
|
||||||
|
// glTexImage2D(GL_TEXTURE_2D, 0, 3, scaleDim, scaleDim, 0, GL_RGB, GL_UNSIGNED_BYTE, pOutImage);
|
||||||
|
// free(pImage);
|
||||||
|
// free(pOutImage);
|
||||||
|
// pImage = pOutImage = NULL;
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
//
|
||||||
|
// pImage = (GLubyte *)Read_PPM_Image("face.ppm", &w, &h);
|
||||||
|
// glBindTexture(GL_TEXTURE_2D, toTextures[2]);
|
||||||
|
// pOutImage = (unsigned char*)malloc(sizeof(unsigned char)*scaleDim*scaleDim * 3);
|
||||||
|
// //set some useful text
|
||||||
|
// gluScaleImage(GL_RGB, w, h, GL_UNSIGNED_BYTE, pImage, scaleDim, scaleDim, GL_UNSIGNED_BYTE, pOutImage);
|
||||||
|
// glTexImage2D(GL_TEXTURE_2D, 0, 3, scaleDim, scaleDim, 0, GL_RGB, GL_UNSIGNED_BYTE, pOutImage);
|
||||||
|
// free(pImage);
|
||||||
|
// free(pOutImage);
|
||||||
|
// pImage = pOutImage = NULL;
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
//
|
||||||
|
// pImage = (GLubyte *)Read_PPM_Image("other.ppm", &w, &h);
|
||||||
|
// glBindTexture(GL_TEXTURE_2D, toTextures[3]);
|
||||||
|
// pOutImage = (unsigned char*)malloc(sizeof(unsigned char)*scaleDim*scaleDim * 3);
|
||||||
|
// //set some useful text
|
||||||
|
// gluScaleImage(GL_RGB, w, h, GL_UNSIGNED_BYTE, pImage, scaleDim, scaleDim, GL_UNSIGNED_BYTE, pOutImage);
|
||||||
|
// glTexImage2D(GL_TEXTURE_2D, 0, 3, scaleDim, scaleDim, 0, GL_RGB, GL_UNSIGNED_BYTE, pOutImage);
|
||||||
|
// free(pImage);
|
||||||
|
// free(pOutImage);
|
||||||
|
// pImage = pOutImage = NULL;
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
//}
|
||||||
|
//void build() {
|
||||||
|
// sceneMaterial();
|
||||||
|
// glBindTexture(GL_TEXTURE_2D, toTextures[1]);
|
||||||
|
// glEnable(GL_TEXTURE_2D);
|
||||||
|
// glBegin(GL_QUADS);
|
||||||
|
// glTexCoord2f(0, 1.0);
|
||||||
|
// glVertex3f(60.0, 60.0, 50.0);
|
||||||
|
// glTexCoord2f(0.0, 0.0);
|
||||||
|
// glVertex3f(10.0, 60.0, 50.0);
|
||||||
|
// glTexCoord2f(1.0, 0.0);
|
||||||
|
// glVertex3f(10.0, 10.0, 50.0);
|
||||||
|
// glTexCoord2f(1, 1.0);
|
||||||
|
// glVertex3f(60.0, 10.0, 50.0);
|
||||||
|
// glEnd();
|
||||||
|
//
|
||||||
|
// glBindTexture(GL_TEXTURE_2D, toTextures[2]);
|
||||||
|
// glEnable(GL_TEXTURE_2D);
|
||||||
|
// glBegin(GL_QUADS);
|
||||||
|
// glTexCoord2f(0, 1.0);
|
||||||
|
// glVertex3f(60.0, 10.0, 0.0);
|
||||||
|
// glTexCoord2f(0.0, 0.0);
|
||||||
|
// glVertex3f(60.0, 10.0, 50.0);
|
||||||
|
// glTexCoord2f(1.0, 0.0);
|
||||||
|
// glVertex3f(10.0, 10.0, 50.0);
|
||||||
|
// glTexCoord2f(1, 1.0);
|
||||||
|
// glVertex3f(10.0, 10.0, 0.0);
|
||||||
|
// glEnd();
|
||||||
|
//
|
||||||
|
// glBindTexture(GL_TEXTURE_2D, toTextures[3]);
|
||||||
|
// glEnable(GL_TEXTURE_2D);
|
||||||
|
// glBegin(GL_QUADS);
|
||||||
|
// glTexCoord2f(0, 1.0);
|
||||||
|
// glVertex3f(60.0, 10.0, 0.0);
|
||||||
|
// glTexCoord2f(0.0, 0.0);
|
||||||
|
// glVertex3f(60.0, 60.0, 0.0);
|
||||||
|
// glTexCoord2f(1.0, 0.0);
|
||||||
|
// glVertex3f(60.0, 60.0, 50.0);
|
||||||
|
// glTexCoord2f(1, 1.0);
|
||||||
|
// glVertex3f(60.0, 10.0, 50.0);
|
||||||
|
// glEnd();
|
||||||
|
// glBegin(GL_QUADS);
|
||||||
|
// glTexCoord2f(0, 1.0);
|
||||||
|
// glVertex3f(60.0, 60.0, 0.0);
|
||||||
|
// glTexCoord2f(0.0, 0.0);
|
||||||
|
// glVertex3f(10.0, 60.0, 0.0);
|
||||||
|
// glTexCoord2f(1.0, 0.0);
|
||||||
|
// glVertex3f(10.0, 60.0, 50.0);
|
||||||
|
// glTexCoord2f(1, 1.0);
|
||||||
|
// glVertex3f(60.0, 60.0, 50.0);
|
||||||
|
// glEnd();
|
||||||
|
// glBegin(GL_QUADS);
|
||||||
|
// glTexCoord2f(0, 1.0);
|
||||||
|
// glVertex3f(10.0, 60.0, 0.0);
|
||||||
|
// glTexCoord2f(0.0, 0.0);
|
||||||
|
// glVertex3f(10.0, 10.0, 0.0);
|
||||||
|
// glTexCoord2f(1.0, 0.0);
|
||||||
|
// glVertex3f(10.0, 10.0, 50.0);
|
||||||
|
// glTexCoord2f(1, 1.0);
|
||||||
|
// glVertex3f(10.0, 60.0, 50.0);
|
||||||
|
// glEnd();
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//void map() {
|
||||||
|
// sceneMaterial();
|
||||||
|
// glEnable(GL_TEXTURE_2D);
|
||||||
|
// glBindTexture(GL_TEXTURE_2D, toTextures[0]);
|
||||||
|
//
|
||||||
|
// glBegin(GL_QUADS);
|
||||||
|
// glTexCoord2f(0, 1.0);
|
||||||
|
// glVertex3f(250.0, 250.0, 0.0);
|
||||||
|
// glTexCoord2f(0.0, 0.0);
|
||||||
|
// glVertex3f(-250.0, 250.0, 0.0);
|
||||||
|
// glTexCoord2f(1.0, 0.0);
|
||||||
|
// glVertex3f(-250.0, -250.0, 0.0);
|
||||||
|
// glTexCoord2f(1, 1.0);
|
||||||
|
// glVertex3f(250.0, -250.0, 0.0);
|
||||||
|
// glEnd();
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char **argv) //main
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
glutInit(&argc, argv);
|
||||||
|
|
||||||
|
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
|
||||||
|
glutInitWindowSize(Xsize, Ysize); //位置、大小
|
||||||
|
glutInitWindowPosition(50, 50);
|
||||||
|
glutCreateWindow("3D CAR ANIMATION"); //Create glut Window
|
||||||
|
glutReshapeFunc(myReshape);
|
||||||
|
glutDisplayFunc(DrawGLScene);//渲染模型
|
||||||
|
glutKeyboardFunc(NormalKey);
|
||||||
|
glutSpecialFunc(SpecialKeyFunc);
|
||||||
|
InitGL(Xsize, Ysize);
|
||||||
|
int submenu = glutCreateMenu(colorMenu);
|
||||||
|
glutAddMenuEntry("blue", 6);
|
||||||
|
glutAddMenuEntry("red", 7);
|
||||||
|
glutAddMenuEntry("green", 8);
|
||||||
|
glutAddMenuEntry("black", 9);
|
||||||
|
glutAddMenuEntry("yellow", 10);
|
||||||
|
glutAddMenuEntry("grey", 11);
|
||||||
|
glutCreateMenu(myMenu);
|
||||||
|
glutAddMenuEntry("car model mode", 1);
|
||||||
|
glutAddMenuEntry("car driving mode", 2);
|
||||||
|
glutAddMenuEntry("wheel effect", 4);
|
||||||
|
glutAddSubMenu("car colors", submenu);
|
||||||
|
glutAddMenuEntry("daymode", 12);
|
||||||
|
glutAddMenuEntry("Night mode", 13);
|
||||||
|
glutAttachMenu(GLUT_RIGHT_BUTTON);
|
||||||
|
|
||||||
|
|
||||||
|
glutMainLoop();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in new issue