Skip to content

Commit f77b6b5

Browse files
committed
Cleaned Build
1 parent 9345783 commit f77b6b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3944
-59
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/GLUT
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Headers
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Resources
Binary file not shown.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
/*
3+
*
4+
* Written By Linas Vepstas November 1991
5+
*/
6+
7+
8+
#define COPY_THREE_WORDS(A,B) { \
9+
struct three_words { int a, b, c, }; \
10+
*(struct three_words *) (A) = *(struct three_words *) (B); \
11+
}
12+
13+
#define COPY_FOUR_WORDS(A,B) { \
14+
struct four_words { int a, b, c, d, }; \
15+
*(struct four_words *) (A) = *(struct four_words *) (B); \
16+
}
17+
18+
/* ============================================================= */
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
2+
/*
3+
* extrude.h
4+
*
5+
* FUNCTION:
6+
* prototypes for privately used subroutines for the tubing library
7+
*
8+
* HISTORY:
9+
* Linas Vepstas 1991
10+
*/
11+
12+
#include "port.h" /* for gleDouble */
13+
14+
#ifndef M_PI
15+
#define M_PI 3.14159265358979323846
16+
#endif
17+
18+
/* ============================================================ */
19+
/*
20+
* Provides choice of calling subroutine, vs. invoking macro.
21+
* Basically, inlines the source, or not.
22+
* Trades performance for executable size.
23+
*/
24+
25+
#define INLINE_INTERSECT
26+
#ifdef INLINE_INTERSECT
27+
#define INNERSECT(sect,p,n,v1,v2) { INTERSECT(sect,p,n,v1,v2); }
28+
#else
29+
#define INNERSECT(sect,p,n,v1,v2) intersect(sect,p,n,v1,v2)
30+
#endif /* INLINE_INTERSECT */
31+
32+
/* ============================================================ */
33+
/* The folowing defines give a kludgy way of accessing the qmesh primitive */
34+
35+
/*
36+
#define bgntmesh _emu_qmesh_bgnqmesh
37+
#define endtmesh _emu_qmesh_endqmesh
38+
#define c3f _emu_qmesh_c3f
39+
#define n3f _emu_qmesh_n3f
40+
#define v3f _emu_qmesh_v3f
41+
*/
42+
43+
/* ============================================================ */
44+
45+
extern void up_sanity_check (gleDouble up[3], /* up vector for contour */
46+
int npoints, /* numpoints in poly-line */
47+
gleDouble point_array[][3]); /* polyline */
48+
49+
50+
extern void draw_raw_style_end_cap (int ncp, /* number of contour points */
51+
gleDouble contour[][2], /* 2D contour */
52+
gleDouble zval, /* where to draw cap */
53+
int frontwards); /* front or back cap */
54+
55+
extern void draw_round_style_cap_callback (int iloop,
56+
double cap[][3],
57+
float face_color[3],
58+
gleDouble cut_vector[3],
59+
gleDouble bisect_vector[3],
60+
double norms[][3],
61+
int frontwards);
62+
63+
extern void draw_angle_style_front_cap (int ncp,
64+
gleDouble bi[3],
65+
gleDouble point_array[][3]);
66+
67+
extern void extrusion_raw_join (int ncp, /* number of contour points */
68+
gleDouble contour[][2], /* 2D contour */
69+
gleDouble cont_normal[][2],/* 2D contour normal vecs */
70+
gleDouble up[3], /* up vector for contour */
71+
int npoints, /* numpoints in poly-line */
72+
gleDouble point_array[][3], /* polyline */
73+
float color_array[][3], /* color of polyline */
74+
gleDouble xform_array[][2][3]); /* 2D contour xforms */
75+
76+
77+
extern void extrusion_round_or_cut_join (int ncp, /* number of contour points */
78+
gleDouble contour[][2], /* 2D contour */
79+
gleDouble cont_normal[][2],/* 2D contour normal vecs */
80+
gleDouble up[3], /* up vector for contour */
81+
int npoints, /* numpoints in poly-line */
82+
gleDouble point_array[][3], /* polyline */
83+
float color_array[][3], /* color of polyline */
84+
gleDouble xform_array[][2][3]); /* 2D contour xforms */
85+
86+
87+
extern void extrusion_angle_join (int ncp, /* number of contour points */
88+
gleDouble contour[][2], /* 2D contour */
89+
gleDouble cont_normal[][2],/* 2D contour normal vecs */
90+
gleDouble up[3], /* up vector for contour */
91+
int npoints, /* numpoints in poly-line */
92+
gleDouble point_array[][3], /* polyline */
93+
float color_array[][3], /* color of polyline */
94+
gleDouble xform_array[][2][3]); /* 2D contour xforms */
95+
96+
/* -------------------------- end of file -------------------------------- */
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
#ifndef __glsmap_h__
2+
#define __glsmap_h__
3+
4+
/* Copyright (c) Mark J. Kilgard, 1998. */
5+
6+
/* This program is freely distributable without licensing fees
7+
and is provided without guarantee or warrantee expressed or
8+
implied. This program is -not- in the public domain. */
9+
10+
#if defined(_WIN32)
11+
12+
/* Try hard to avoid including <windows.h> to avoid name space pollution,
13+
but Win32's <GL/gl.h> needs APIENTRY and WINGDIAPI defined properly. */
14+
# if 0
15+
# define WIN32_LEAN_AND_MEAN
16+
# include <windows.h>
17+
# else
18+
/* XXX This is from Win32's <windef.h> */
19+
# ifndef APIENTRY
20+
# if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
21+
# define APIENTRY __stdcall
22+
# else
23+
# define APIENTRY
24+
# endif
25+
# endif
26+
# ifndef CALLBACK
27+
/* XXX This is from Win32's <winnt.h> */
28+
# if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
29+
# define CALLBACK __stdcall
30+
# else
31+
# define CALLBACK
32+
# endif
33+
# endif
34+
/* XXX This is from Win32's <wingdi.h> and <winnt.h> */
35+
# ifndef WINGDIAPI
36+
# define WINGDIAPI __declspec(dllimport)
37+
# endif
38+
/* XXX This is from Win32's <ctype.h> */
39+
# ifndef _WCHAR_T_DEFINED
40+
typedef unsigned short wchar_t;
41+
# define _WCHAR_T_DEFINED
42+
# endif
43+
# endif
44+
45+
#pragma warning (disable:4244) /* Disable bogus conversion warnings. */
46+
#pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */
47+
48+
#endif /* _WIN32 */
49+
50+
#include <OpenGL/gl.h>
51+
52+
#ifdef __cplusplus
53+
extern "C" {
54+
#endif
55+
56+
typedef enum {
57+
SMAP_CLEAR_SMAP_TEXTURE = 0x1,
58+
SMAP_GENERATE_VIEW_MIPMAPS = 0x2,
59+
SMAP_GENERATE_SMAP_MIPMAPS = 0x4,
60+
SMAP_GENERATE_MIPMAPS = 0x6 /* both of above */
61+
} SphereMapFlags;
62+
63+
/* Cube view enumerants. */
64+
enum {
65+
SMAP_FRONT = 0,
66+
SMAP_TOP = 1,
67+
SMAP_BOTTOM = 2,
68+
SMAP_LEFT = 3,
69+
SMAP_RIGHT = 4,
70+
SMAP_BACK = 5
71+
};
72+
73+
typedef struct _SphereMap SphereMap;
74+
75+
extern SphereMap *smapCreateSphereMap(SphereMap *shareSmap);
76+
extern void smapDestroySphereMap(SphereMap *smap);
77+
78+
extern void smapConfigureSphereMapMesh(SphereMap *smap, int steps, int rings, int edgeExtend);
79+
80+
extern void smapSetSphereMapTexObj(SphereMap *smap, GLuint texobj);
81+
extern void smapSetViewTexObj(SphereMap *smap, GLuint texobj);
82+
extern void smapSetViewTexObjs(SphereMap *smap, GLuint texobjs[6]);
83+
extern void smapGetSphereMapTexObj(SphereMap *smap, GLuint *texobj);
84+
extern void smapGetViewTexObj(SphereMap *smap, GLuint *texobj);
85+
extern void smapGetViewTexObjs(SphereMap *smap, GLuint texobjs[6]);
86+
87+
extern void smapSetFlags(SphereMap *smap, SphereMapFlags flags);
88+
extern void smapGetFlags(SphereMap *smap, SphereMapFlags *flags);
89+
90+
extern void smapSetViewOrigin(SphereMap *smap, GLint x, GLint y);
91+
extern void smapSetSphereMapOrigin(SphereMap *smap, GLint x, GLint y);
92+
extern void smapGetViewOrigin(SphereMap *smap, GLint *x, GLint *y);
93+
extern void smapGetSphereMapOrigin(SphereMap *smap, GLint *x, GLint *y);
94+
95+
extern void smapSetEye(SphereMap *smap, GLfloat eyex, GLfloat eyey, GLfloat eyez);
96+
extern void smapSetEyeVector(SphereMap *smap, GLfloat *eye);
97+
extern void smapSetUp(SphereMap *smap, GLfloat upx, GLfloat upy, GLfloat upz);
98+
extern void smapSetUpVector(SphereMap *smap, GLfloat *up);
99+
extern void smapSetObject(SphereMap *smap, GLfloat objx, GLfloat objy, GLfloat objz);
100+
extern void smapSetObjectVector(SphereMap *smap, GLfloat *obj);
101+
extern void smapGetEye(SphereMap *smap, GLfloat *eyex, GLfloat *eyey, GLfloat *eyez);
102+
extern void smapGetEyeVector(SphereMap *smap, GLfloat *eye);
103+
extern void smapGetUp(SphereMap *smap, GLfloat *upx, GLfloat *upy, GLfloat *upz);
104+
extern void smapGetUpVector(SphereMap *smap, GLfloat *up);
105+
extern void smapGetObject(SphereMap *smap, GLfloat *objx, GLfloat *objy, GLfloat *objz);
106+
extern void smapGetObjectVector(SphereMap *smap, GLfloat *obj);
107+
108+
extern void smapSetNearFar(SphereMap *smap, GLfloat viewNear, GLfloat viewFar);
109+
extern void smapGetNearFar(SphereMap *smap, GLfloat *viewNear, GLfloat *viewFar);
110+
111+
extern void smapSetSphereMapTexDim(SphereMap *smap, GLsizei texdim);
112+
extern void smapSetViewTexDim(SphereMap *smap, GLsizei texdim);
113+
extern void smapGetSphereMapTexDim(SphereMap *smap, GLsizei *texdim);
114+
extern void smapGetViewTexDim(SphereMap *smap, GLsizei *texdim);
115+
116+
extern void smapSetContextData(SphereMap *smap, void *context);
117+
extern void smapGetContextData(SphereMap *smap, void **context);
118+
119+
extern void smapSetPositionLightsFunc(SphereMap *smap, void (*positionLights)(int view, void *context));
120+
extern void smapSetDrawViewFunc(SphereMap *smap, void (*drawView)(int view, void *context));
121+
extern void smapGetPositionLightsFunc(SphereMap *smap, void (**positionLights)(int view, void *context));
122+
extern void smapGetDrawViewFunc(SphereMap *smap, void (**drawView)(int view, void *context));
123+
124+
extern void smapGenViewTex(SphereMap *smap, int view);
125+
extern void smapGenViewTexs(SphereMap *smap);
126+
extern void smapGenSphereMapFromViewTexs(SphereMap *smap);
127+
extern void smapGenSphereMap(SphereMap *smap);
128+
extern void smapGenSphereMapWithOneViewTex(SphereMap *smap);
129+
130+
extern int smapRvecToSt(float rvec[3], float st[2]);
131+
extern void smapStToRvec(float *st, float *rvec);
132+
133+
#ifdef __cplusplus
134+
}
135+
136+
#endif
137+
#endif /* __glsmap_h__ */
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#ifndef __glsmapint_h__
2+
#define __glsmapint_h__
3+
4+
/* Copyright (c) Mark J. Kilgard, 1998. */
5+
6+
/* This program is freely distributable without licensing fees
7+
and is provided without guarantee or warrantee expressed or
8+
implied. This program is -not- in the public domain. */
9+
10+
#include "glsmap.h"
11+
12+
enum { X = 0, Y = 1, Z = 2 };
13+
14+
#define INITFACE(mesh) \
15+
int steps = mesh->steps; \
16+
int sqsteps = mesh->steps * mesh->steps
17+
18+
#define FACE(side,y,x) \
19+
mesh->face[(side)*sqsteps + (y)*steps + (x)]
20+
21+
#define FACExy(side,i,j) \
22+
(&FACE(side,i,j).x)
23+
24+
#define FACEst(side,i,j) \
25+
(&FACE(side,i,j).s)
26+
27+
#define INITBACK(mesh) \
28+
int allrings = mesh->rings + mesh->edgeExtend; \
29+
int ringedspokes = allrings * mesh->steps
30+
31+
#define BACK(edge,ring,spoke) \
32+
mesh->back[(edge)*ringedspokes + (ring)*mesh->steps + (spoke)]
33+
34+
#define BACKxy(edge,ring,spoke) \
35+
(&BACK(edge,ring,spoke).x)
36+
37+
#define BACKst(edge,ring,spoke) \
38+
(&BACK(edge,ring,spoke).s)
39+
40+
typedef struct _STXY {
41+
GLfloat s, t;
42+
GLfloat x, y;
43+
} STXY;
44+
45+
typedef struct _SphereMapMesh {
46+
47+
int refcnt;
48+
49+
int steps;
50+
int rings;
51+
int edgeExtend;
52+
53+
STXY *face;
54+
STXY *back;
55+
56+
} SphereMapMesh;
57+
58+
struct _SphereMap {
59+
60+
/* Shared sphere map mesh vertex data. */
61+
SphereMapMesh *mesh;
62+
63+
/* Texture object ids. */
64+
GLuint smapTexObj;
65+
GLuint viewTexObjs[6];
66+
GLuint viewTexObj;
67+
68+
/* Flags */
69+
SphereMapFlags flags;
70+
71+
/* Texture dimensions must be a power of two. */
72+
int viewTexDim; /* view texture dimension */
73+
int smapTexDim; /* sphere map texture dimension */
74+
75+
/* Viewport origins for view and sphere map rendering. */
76+
int viewOrigin[2];
77+
int smapOrigin[2];
78+
79+
/* Viewing vectors. */
80+
GLfloat eye[3];
81+
GLfloat up[3];
82+
GLfloat obj[3];
83+
84+
/* Projection parameters. */
85+
GLfloat viewNear;
86+
GLfloat viewFar;
87+
88+
/* Rendering callbacks. */
89+
void (*positionLights)(int view, void *context);
90+
void (*drawView)(int view, void *context);
91+
92+
/* Application specified callback data. */
93+
void *context;
94+
95+
};
96+
97+
/* Library internal routines. */
98+
extern void __smapDrawSphereMapMeshSide(SphereMapMesh *mesh, int side);
99+
extern void __smapDrawSphereMapMeshBack(SphereMapMesh *mesh);
100+
extern void __smapValidateSphereMapMesh(SphereMapMesh *mesh);
101+
102+
#endif /* __glsmapint_h__ */

0 commit comments

Comments
 (0)