Compare commits
44 Commits
mesa_7_7_r
...
mesa_7_7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e210b9337 | ||
|
|
164b583852 | ||
|
|
48302e9b30 | ||
|
|
75ad099d3c | ||
|
|
982acbddab | ||
|
|
09415ca234 | ||
|
|
de7021b71c | ||
|
|
2b7b2b90e3 | ||
|
|
b57abd3bea | ||
|
|
bf064ce0c3 | ||
|
|
e46ad402f1 | ||
|
|
bd9e0ebaff | ||
|
|
bce03f7174 | ||
|
|
34671efa29 | ||
|
|
e77bfc436d | ||
|
|
9373287a1b | ||
|
|
9d2910ee0f | ||
|
|
43d8727301 | ||
|
|
1703628011 | ||
|
|
07b54fe35b | ||
|
|
fdae39c289 | ||
|
|
79e74cda73 | ||
|
|
753f0a1dea | ||
|
|
ace937f165 | ||
|
|
b96a5df514 | ||
|
|
f926eff263 | ||
|
|
0dd9513874 | ||
|
|
d87d71036c | ||
|
|
3340fd65fb | ||
|
|
695adf41e2 | ||
|
|
121ff55d81 | ||
|
|
41377942d3 | ||
|
|
0478b745fe | ||
|
|
20ee275974 | ||
|
|
aeea8a07b8 | ||
|
|
8a09e6e2ad | ||
|
|
f44f6473e6 | ||
|
|
189ee75abb | ||
|
|
da5741cf53 | ||
|
|
6785d6741d | ||
|
|
b51e0fafdf | ||
|
|
f06c8bd8dd | ||
|
|
325f045c04 | ||
|
|
5e6fff7ac4 |
20
bin/mklib
20
bin/mklib
@@ -724,22 +724,10 @@ case $ARCH in
|
|||||||
|
|
||||||
# examine first object to determine ABI
|
# examine first object to determine ABI
|
||||||
set ${OBJECTS}
|
set ${OBJECTS}
|
||||||
ABI_PPC=`file $1 | grep ' ppc'`
|
ABIS=`lipo -info $1 | sed s/.*://`
|
||||||
ABI_I386=`file $1 | grep ' i386'`
|
for ABI in $ABIS; do
|
||||||
ABI_PPC64=`file $1 | grep ' ppc64'`
|
OPTS="${OPTS} -arch ${ABI}"
|
||||||
ABI_X86_64=`file $1 | grep ' x86_64'`
|
done
|
||||||
if [ "${ABI_PPC}" ] ; then
|
|
||||||
OPTS="${OPTS} -arch ppc"
|
|
||||||
fi
|
|
||||||
if [ "${ABI_I386}" ] ; then
|
|
||||||
OPTS="${OPTS} -arch i386"
|
|
||||||
fi
|
|
||||||
if [ "${ABI_PPC64}" ] ; then
|
|
||||||
OPTS="${OPTS} -arch ppc64"
|
|
||||||
fi
|
|
||||||
if [ "${ABI_X86_64}" ] ; then
|
|
||||||
OPTS="${OPTS} -arch x86_64"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${ALTOPTS}" ] ; then
|
if [ "${ALTOPTS}" ] ; then
|
||||||
OPTS=${ALTOPTS}
|
OPTS=${ALTOPTS}
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ X11_DIR = $(INSTALL_DIR)
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
PIC_FLAGS = -fPIC
|
PIC_FLAGS = -fPIC
|
||||||
DEFINES = -D_DARWIN_C_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L \
|
DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \
|
||||||
-D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DPTHREADS \
|
|
||||||
-DGLX_ALIAS_UNSUPPORTED -DGLX_INDIRECT_RENDERING
|
-DGLX_ALIAS_UNSUPPORTED -DGLX_INDIRECT_RENDERING
|
||||||
|
|
||||||
|
# -D_GNU_SOURCE - for src/mesa/main ...
|
||||||
# -DGLX_DIRECT_RENDERING - pulls in libdrm stuff in glx/x11
|
# -DGLX_DIRECT_RENDERING - pulls in libdrm stuff in glx/x11
|
||||||
# -DGLX_USE_APPLEGL - supposed to be used with GLX_DIRECT_RENDERING to use AGL rather than DRM, but doesn't compile
|
# -DGLX_USE_APPLEGL - supposed to be used with GLX_DIRECT_RENDERING to use AGL rather than DRM, but doesn't compile
|
||||||
# -DIN_DRI_DRIVER
|
# -DIN_DRI_DRIVER
|
||||||
|
|||||||
11
configure.ac
11
configure.ac
@@ -19,6 +19,7 @@ AC_CANONICAL_HOST
|
|||||||
|
|
||||||
dnl Versions for external dependencies
|
dnl Versions for external dependencies
|
||||||
LIBDRM_REQUIRED=2.4.15
|
LIBDRM_REQUIRED=2.4.15
|
||||||
|
LIBDRM_RADEON_REQUIRED=2.4.17
|
||||||
DRI2PROTO_REQUIRED=1.99.3
|
DRI2PROTO_REQUIRED=1.99.3
|
||||||
|
|
||||||
dnl Check for progs
|
dnl Check for progs
|
||||||
@@ -577,7 +578,7 @@ dri)
|
|||||||
GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
|
GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
|
||||||
DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
|
DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
|
||||||
|
|
||||||
PKG_CHECK_MODULES([LIBDRM_RADEON], [libdrm_radeon], HAVE_LIBDRM_RADEON=yes, HAVE_LIBDRM_RADEON=no)
|
PKG_CHECK_MODULES([LIBDRM_RADEON], [libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED], HAVE_LIBDRM_RADEON=yes, HAVE_LIBDRM_RADEON=no)
|
||||||
|
|
||||||
if test "$HAVE_LIBDRM_RADEON" = yes; then
|
if test "$HAVE_LIBDRM_RADEON" = yes; then
|
||||||
RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
|
RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
|
||||||
@@ -1200,13 +1201,15 @@ dnl
|
|||||||
dnl Gallium SVGA configuration
|
dnl Gallium SVGA configuration
|
||||||
dnl
|
dnl
|
||||||
AC_ARG_ENABLE([gallium-svga],
|
AC_ARG_ENABLE([gallium-svga],
|
||||||
[AS_HELP_STRING([--disable-gallium-svga],
|
[AS_HELP_STRING([--enable-gallium-svga],
|
||||||
[build gallium SVGA @<:@default=enabled@:>@])],
|
[build gallium SVGA @<:@default=disabled@:>@])],
|
||||||
[enable_gallium_svga="$enableval"],
|
[enable_gallium_svga="$enableval"],
|
||||||
[enable_gallium_svga=yes])
|
[enable_gallium_svga=auto])
|
||||||
if test "x$enable_gallium_svga" = xyes; then
|
if test "x$enable_gallium_svga" = xyes; then
|
||||||
GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS vmware"
|
GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS vmware"
|
||||||
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
|
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
|
||||||
|
elif test "x$enable_gallium_svga" = xauto; then
|
||||||
|
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ Display( void )
|
|||||||
GLint reads = 0;
|
GLint reads = 0;
|
||||||
GLint endTime;
|
GLint endTime;
|
||||||
GLint startTime = glutGet(GLUT_ELAPSED_TIME);
|
GLint startTime = glutGet(GLUT_ELAPSED_TIME);
|
||||||
GLdouble seconds, pixelsPerSecond;
|
GLdouble seconds, mpixels, mpixelsPerSecond;
|
||||||
printf("Benchmarking...\n");
|
printf("Benchmarking...\n");
|
||||||
do {
|
do {
|
||||||
glReadPixels(APosX, APosY, ImgWidth, ImgHeight,
|
glReadPixels(APosX, APosY, ImgWidth, ImgHeight,
|
||||||
@@ -228,9 +228,10 @@ Display( void )
|
|||||||
endTime = glutGet(GLUT_ELAPSED_TIME);
|
endTime = glutGet(GLUT_ELAPSED_TIME);
|
||||||
} while (endTime - startTime < 4000); /* 4 seconds */
|
} while (endTime - startTime < 4000); /* 4 seconds */
|
||||||
seconds = (double) (endTime - startTime) / 1000.0;
|
seconds = (double) (endTime - startTime) / 1000.0;
|
||||||
pixelsPerSecond = reads * ImgWidth * ImgHeight / seconds;
|
mpixels = reads * (ImgWidth * ImgHeight / (1000.0 * 1000.0));
|
||||||
printf("Result: %d reads in %f seconds = %f pixels/sec\n",
|
mpixelsPerSecond = mpixels / seconds;
|
||||||
reads, seconds, pixelsPerSecond);
|
printf("Result: %d reads in %f seconds = %f Mpixels/sec\n",
|
||||||
|
reads, seconds, mpixelsPerSecond);
|
||||||
Benchmark = GL_FALSE;
|
Benchmark = GL_FALSE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ Idle(void)
|
|||||||
{
|
{
|
||||||
Xrot = glutGet(GLUT_ELAPSED_TIME) * 0.02;
|
Xrot = glutGet(GLUT_ELAPSED_TIME) * 0.02;
|
||||||
Yrot = glutGet(GLUT_ELAPSED_TIME) * 0.04;
|
Yrot = glutGet(GLUT_ELAPSED_TIME) * 0.04;
|
||||||
/*Zrot += 2.0;*/
|
/* Zrot += 2.0; */
|
||||||
glutPostRedisplay();
|
glutPostRedisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -627,7 +627,7 @@ Init(void)
|
|||||||
NumAttribs = GetAttribs(Program, Attribs);
|
NumAttribs = GetAttribs(Program, Attribs);
|
||||||
PrintAttribs(Attribs);
|
PrintAttribs(Attribs);
|
||||||
|
|
||||||
/*assert(glGetError() == 0);*/
|
/* assert(glGetError() == 0); */
|
||||||
|
|
||||||
glClearColor(0.4f, 0.4f, 0.8f, 0.0f);
|
glClearColor(0.4f, 0.4f, 0.8f, 0.0f);
|
||||||
|
|
||||||
|
|||||||
@@ -310,10 +310,8 @@ MakeMipmap(void)
|
|||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
/*
|
/* glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4); */
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4);
|
/* glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 5); */
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 5);
|
|
||||||
*/
|
|
||||||
|
|
||||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
#undef SZ
|
#undef SZ
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include "glmain.h"
|
#include "glmain.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
@@ -53,6 +54,11 @@ static const struct vertex vertices[1] = {
|
|||||||
void
|
void
|
||||||
PerfInit(void)
|
PerfInit(void)
|
||||||
{
|
{
|
||||||
|
if (!PerfExtensionSupported("GL_ARB_framebuffer_object")) {
|
||||||
|
printf("Sorry, this test requires GL_ARB_framebuffer_object\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
/* setup VBO w/ vertex data */
|
/* setup VBO w/ vertex data */
|
||||||
glGenBuffersARB(1, &VBO);
|
glGenBuffersARB(1, &VBO);
|
||||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, VBO);
|
glBindBufferARB(GL_ARRAY_BUFFER_ARB, VBO);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ static void init(void)
|
|||||||
|
|
||||||
#define NFACE 6
|
#define NFACE 6
|
||||||
#define NVERT 8
|
#define NVERT 8
|
||||||
void drawCube(GLdouble x0, GLdouble x1, GLdouble y0, GLdouble y1,
|
static void drawCube(GLdouble x0, GLdouble x1, GLdouble y0, GLdouble y1,
|
||||||
GLdouble z0, GLdouble z1)
|
GLdouble z0, GLdouble z1)
|
||||||
{
|
{
|
||||||
static GLfloat v[8][3];
|
static GLfloat v[8][3];
|
||||||
@@ -101,7 +101,7 @@ void drawCube(GLdouble x0, GLdouble x1, GLdouble y0, GLdouble y1,
|
|||||||
/* Note: polygons must be drawn from front to back
|
/* Note: polygons must be drawn from front to back
|
||||||
* for proper blending.
|
* for proper blending.
|
||||||
*/
|
*/
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
if (polySmooth) {
|
if (polySmooth) {
|
||||||
glClear (GL_COLOR_BUFFER_BIT);
|
glClear (GL_COLOR_BUFFER_BIT);
|
||||||
@@ -126,7 +126,7 @@ void display(void)
|
|||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -137,7 +137,7 @@ void reshape(int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 't':
|
case 't':
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ static float rotAngle = 0.;
|
|||||||
* blending, hint, and line width. Print out implementation
|
* blending, hint, and line width. Print out implementation
|
||||||
* specific info on line width granularity and width.
|
* specific info on line width granularity and width.
|
||||||
*/
|
*/
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
GLfloat values[2];
|
GLfloat values[2];
|
||||||
glGetFloatv (GL_LINE_WIDTH_GRANULARITY, values);
|
glGetFloatv (GL_LINE_WIDTH_GRANULARITY, values);
|
||||||
@@ -72,7 +72,7 @@ void init(void)
|
|||||||
|
|
||||||
/* Draw 2 diagonal lines to form an X
|
/* Draw 2 diagonal lines to form an X
|
||||||
*/
|
*/
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -113,7 +113,7 @@ void reshape(int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'r':
|
case 'r':
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
/* Initialize lighting and other values.
|
/* Initialize lighting and other values.
|
||||||
*/
|
*/
|
||||||
void myinit(void)
|
static void myinit(void)
|
||||||
{
|
{
|
||||||
GLfloat mat_ambient[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat mat_ambient[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
@@ -68,7 +68,7 @@ void myinit(void)
|
|||||||
glClearAccum(0.0, 0.0, 0.0, 0.0);
|
glClearAccum(0.0, 0.0, 0.0, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void displayObjects(void)
|
static void displayObjects(void)
|
||||||
{
|
{
|
||||||
GLfloat torus_diffuse[] = { 0.7, 0.7, 0.0, 1.0 };
|
GLfloat torus_diffuse[] = { 0.7, 0.7, 0.0, 1.0 };
|
||||||
GLfloat cube_diffuse[] = { 0.0, 0.7, 0.7, 1.0 };
|
GLfloat cube_diffuse[] = { 0.0, 0.7, 0.7, 1.0 };
|
||||||
@@ -111,7 +111,7 @@ void displayObjects(void)
|
|||||||
|
|
||||||
#define ACSIZE 8
|
#define ACSIZE 8
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
GLint viewport[4];
|
GLint viewport[4];
|
||||||
int jitter;
|
int jitter;
|
||||||
@@ -137,7 +137,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void myReshape(int w, int h)
|
static void myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
* probably want to insure that your ModelView matrix has been
|
* probably want to insure that your ModelView matrix has been
|
||||||
* initialized to identity before calling accFrustum().
|
* initialized to identity before calling accFrustum().
|
||||||
*/
|
*/
|
||||||
void accFrustum(GLdouble left, GLdouble right, GLdouble bottom,
|
static void accFrustum(GLdouble left, GLdouble right, GLdouble bottom,
|
||||||
GLdouble top, GLdouble nnear, GLdouble ffar, GLdouble pixdx,
|
GLdouble top, GLdouble nnear, GLdouble ffar, GLdouble pixdx,
|
||||||
GLdouble pixdy, GLdouble eyedx, GLdouble eyedy, GLdouble focus)
|
GLdouble pixdy, GLdouble eyedx, GLdouble eyedy, GLdouble focus)
|
||||||
{
|
{
|
||||||
@@ -99,7 +99,7 @@ void accFrustum(GLdouble left, GLdouble right, GLdouble bottom,
|
|||||||
*
|
*
|
||||||
* Note that accPerspective() calls accFrustum().
|
* Note that accPerspective() calls accFrustum().
|
||||||
*/
|
*/
|
||||||
void accPerspective(GLdouble fovy, GLdouble aspect,
|
static void accPerspective(GLdouble fovy, GLdouble aspect,
|
||||||
GLdouble nnear, GLdouble ffar, GLdouble pixdx, GLdouble pixdy,
|
GLdouble nnear, GLdouble ffar, GLdouble pixdx, GLdouble pixdy,
|
||||||
GLdouble eyedx, GLdouble eyedy, GLdouble focus)
|
GLdouble eyedx, GLdouble eyedy, GLdouble focus)
|
||||||
{
|
{
|
||||||
@@ -119,7 +119,7 @@ void accPerspective(GLdouble fovy, GLdouble aspect,
|
|||||||
|
|
||||||
/* Initialize lighting and other values.
|
/* Initialize lighting and other values.
|
||||||
*/
|
*/
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
GLfloat mat_ambient[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat mat_ambient[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
@@ -141,7 +141,7 @@ void init(void)
|
|||||||
glClearAccum(0.0, 0.0, 0.0, 0.0);
|
glClearAccum(0.0, 0.0, 0.0, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void displayObjects(void)
|
static void displayObjects(void)
|
||||||
{
|
{
|
||||||
GLfloat torus_diffuse[] = { 0.7, 0.7, 0.0, 1.0 };
|
GLfloat torus_diffuse[] = { 0.7, 0.7, 0.0, 1.0 };
|
||||||
GLfloat cube_diffuse[] = { 0.0, 0.7, 0.7, 1.0 };
|
GLfloat cube_diffuse[] = { 0.0, 0.7, 0.7, 1.0 };
|
||||||
@@ -185,7 +185,7 @@ void displayObjects(void)
|
|||||||
|
|
||||||
#define ACSIZE 8
|
#define ACSIZE 8
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
GLint viewport[4];
|
GLint viewport[4];
|
||||||
int jitter;
|
int jitter;
|
||||||
@@ -205,13 +205,13 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ static void drawRightTriangle(void)
|
|||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -108,7 +108,7 @@ void reshape(int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 't':
|
case 't':
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ static void init(void)
|
|||||||
glEndList();
|
glEndList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
GLfloat mat_solid[] = { 0.75, 0.75, 0.0, 1.0 };
|
GLfloat mat_solid[] = { 0.75, 0.75, 0.0, 1.0 };
|
||||||
GLfloat mat_zero[] = { 0.0, 0.0, 0.0, 1.0 };
|
GLfloat mat_zero[] = { 0.0, 0.0, 0.0, 1.0 };
|
||||||
@@ -113,7 +113,7 @@ void display(void)
|
|||||||
glutSwapBuffers();
|
glutSwapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLint) w, (GLint) h);
|
glViewport(0, 0, (GLint) w, (GLint) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -128,7 +128,7 @@ void reshape(int w, int h)
|
|||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
}
|
}
|
||||||
|
|
||||||
void animate(void)
|
static void animate(void)
|
||||||
{
|
{
|
||||||
static double t0 = -1.;
|
static double t0 = -1.;
|
||||||
if (solidZ <= MINZ || transparentZ >= MAXZ)
|
if (solidZ <= MINZ || transparentZ >= MAXZ)
|
||||||
@@ -150,7 +150,7 @@ void animate(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'a':
|
case 'a':
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
* blending, hint, and line width. Print out implementation
|
* blending, hint, and line width. Print out implementation
|
||||||
* specific info on line width granularity and width.
|
* specific info on line width granularity and width.
|
||||||
*/
|
*/
|
||||||
void myinit(void)
|
static void myinit(void)
|
||||||
{
|
{
|
||||||
GLfloat values[2];
|
GLfloat values[2];
|
||||||
glGetFloatv (GL_LINE_WIDTH_GRANULARITY, values);
|
glGetFloatv (GL_LINE_WIDTH_GRANULARITY, values);
|
||||||
@@ -73,7 +73,7 @@ void myinit(void)
|
|||||||
|
|
||||||
/* display() draws an icosahedron with a large alpha value, 1.0.
|
/* display() draws an icosahedron with a large alpha value, 1.0.
|
||||||
*/
|
*/
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glColor4f (1.0, 1.0, 1.0, 1.0);
|
glColor4f (1.0, 1.0, 1.0, 1.0);
|
||||||
@@ -81,7 +81,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void myReshape(int w, int h)
|
static void myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ GLfloat ctrlpoints[4][3] = {
|
|||||||
{ -4.0, -4.0, 0.0}, { -2.0, 4.0, 0.0},
|
{ -4.0, -4.0, 0.0}, { -2.0, 4.0, 0.0},
|
||||||
{2.0, -4.0, 0.0}, {4.0, 4.0, 0.0}};
|
{2.0, -4.0, 0.0}, {4.0, 4.0, 0.0}};
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor(0.0, 0.0, 0.0, 0.0);
|
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel(GL_FLAT);
|
glShadeModel(GL_FLAT);
|
||||||
@@ -53,7 +53,7 @@ void init(void)
|
|||||||
glEnable(GL_MAP1_VERTEX_3);
|
glEnable(GL_MAP1_VERTEX_3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -89,7 +89,7 @@ void reshape(int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ GLfloat ctrlpoints[4][4][3] =
|
|||||||
{1.5, 1.5, -1.0}}
|
{1.5, 1.5, -1.0}}
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
static void
|
||||||
initlights(void)
|
initlights(void)
|
||||||
{
|
{
|
||||||
GLfloat ambient[] =
|
GLfloat ambient[] =
|
||||||
@@ -93,7 +93,7 @@ initlights(void)
|
|||||||
glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
|
glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
display(void)
|
display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
@@ -104,7 +104,7 @@ display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
myinit(void)
|
myinit(void)
|
||||||
{
|
{
|
||||||
glClearColor(0.0, 0.0, 0.0, 1.0);
|
glClearColor(0.0, 0.0, 0.0, 1.0);
|
||||||
@@ -118,7 +118,7 @@ myinit(void)
|
|||||||
initlights(); /* for lighted version only */
|
initlights(); /* for lighted version only */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
myReshape(int w, int h)
|
myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
#define checkImageHeight 64
|
#define checkImageHeight 64
|
||||||
GLubyte checkImage[checkImageWidth][checkImageHeight][3];
|
GLubyte checkImage[checkImageWidth][checkImageHeight][3];
|
||||||
|
|
||||||
void makeCheckImage(void)
|
static void makeCheckImage(void)
|
||||||
{
|
{
|
||||||
int i, j, c;
|
int i, j, c;
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ void makeCheckImage(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void myinit(void)
|
static void myinit(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
@@ -84,7 +84,7 @@ void myinit(void)
|
|||||||
glShadeModel(GL_FLAT);
|
glShadeModel(GL_FLAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
@@ -101,7 +101,7 @@ void display(void)
|
|||||||
glutSwapBuffers();
|
glutSwapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void myReshape(int w, int h)
|
static void myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
|||||||
@@ -42,13 +42,13 @@
|
|||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel (GL_FLAT);
|
glShadeModel (GL_FLAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
GLdouble eqn[4] = {0.0, 1.0, 0.0, 0.0};
|
GLdouble eqn[4] = {0.0, 1.0, 0.0, 0.0};
|
||||||
GLdouble eqn2[4] = {1.0, 0.0, 0.0, 0.0};
|
GLdouble eqn2[4] = {1.0, 0.0, 0.0, 0.0};
|
||||||
@@ -73,7 +73,7 @@ void display(void)
|
|||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape (int w, int h)
|
static void reshape (int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
@@ -83,7 +83,7 @@ void reshape (int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ GLfloat diffuseMaterial[4] = { 0.5, 0.5, 0.5, 1.0 };
|
|||||||
/* Initialize material property, light source, lighting model,
|
/* Initialize material property, light source, lighting model,
|
||||||
* and depth buffer.
|
* and depth buffer.
|
||||||
*/
|
*/
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 };
|
GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 };
|
||||||
@@ -68,14 +68,14 @@ void init(void)
|
|||||||
glEnable(GL_COLOR_MATERIAL);
|
glEnable(GL_COLOR_MATERIAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glutSolidSphere(1.0, 20, 16);
|
glutSolidSphere(1.0, 20, 16);
|
||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape (int w, int h)
|
static void reshape (int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
@@ -91,7 +91,7 @@ void reshape (int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED2 */
|
/* ARGSUSED2 */
|
||||||
void mouse(int button, int state, int x, int y)
|
static void mouse(int button, int state, int x, int y)
|
||||||
{
|
{
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case GLUT_LEFT_BUTTON:
|
case GLUT_LEFT_BUTTON:
|
||||||
@@ -127,7 +127,7 @@ void mouse(int button, int state, int x, int y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -44,13 +44,13 @@
|
|||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel (GL_FLAT);
|
glShadeModel (GL_FLAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear (GL_COLOR_BUFFER_BIT);
|
glClear (GL_COLOR_BUFFER_BIT);
|
||||||
glColor3f (1.0, 1.0, 1.0);
|
glColor3f (1.0, 1.0, 1.0);
|
||||||
@@ -62,7 +62,7 @@ void display(void)
|
|||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape (int w, int h)
|
static void reshape (int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
@@ -72,7 +72,7 @@ void reshape (int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
/* Initialize linear fog for depth cueing.
|
/* Initialize linear fog for depth cueing.
|
||||||
*/
|
*/
|
||||||
void myinit(void)
|
static void myinit(void)
|
||||||
{
|
{
|
||||||
GLfloat fogColor[4] = {0.0, 0.0, 0.0, 1.0};
|
GLfloat fogColor[4] = {0.0, 0.0, 0.0, 1.0};
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ void myinit(void)
|
|||||||
|
|
||||||
/* display() draws an icosahedron.
|
/* display() draws an icosahedron.
|
||||||
*/
|
*/
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glColor3f (1.0, 1.0, 1.0);
|
glColor3f (1.0, 1.0, 1.0);
|
||||||
@@ -75,7 +75,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void myReshape(int w, int h)
|
static void myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
* probably want to insure that your ModelView matrix has been
|
* probably want to insure that your ModelView matrix has been
|
||||||
* initialized to identity before calling accFrustum().
|
* initialized to identity before calling accFrustum().
|
||||||
*/
|
*/
|
||||||
void accFrustum(GLdouble left, GLdouble right, GLdouble bottom,
|
static void accFrustum(GLdouble left, GLdouble right, GLdouble bottom,
|
||||||
GLdouble top, GLdouble nnear, GLdouble ffar, GLdouble pixdx,
|
GLdouble top, GLdouble nnear, GLdouble ffar, GLdouble pixdx,
|
||||||
GLdouble pixdy, GLdouble eyedx, GLdouble eyedy, GLdouble focus)
|
GLdouble pixdy, GLdouble eyedx, GLdouble eyedy, GLdouble focus)
|
||||||
{
|
{
|
||||||
@@ -105,7 +105,7 @@ void accFrustum(GLdouble left, GLdouble right, GLdouble bottom,
|
|||||||
*
|
*
|
||||||
* Note that accPerspective() calls accFrustum().
|
* Note that accPerspective() calls accFrustum().
|
||||||
*/
|
*/
|
||||||
void accPerspective(GLdouble fovy, GLdouble aspect,
|
static void accPerspective(GLdouble fovy, GLdouble aspect,
|
||||||
GLdouble nnear, GLdouble ffar, GLdouble pixdx, GLdouble pixdy,
|
GLdouble nnear, GLdouble ffar, GLdouble pixdx, GLdouble pixdy,
|
||||||
GLdouble eyedx, GLdouble eyedy, GLdouble focus)
|
GLdouble eyedx, GLdouble eyedy, GLdouble focus)
|
||||||
{
|
{
|
||||||
@@ -123,7 +123,7 @@ void accPerspective(GLdouble fovy, GLdouble aspect,
|
|||||||
pixdx, pixdy, eyedx, eyedy, focus);
|
pixdx, pixdy, eyedx, eyedy, focus);
|
||||||
}
|
}
|
||||||
|
|
||||||
void myinit(void)
|
static void myinit(void)
|
||||||
{
|
{
|
||||||
GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 };
|
GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 };
|
||||||
GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
@@ -155,7 +155,7 @@ void myinit(void)
|
|||||||
glClearAccum(0.0, 0.0, 0.0, 0.0);
|
glClearAccum(0.0, 0.0, 0.0, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void renderTeapot (GLfloat x, GLfloat y, GLfloat z,
|
static void renderTeapot (GLfloat x, GLfloat y, GLfloat z,
|
||||||
GLfloat ambr, GLfloat ambg, GLfloat ambb,
|
GLfloat ambr, GLfloat ambg, GLfloat ambb,
|
||||||
GLfloat difr, GLfloat difg, GLfloat difb,
|
GLfloat difr, GLfloat difg, GLfloat difb,
|
||||||
GLfloat specr, GLfloat specg, GLfloat specb, GLfloat shine)
|
GLfloat specr, GLfloat specg, GLfloat specb, GLfloat shine)
|
||||||
@@ -182,7 +182,7 @@ void renderTeapot (GLfloat x, GLfloat y, GLfloat z,
|
|||||||
* magnitude of the accPerspective() jitter; in this example, 0.33.
|
* magnitude of the accPerspective() jitter; in this example, 0.33.
|
||||||
* In this example, the teapots are drawn 8 times. See jitter.h
|
* In this example, the teapots are drawn 8 times. See jitter.h
|
||||||
*/
|
*/
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
int jitter;
|
int jitter;
|
||||||
GLint viewport[4];
|
GLint viewport[4];
|
||||||
@@ -214,7 +214,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void myReshape(int w, int h)
|
static void myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
static GLfloat spin = 0.0;
|
static GLfloat spin = 0.0;
|
||||||
static GLdouble t0 = 0.;
|
static GLdouble t0 = 0.;
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
@@ -59,12 +59,12 @@ void display(void)
|
|||||||
glutSwapBuffers();
|
glutSwapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
GLdouble gettime(void)
|
static GLdouble gettime(void)
|
||||||
{
|
{
|
||||||
return (GLdouble)(glutGet(GLUT_ELAPSED_TIME)) / 1000.;
|
return (GLdouble)(glutGet(GLUT_ELAPSED_TIME)) / 1000.;
|
||||||
}
|
}
|
||||||
|
|
||||||
void spinDisplay(void)
|
static void spinDisplay(void)
|
||||||
{
|
{
|
||||||
GLdouble t, dt;
|
GLdouble t, dt;
|
||||||
t = gettime();
|
t = gettime();
|
||||||
@@ -76,13 +76,13 @@ void spinDisplay(void)
|
|||||||
glutPostRedisplay();
|
glutPostRedisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel (GL_FLAT);
|
glShadeModel (GL_FLAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -93,7 +93,7 @@ void reshape(int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED2 */
|
/* ARGSUSED2 */
|
||||||
void mouse(int button, int state, int x, int y)
|
static void mouse(int button, int state, int x, int y)
|
||||||
{
|
{
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case GLUT_LEFT_BUTTON:
|
case GLUT_LEFT_BUTTON:
|
||||||
|
|||||||
@@ -48,13 +48,13 @@ GLubyte rasters[24] = {
|
|||||||
0xff, 0x00, 0xff, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00,
|
0xff, 0x00, 0xff, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00,
|
||||||
0xff, 0xc0, 0xff, 0xc0};
|
0xff, 0xc0, 0xff, 0xc0};
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
|
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
glColor3f (1.0, 1.0, 1.0);
|
glColor3f (1.0, 1.0, 1.0);
|
||||||
@@ -65,7 +65,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -75,7 +75,7 @@ void reshape(int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
/* Initialize lighting.
|
/* Initialize lighting.
|
||||||
*/
|
*/
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glEnable(GL_LIGHTING);
|
glEnable(GL_LIGHTING);
|
||||||
glEnable(GL_LIGHT0);
|
glEnable(GL_LIGHT0);
|
||||||
@@ -58,7 +58,7 @@ void init(void)
|
|||||||
* be clipped. If in feedback mode, a passthrough token
|
* be clipped. If in feedback mode, a passthrough token
|
||||||
* is issued between the each primitive.
|
* is issued between the each primitive.
|
||||||
*/
|
*/
|
||||||
void drawGeometry (GLenum mode)
|
static void drawGeometry (GLenum mode)
|
||||||
{
|
{
|
||||||
glBegin (GL_LINE_STRIP);
|
glBegin (GL_LINE_STRIP);
|
||||||
glNormal3f (0.0, 0.0, 1.0);
|
glNormal3f (0.0, 0.0, 1.0);
|
||||||
@@ -80,8 +80,8 @@ void drawGeometry (GLenum mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Write contents of one vertex to stdout. */
|
/* Write contents of one vertex to stdout. */
|
||||||
void print3DcolorVertex (GLint size, GLint *count,
|
static void print3DcolorVertex (GLint size, GLint *count,
|
||||||
GLfloat *buffer)
|
GLfloat *buffer)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ void print3DcolorVertex (GLint size, GLint *count,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Write contents of entire buffer. (Parse tokens!) */
|
/* Write contents of entire buffer. (Parse tokens!) */
|
||||||
void printBuffer(GLint size, GLfloat *buffer)
|
static void printBuffer(GLint size, GLfloat *buffer)
|
||||||
{
|
{
|
||||||
GLint count;
|
GLint count;
|
||||||
GLfloat token;
|
GLfloat token;
|
||||||
@@ -124,7 +124,7 @@ void printBuffer(GLint size, GLfloat *buffer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
GLfloat feedBuffer[1024];
|
GLfloat feedBuffer[1024];
|
||||||
GLint size;
|
GLint size;
|
||||||
@@ -148,7 +148,7 @@ void display(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
GLint fogMode;
|
GLint fogMode;
|
||||||
|
|
||||||
void
|
static void
|
||||||
selectFog(int mode)
|
selectFog(int mode)
|
||||||
{
|
{
|
||||||
switch(mode) {
|
switch(mode) {
|
||||||
@@ -73,7 +73,7 @@ selectFog(int mode)
|
|||||||
/* Initialize z-buffer, projection matrix, light source,
|
/* Initialize z-buffer, projection matrix, light source,
|
||||||
* and lighting model. Do not specify a material property here.
|
* and lighting model. Do not specify a material property here.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
myinit(void)
|
myinit(void)
|
||||||
{
|
{
|
||||||
GLfloat position[] =
|
GLfloat position[] =
|
||||||
@@ -106,7 +106,7 @@ myinit(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
renderRedTeapot(GLfloat x, GLfloat y, GLfloat z)
|
renderRedTeapot(GLfloat x, GLfloat y, GLfloat z)
|
||||||
{
|
{
|
||||||
float mat[4];
|
float mat[4];
|
||||||
@@ -133,7 +133,7 @@ renderRedTeapot(GLfloat x, GLfloat y, GLfloat z)
|
|||||||
|
|
||||||
/* display() draws 5 teapots at different z positions.
|
/* display() draws 5 teapots at different z positions.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
display(void)
|
display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
@@ -145,7 +145,7 @@ display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
myReshape(int w, int h)
|
myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
#define NUM_COLORS 32
|
#define NUM_COLORS 32
|
||||||
#define RAMPSTART 16
|
#define RAMPSTART 16
|
||||||
|
|
||||||
void
|
static void
|
||||||
myinit(void)
|
myinit(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -77,7 +77,7 @@ myinit(void)
|
|||||||
|
|
||||||
/* display() renders 3 cones at different z positions.
|
/* display() renders 3 cones at different z positions.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
display(void)
|
display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
@@ -104,7 +104,7 @@ display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
myReshape(int w, int h)
|
myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ GLubyte letters[][13] = {
|
|||||||
|
|
||||||
GLuint fontOffset;
|
GLuint fontOffset;
|
||||||
|
|
||||||
void makeRasterFont(void)
|
static void makeRasterFont(void)
|
||||||
{
|
{
|
||||||
GLuint i, j;
|
GLuint i, j;
|
||||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||||
@@ -96,13 +96,13 @@ void makeRasterFont(void)
|
|||||||
glEndList();
|
glEndList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glShadeModel (GL_FLAT);
|
glShadeModel (GL_FLAT);
|
||||||
makeRasterFont();
|
makeRasterFont();
|
||||||
}
|
}
|
||||||
|
|
||||||
void printString(char *s)
|
static void printString(char *s)
|
||||||
{
|
{
|
||||||
glPushAttrib (GL_LIST_BIT);
|
glPushAttrib (GL_LIST_BIT);
|
||||||
glListBase(fontOffset);
|
glListBase(fontOffset);
|
||||||
@@ -115,7 +115,7 @@ void printString(char *s)
|
|||||||
* to call makeRasterFont() before you start making
|
* to call makeRasterFont() before you start making
|
||||||
* calls to printString().
|
* calls to printString().
|
||||||
*/
|
*/
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
GLfloat white[3] = { 1.0, 1.0, 1.0 };
|
GLfloat white[3] = { 1.0, 1.0, 1.0 };
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ void display(void)
|
|||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -139,7 +139,7 @@ void reshape(int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
/* clear all pixels */
|
/* clear all pixels */
|
||||||
glClear (GL_COLOR_BUFFER_BIT);
|
glClear (GL_COLOR_BUFFER_BIT);
|
||||||
@@ -64,7 +64,7 @@ void display(void)
|
|||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void init (void)
|
static void init (void)
|
||||||
{
|
{
|
||||||
/* select clearing color */
|
/* select clearing color */
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ GLubyte checkImage[checkImageHeight][checkImageWidth][3];
|
|||||||
static GLdouble zoomFactor = 1.0;
|
static GLdouble zoomFactor = 1.0;
|
||||||
static GLint height;
|
static GLint height;
|
||||||
|
|
||||||
void makeCheckImage(void)
|
static void makeCheckImage(void)
|
||||||
{
|
{
|
||||||
int i, j, c;
|
int i, j, c;
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ void makeCheckImage(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel(GL_FLAT);
|
glShadeModel(GL_FLAT);
|
||||||
@@ -80,7 +80,7 @@ void init(void)
|
|||||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
glRasterPos2i(0, 0);
|
glRasterPos2i(0, 0);
|
||||||
@@ -89,7 +89,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
height = (GLint) h;
|
height = (GLint) h;
|
||||||
@@ -100,7 +100,7 @@ void reshape(int w, int h)
|
|||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
}
|
}
|
||||||
|
|
||||||
void motion(int x, int y)
|
static void motion(int x, int y)
|
||||||
{
|
{
|
||||||
static GLint screeny;
|
static GLint screeny;
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ void motion(int x, int y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'r':
|
case 'r':
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
/* Initialize material property, light source, lighting model,
|
/* Initialize material property, light source, lighting model,
|
||||||
* and depth buffer.
|
* and depth buffer.
|
||||||
*/
|
*/
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
GLfloat mat_shininess[] = { 50.0 };
|
GLfloat mat_shininess[] = { 50.0 };
|
||||||
@@ -65,14 +65,14 @@ void init(void)
|
|||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glutSolidSphere (1.0, 20, 16);
|
glutSolidSphere (1.0, 20, 16);
|
||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape (int w, int h)
|
static void reshape (int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
@@ -88,7 +88,7 @@ void reshape (int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -46,13 +46,13 @@
|
|||||||
#define drawOneLine(x1,y1,x2,y2) glBegin(GL_LINES); \
|
#define drawOneLine(x1,y1,x2,y2) glBegin(GL_LINES); \
|
||||||
glVertex2f ((x1),(y1)); glVertex2f ((x2),(y2)); glEnd();
|
glVertex2f ((x1),(y1)); glVertex2f ((x2),(y2)); glEnd();
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel (GL_FLAT);
|
glShadeModel (GL_FLAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ void display(void)
|
|||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape (int w, int h)
|
static void reshape (int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
@@ -113,7 +113,7 @@ void reshape (int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ static void drawLine (void)
|
|||||||
glEnd ();
|
glEnd ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
GLuint i;
|
GLuint i;
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ void display(void)
|
|||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -97,7 +97,7 @@ void reshape(int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
/* Initialize z-buffer, projection matrix, light source,
|
/* Initialize z-buffer, projection matrix, light source,
|
||||||
* and lighting model. Do not specify a material property here.
|
* and lighting model. Do not specify a material property here.
|
||||||
*/
|
*/
|
||||||
void myinit(void)
|
static void myinit(void)
|
||||||
{
|
{
|
||||||
GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 };
|
GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 };
|
||||||
GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
@@ -87,7 +87,7 @@ void myinit(void)
|
|||||||
* glTranslatef() is used to move spheres to their appropriate locations.
|
* glTranslatef() is used to move spheres to their appropriate locations.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
GLfloat no_mat[] = { 0.0, 0.0, 0.0, 1.0 };
|
GLfloat no_mat[] = { 0.0, 0.0, 0.0, 1.0 };
|
||||||
GLfloat mat_ambient[] = { 0.7, 0.7, 0.7, 1.0 };
|
GLfloat mat_ambient[] = { 0.7, 0.7, 0.7, 1.0 };
|
||||||
@@ -260,7 +260,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void myReshape(int w, int h)
|
static void myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ GLubyte mipmapImage4[4][4][3];
|
|||||||
GLubyte mipmapImage2[2][2][3];
|
GLubyte mipmapImage2[2][2][3];
|
||||||
GLubyte mipmapImage1[1][1][3];
|
GLubyte mipmapImage1[1][1][3];
|
||||||
|
|
||||||
void makeImages(void)
|
static void makeImages(void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ void makeImages(void)
|
|||||||
mipmapImage1[0][0][2] = 255;
|
mipmapImage1[0][0][2] = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
void myinit(void)
|
static void myinit(void)
|
||||||
{
|
{
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
glDepthFunc(GL_LESS);
|
glDepthFunc(GL_LESS);
|
||||||
@@ -128,7 +128,7 @@ void myinit(void)
|
|||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
@@ -140,7 +140,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void myReshape(int w, int h)
|
static void myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
|||||||
@@ -42,13 +42,13 @@
|
|||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel (GL_FLAT);
|
glShadeModel (GL_FLAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw_triangle(void)
|
static void draw_triangle(void)
|
||||||
{
|
{
|
||||||
glBegin (GL_LINE_LOOP);
|
glBegin (GL_LINE_LOOP);
|
||||||
glVertex2f(0.0, 25.0);
|
glVertex2f(0.0, 25.0);
|
||||||
@@ -57,7 +57,7 @@ void draw_triangle(void)
|
|||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear (GL_COLOR_BUFFER_BIT);
|
glClear (GL_COLOR_BUFFER_BIT);
|
||||||
glColor3f (1.0, 1.0, 1.0);
|
glColor3f (1.0, 1.0, 1.0);
|
||||||
@@ -86,7 +86,7 @@ void display(void)
|
|||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape (int w, int h)
|
static void reshape (int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
@@ -101,7 +101,7 @@ void reshape (int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ static int spin = 0;
|
|||||||
/* Initialize material property, light source, lighting model,
|
/* Initialize material property, light source, lighting model,
|
||||||
* and depth buffer.
|
* and depth buffer.
|
||||||
*/
|
*/
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel (GL_SMOOTH);
|
glShadeModel (GL_SMOOTH);
|
||||||
@@ -72,7 +72,7 @@ void init(void)
|
|||||||
* light at a new position in world coordinates. The cube
|
* light at a new position in world coordinates. The cube
|
||||||
* represents the position of the light.
|
* represents the position of the light.
|
||||||
*/
|
*/
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
GLfloat position[] = { 0.0, 0.0, 1.5, 1.0 };
|
GLfloat position[] = { 0.0, 0.0, 1.5, 1.0 };
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ void display(void)
|
|||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape (int w, int h)
|
static void reshape (int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
@@ -107,7 +107,7 @@ void reshape (int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED2 */
|
/* ARGSUSED2 */
|
||||||
void mouse(int button, int state, int x, int y)
|
static void mouse(int button, int state, int x, int y)
|
||||||
{
|
{
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case GLUT_LEFT_BUTTON:
|
case GLUT_LEFT_BUTTON:
|
||||||
@@ -122,7 +122,7 @@ void mouse(int button, int state, int x, int y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ GLUnurbsObj *theNurb;
|
|||||||
/* Initialize material property, light source, lighting model,
|
/* Initialize material property, light source, lighting model,
|
||||||
* and depth buffer.
|
* and depth buffer.
|
||||||
*/
|
*/
|
||||||
void myinit(void)
|
static void myinit(void)
|
||||||
{
|
{
|
||||||
GLfloat mat_ambient[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat mat_ambient[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
GLfloat mat_diffuse[] = { 1.0, 0.2, 1.0, 1.0 };
|
GLfloat mat_diffuse[] = { 1.0, 0.2, 1.0, 1.0 };
|
||||||
@@ -122,7 +122,7 @@ void myinit(void)
|
|||||||
gluNurbsProperty(theNurb, GLU_DISPLAY_MODE, GLU_FILL);
|
gluNurbsProperty(theNurb, GLU_DISPLAY_MODE, GLU_FILL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void myReshape(int w, int h)
|
static void myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
|
|
||||||
void
|
static void
|
||||||
myinit(void)
|
myinit(void)
|
||||||
{
|
{
|
||||||
glClearColor(0.0, 0.0, 0.0, 0.0);
|
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||||
@@ -65,7 +65,7 @@ myinit(void)
|
|||||||
* each rectangle is given the same name. Note that
|
* each rectangle is given the same name. Note that
|
||||||
* each rectangle is drawn with a different z value.
|
* each rectangle is drawn with a different z value.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
drawRects(GLenum mode)
|
drawRects(GLenum mode)
|
||||||
{
|
{
|
||||||
if (mode == GL_SELECT)
|
if (mode == GL_SELECT)
|
||||||
@@ -100,7 +100,7 @@ drawRects(GLenum mode)
|
|||||||
/* processHits() prints out the contents of the
|
/* processHits() prints out the contents of the
|
||||||
* selection array.
|
* selection array.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
processHits(GLint hits, GLuint buffer[])
|
processHits(GLint hits, GLuint buffer[])
|
||||||
{
|
{
|
||||||
GLint i;
|
GLint i;
|
||||||
@@ -131,7 +131,7 @@ processHits(GLint hits, GLuint buffer[])
|
|||||||
*/
|
*/
|
||||||
#define BUFSIZE 512
|
#define BUFSIZE 512
|
||||||
|
|
||||||
void
|
static void
|
||||||
pickRects(int button, int state, int x, int y)
|
pickRects(int button, int state, int x, int y)
|
||||||
{
|
{
|
||||||
GLuint selectBuf[BUFSIZE];
|
GLuint selectBuf[BUFSIZE];
|
||||||
@@ -164,7 +164,7 @@ pickRects(int button, int state, int x, int y)
|
|||||||
processHits(hits, selectBuf);
|
processHits(hits, selectBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
display(void)
|
display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
@@ -172,7 +172,7 @@ display(void)
|
|||||||
glutSwapBuffers();
|
glutSwapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
myReshape(int w, int h)
|
myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
int board[3][3]; /* amount of color for each square */
|
int board[3][3]; /* amount of color for each square */
|
||||||
|
|
||||||
/* Clear color value for every square on the board */
|
/* Clear color value for every square on the board */
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
@@ -64,7 +64,7 @@ void init(void)
|
|||||||
* square is determined by its position on the grid, and
|
* square is determined by its position on the grid, and
|
||||||
* the value in the board[][] array.
|
* the value in the board[][] array.
|
||||||
*/
|
*/
|
||||||
void drawSquares(GLenum mode)
|
static void drawSquares(GLenum mode)
|
||||||
{
|
{
|
||||||
GLuint i, j;
|
GLuint i, j;
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
@@ -85,7 +85,7 @@ void drawSquares(GLenum mode)
|
|||||||
/* processHits prints out the contents of the
|
/* processHits prints out the contents of the
|
||||||
* selection array.
|
* selection array.
|
||||||
*/
|
*/
|
||||||
void processHits (GLint hits, GLuint buffer[])
|
static void processHits (GLint hits, GLuint buffer[])
|
||||||
{
|
{
|
||||||
GLint i;
|
GLint i;
|
||||||
GLuint j, ii = 0, jj = 0, names, *ptr;
|
GLuint j, ii = 0, jj = 0, names, *ptr;
|
||||||
@@ -117,7 +117,7 @@ void processHits (GLint hits, GLuint buffer[])
|
|||||||
*/
|
*/
|
||||||
#define BUFSIZE 512
|
#define BUFSIZE 512
|
||||||
|
|
||||||
void pickSquares(int button, int state, int x, int y)
|
static void pickSquares(int button, int state, int x, int y)
|
||||||
{
|
{
|
||||||
GLuint selectBuf[BUFSIZE];
|
GLuint selectBuf[BUFSIZE];
|
||||||
GLint hits;
|
GLint hits;
|
||||||
@@ -152,14 +152,14 @@ void pickSquares(int button, int state, int x, int y)
|
|||||||
glutPostRedisplay();
|
glutPostRedisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
drawSquares (GL_RENDER);
|
drawSquares (GL_RENDER);
|
||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -170,7 +170,7 @@ void reshape(int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
/* Initialize material property, light source, and lighting model.
|
/* Initialize material property, light source, and lighting model.
|
||||||
*/
|
*/
|
||||||
void myinit(void)
|
static void myinit(void)
|
||||||
{
|
{
|
||||||
GLfloat mat_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
|
GLfloat mat_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
|
||||||
/* mat_specular and mat_shininess are NOT default values */
|
/* mat_specular and mat_shininess are NOT default values */
|
||||||
@@ -75,7 +75,7 @@ void myinit(void)
|
|||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawPlane(void)
|
static void drawPlane(void)
|
||||||
{
|
{
|
||||||
glBegin (GL_QUADS);
|
glBegin (GL_QUADS);
|
||||||
glNormal3f (0.0, 0.0, 1.0);
|
glNormal3f (0.0, 0.0, 1.0);
|
||||||
@@ -104,7 +104,7 @@ void drawPlane(void)
|
|||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
void display (void)
|
static void display (void)
|
||||||
{
|
{
|
||||||
GLfloat infinite_light[] = { 1.0, 1.0, 1.0, 0.0 };
|
GLfloat infinite_light[] = { 1.0, 1.0, 1.0, 0.0 };
|
||||||
GLfloat local_light[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat local_light[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
@@ -125,7 +125,7 @@ void display (void)
|
|||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void myReshape(int w, int h)
|
static void myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, w, h);
|
glViewport (0, 0, w, h);
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
|
|||||||
@@ -47,13 +47,13 @@
|
|||||||
|
|
||||||
static int year = 0, day = 0;
|
static int year = 0, day = 0;
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel (GL_FLAT);
|
glShadeModel (GL_FLAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear (GL_COLOR_BUFFER_BIT);
|
glClear (GL_COLOR_BUFFER_BIT);
|
||||||
glColor3f (1.0, 1.0, 1.0);
|
glColor3f (1.0, 1.0, 1.0);
|
||||||
@@ -68,7 +68,7 @@ void display(void)
|
|||||||
glutSwapBuffers();
|
glutSwapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape (int w, int h)
|
static void reshape (int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
@@ -80,7 +80,7 @@ void reshape (int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard (unsigned char key, int x, int y)
|
static void keyboard (unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'd':
|
case 'd':
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ GLboolean doubleBuffer;
|
|||||||
/* display() draws two spheres, one with a gray, diffuse material,
|
/* display() draws two spheres, one with a gray, diffuse material,
|
||||||
* the other sphere with a magenta material with a specular highlight.
|
* the other sphere with a magenta material with a specular highlight.
|
||||||
*/
|
*/
|
||||||
void display (void)
|
static void display (void)
|
||||||
{
|
{
|
||||||
GLfloat gray[] = { 0.8, 0.8, 0.8, 1.0 };
|
GLfloat gray[] = { 0.8, 0.8, 0.8, 1.0 };
|
||||||
GLfloat black[] = { 0.0, 0.0, 0.0, 1.0 };
|
GLfloat black[] = { 0.0, 0.0, 0.0, 1.0 };
|
||||||
@@ -108,7 +108,7 @@ void display (void)
|
|||||||
* create display list with sphere
|
* create display list with sphere
|
||||||
* initialize lighting and depth buffer
|
* initialize lighting and depth buffer
|
||||||
*/
|
*/
|
||||||
void gfxinit (void)
|
static void gfxinit (void)
|
||||||
{
|
{
|
||||||
GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
|
GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
|
||||||
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
@@ -134,7 +134,7 @@ void gfxinit (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* call when window is resized */
|
/* call when window is resized */
|
||||||
void reshape(int width, int height)
|
static void reshape(int width, int height)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, width, height);
|
glViewport (0, 0, width, height);
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
@@ -176,7 +176,7 @@ static void Benchmark( float xdiff, float ydiff )
|
|||||||
|
|
||||||
/* call when mouse button is pressed */
|
/* call when mouse button is pressed */
|
||||||
/* ARGSUSED2 */
|
/* ARGSUSED2 */
|
||||||
void mouse(int button, int state, int x, int y) {
|
static void mouse(int button, int state, int x, int y) {
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case GLUT_LEFT_BUTTON:
|
case GLUT_LEFT_BUTTON:
|
||||||
switch (state) {
|
switch (state) {
|
||||||
@@ -213,7 +213,7 @@ void mouse(int button, int state, int x, int y) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard (unsigned char key, int x, int y)
|
static void keyboard (unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 't':
|
case 't':
|
||||||
@@ -268,20 +268,7 @@ void keyboard (unsigned char key, int x, int y)
|
|||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static GLenum Args(int argc, char **argv)
|
||||||
key(unsigned char k, int x, int y)
|
|
||||||
{
|
|
||||||
switch (k) {
|
|
||||||
case 27: /* Escape */
|
|
||||||
exit(0);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
glutPostRedisplay();
|
|
||||||
}
|
|
||||||
|
|
||||||
GLenum Args(int argc, char **argv)
|
|
||||||
{
|
{
|
||||||
GLint i;
|
GLint i;
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
GLubyte fly[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
GLubyte fly[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x03, 0x80, 0x01, 0xC0, 0x06, 0xC0, 0x03, 0x60, 0x04, 0x60, 0x06, 0x20,
|
0x03, 0x80, 0x01, 0xC0, 0x06, 0xC0, 0x03, 0x60, 0x04, 0x60, 0x06, 0x20,
|
||||||
@@ -89,7 +89,7 @@ void display(void)
|
|||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void myinit (void)
|
static void myinit (void)
|
||||||
{
|
{
|
||||||
/* clear background to black */
|
/* clear background to black */
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
GLuint startList;
|
GLuint startList;
|
||||||
|
|
||||||
void CALLBACK errorCallback(GLenum errorCode)
|
static void CALLBACK errorCallback(GLenum errorCode)
|
||||||
{
|
{
|
||||||
const GLubyte *estring;
|
const GLubyte *estring;
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ void CALLBACK errorCallback(GLenum errorCode)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
GLUquadricObj *qobj;
|
GLUquadricObj *qobj;
|
||||||
GLfloat mat_ambient[] = { 0.5, 0.5, 0.5, 1.0 };
|
GLfloat mat_ambient[] = { 0.5, 0.5, 0.5, 1.0 };
|
||||||
@@ -120,7 +120,7 @@ void init(void)
|
|||||||
gluDeleteQuadric(qobj);
|
gluDeleteQuadric(qobj);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
@@ -150,7 +150,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape (int w, int h)
|
static void reshape (int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -166,7 +166,7 @@ void reshape (int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -47,13 +47,13 @@
|
|||||||
|
|
||||||
static int shoulder = 0, elbow = 0;
|
static int shoulder = 0, elbow = 0;
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel (GL_FLAT);
|
glShadeModel (GL_FLAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear (GL_COLOR_BUFFER_BIT);
|
glClear (GL_COLOR_BUFFER_BIT);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
@@ -77,7 +77,7 @@ void display(void)
|
|||||||
glutSwapBuffers();
|
glutSwapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape (int w, int h)
|
static void reshape (int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
@@ -89,7 +89,7 @@ void reshape (int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard (unsigned char key, int x, int y)
|
static void keyboard (unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 's':
|
case 's':
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
/* Initialize material property and light source.
|
/* Initialize material property and light source.
|
||||||
*/
|
*/
|
||||||
void myinit(void)
|
static void myinit(void)
|
||||||
{
|
{
|
||||||
GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
|
GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
|
||||||
GLfloat light_diffuse[] = { 1.0, 0.0, 1.0, 1.0 };
|
GLfloat light_diffuse[] = { 1.0, 0.0, 1.0, 1.0 };
|
||||||
@@ -68,7 +68,7 @@ void myinit(void)
|
|||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glPushMatrix ();
|
glPushMatrix ();
|
||||||
@@ -95,7 +95,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void myReshape(int w, int h)
|
static void myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
/* Initialize material property and light source.
|
/* Initialize material property and light source.
|
||||||
*/
|
*/
|
||||||
void myinit (void)
|
static void myinit (void)
|
||||||
{
|
{
|
||||||
GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
|
GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
|
||||||
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
@@ -67,7 +67,7 @@ void myinit (void)
|
|||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display (void)
|
static void display (void)
|
||||||
{
|
{
|
||||||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ void display (void)
|
|||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void myReshape(int w, int h)
|
static void myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, w, h);
|
glViewport (0, 0, w, h);
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
/* Initialize light source and lighting.
|
/* Initialize light source and lighting.
|
||||||
*/
|
*/
|
||||||
void myinit(void)
|
static void myinit(void)
|
||||||
{
|
{
|
||||||
GLfloat light_ambient[] = { 0.0, 0.0, 1.0, 1.0 };
|
GLfloat light_ambient[] = { 0.0, 0.0, 1.0, 1.0 };
|
||||||
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
@@ -66,7 +66,7 @@ void myinit(void)
|
|||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void myReshape(int w, int h)
|
static void myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
/* Initialize light source and shading model (GL_FLAT).
|
/* Initialize light source and shading model (GL_FLAT).
|
||||||
*/
|
*/
|
||||||
void myinit(void)
|
static void myinit(void)
|
||||||
{
|
{
|
||||||
GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
|
GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
|
||||||
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
@@ -66,7 +66,7 @@ void myinit(void)
|
|||||||
glShadeModel (GL_FLAT);
|
glShadeModel (GL_FLAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void myReshape(int w, int h)
|
static void myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
/* draw a triangle with vertices at (x1, y1), (x2, y2)
|
/* draw a triangle with vertices at (x1, y1), (x2, y2)
|
||||||
* and (x3, y3) at z units away from the origin.
|
* and (x3, y3) at z units away from the origin.
|
||||||
*/
|
*/
|
||||||
void drawTriangle (GLfloat x1, GLfloat y1, GLfloat x2,
|
static void drawTriangle (GLfloat x1, GLfloat y1, GLfloat x2,
|
||||||
GLfloat y2, GLfloat x3, GLfloat y3, GLfloat z)
|
GLfloat y2, GLfloat x3, GLfloat y3, GLfloat z)
|
||||||
{
|
{
|
||||||
glBegin (GL_TRIANGLES);
|
glBegin (GL_TRIANGLES);
|
||||||
@@ -68,8 +68,8 @@ void drawTriangle (GLfloat x1, GLfloat y1, GLfloat x2,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* draw a rectangular box with these outer x, y, and z values */
|
/* draw a rectangular box with these outer x, y, and z values */
|
||||||
void drawViewVolume (GLfloat x1, GLfloat x2, GLfloat y1,
|
static void drawViewVolume (GLfloat x1, GLfloat x2, GLfloat y1,
|
||||||
GLfloat y2, GLfloat z1, GLfloat z2)
|
GLfloat y2, GLfloat z1, GLfloat z2)
|
||||||
{
|
{
|
||||||
glColor3f (1.0, 1.0, 1.0);
|
glColor3f (1.0, 1.0, 1.0);
|
||||||
glBegin (GL_LINE_LOOP);
|
glBegin (GL_LINE_LOOP);
|
||||||
@@ -101,7 +101,7 @@ void drawViewVolume (GLfloat x1, GLfloat x2, GLfloat y1,
|
|||||||
/* drawScene draws 4 triangles and a wire frame
|
/* drawScene draws 4 triangles and a wire frame
|
||||||
* which represents the viewing volume.
|
* which represents the viewing volume.
|
||||||
*/
|
*/
|
||||||
void drawScene (void)
|
static void drawScene (void)
|
||||||
{
|
{
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
glLoadIdentity ();
|
glLoadIdentity ();
|
||||||
@@ -122,7 +122,7 @@ void drawScene (void)
|
|||||||
|
|
||||||
/* processHits prints out the contents of the selection array
|
/* processHits prints out the contents of the selection array
|
||||||
*/
|
*/
|
||||||
void processHits (GLint hits, GLuint buffer[])
|
static void processHits (GLint hits, GLuint buffer[])
|
||||||
{
|
{
|
||||||
GLint i;
|
GLint i;
|
||||||
GLuint j, names, *ptr;
|
GLuint j, names, *ptr;
|
||||||
@@ -150,7 +150,7 @@ void processHits (GLint hits, GLuint buffer[])
|
|||||||
*/
|
*/
|
||||||
#define BUFSIZE 512
|
#define BUFSIZE 512
|
||||||
|
|
||||||
void selectObjects(void)
|
static void selectObjects(void)
|
||||||
{
|
{
|
||||||
GLuint selectBuf[BUFSIZE];
|
GLuint selectBuf[BUFSIZE];
|
||||||
GLint hits;
|
GLint hits;
|
||||||
@@ -181,13 +181,13 @@ void selectObjects(void)
|
|||||||
processHits (hits, selectBuf);
|
processHits (hits, selectBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void init (void)
|
static void init (void)
|
||||||
{
|
{
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
glShadeModel(GL_FLAT);
|
glShadeModel(GL_FLAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
@@ -197,7 +197,7 @@ void display(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -43,13 +43,13 @@
|
|||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel (GL_SMOOTH);
|
glShadeModel (GL_SMOOTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
void triangle(void)
|
static void triangle(void)
|
||||||
{
|
{
|
||||||
glBegin (GL_TRIANGLES);
|
glBegin (GL_TRIANGLES);
|
||||||
glColor3f (1.0, 0.0, 0.0);
|
glColor3f (1.0, 0.0, 0.0);
|
||||||
@@ -61,14 +61,14 @@ void triangle(void)
|
|||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear (GL_COLOR_BUFFER_BIT);
|
glClear (GL_COLOR_BUFFER_BIT);
|
||||||
triangle ();
|
triangle ();
|
||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape (int w, int h)
|
static void reshape (int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
@@ -81,7 +81,7 @@ void reshape (int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
#define YELLOWMAT 1
|
#define YELLOWMAT 1
|
||||||
#define BLUEMAT 2
|
#define BLUEMAT 2
|
||||||
|
|
||||||
void myinit (void)
|
static void myinit (void)
|
||||||
{
|
{
|
||||||
GLfloat yellow_diffuse[] = { 0.7, 0.7, 0.0, 1.0 };
|
GLfloat yellow_diffuse[] = { 0.7, 0.7, 0.0, 1.0 };
|
||||||
GLfloat yellow_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat yellow_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
@@ -101,7 +101,7 @@ void myinit (void)
|
|||||||
/* Draw a sphere in a diamond-shaped section in the
|
/* Draw a sphere in a diamond-shaped section in the
|
||||||
* middle of a window with 2 tori.
|
* middle of a window with 2 tori.
|
||||||
*/
|
*/
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ void display(void)
|
|||||||
/* Whenever the window is reshaped, redefine the
|
/* Whenever the window is reshaped, redefine the
|
||||||
* coordinate system and redraw the stencil area.
|
* coordinate system and redraw the stencil area.
|
||||||
*/
|
*/
|
||||||
void myReshape(int w, int h)
|
static void myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ CP Sdata[] = {
|
|||||||
/* drawLetter() interprets the instructions from the array
|
/* drawLetter() interprets the instructions from the array
|
||||||
* for that letter and renders the letter with line segments.
|
* for that letter and renders the letter with line segments.
|
||||||
*/
|
*/
|
||||||
void drawLetter(CP *l)
|
static void drawLetter(CP *l)
|
||||||
{
|
{
|
||||||
glBegin(GL_LINE_STRIP);
|
glBegin(GL_LINE_STRIP);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@@ -111,7 +111,7 @@ void drawLetter(CP *l)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Create a display list for each of 6 characters */
|
/* Create a display list for each of 6 characters */
|
||||||
void myinit (void)
|
static void myinit (void)
|
||||||
{
|
{
|
||||||
GLuint base;
|
GLuint base;
|
||||||
|
|
||||||
@@ -130,13 +130,13 @@ void myinit (void)
|
|||||||
char *test1 = "A SPARE SERAPE APPEARS AS";
|
char *test1 = "A SPARE SERAPE APPEARS AS";
|
||||||
char *test2 = "APES PREPARE RARE PEPPERS";
|
char *test2 = "APES PREPARE RARE PEPPERS";
|
||||||
|
|
||||||
void printStrokedString(char *s)
|
static void printStrokedString(char *s)
|
||||||
{
|
{
|
||||||
GLsizei len = (GLsizei) strlen(s);
|
GLsizei len = (GLsizei) strlen(s);
|
||||||
glCallLists(len, GL_BYTE, (GLbyte *)s);
|
glCallLists(len, GL_BYTE, (GLbyte *)s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
glColor3f(1.0, 1.0, 1.0);
|
glColor3f(1.0, 1.0, 1.0);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ GLUnurbsObj *theNurb;
|
|||||||
* Initializes the control points of the surface to a small hill.
|
* Initializes the control points of the surface to a small hill.
|
||||||
* The control points range from -3 to +3 in x, y, and z
|
* The control points range from -3 to +3 in x, y, and z
|
||||||
*/
|
*/
|
||||||
void init_surface(void)
|
static void init_surface(void)
|
||||||
{
|
{
|
||||||
int u, v;
|
int u, v;
|
||||||
for (u = 0; u < 4; u++) {
|
for (u = 0; u < 4; u++) {
|
||||||
@@ -71,7 +71,7 @@ void init_surface(void)
|
|||||||
|
|
||||||
/* Initialize material property and depth buffer.
|
/* Initialize material property and depth buffer.
|
||||||
*/
|
*/
|
||||||
void myinit(void)
|
static void myinit(void)
|
||||||
{
|
{
|
||||||
GLfloat mat_diffuse[] = { 0.7, 0.7, 0.7, 1.0 };
|
GLfloat mat_diffuse[] = { 0.7, 0.7, 0.7, 1.0 };
|
||||||
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
@@ -100,7 +100,7 @@ void myinit(void)
|
|||||||
glTranslatef (0.0, 0.0, -5.0);
|
glTranslatef (0.0, 0.0, -5.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
GLfloat knots[8] = {0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0};
|
GLfloat knots[8] = {0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0};
|
||||||
int i, j;
|
int i, j;
|
||||||
@@ -140,7 +140,7 @@ void display(void)
|
|||||||
glutSwapBuffers();
|
glutSwapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -150,7 +150,7 @@ void reshape(int w, int h)
|
|||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
menu(int value)
|
menu(int value)
|
||||||
{
|
{
|
||||||
switch (value) {
|
switch (value) {
|
||||||
@@ -171,7 +171,7 @@ menu(int value)
|
|||||||
int down = 0, lastx;
|
int down = 0, lastx;
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void
|
static void
|
||||||
motion(int x, int y)
|
motion(int x, int y)
|
||||||
{
|
{
|
||||||
if (down) {
|
if (down) {
|
||||||
@@ -182,7 +182,7 @@ motion(int x, int y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED3 */
|
/* ARGSUSED3 */
|
||||||
void
|
static void
|
||||||
mouse(int button, int state, int x, int y)
|
mouse(int button, int state, int x, int y)
|
||||||
{
|
{
|
||||||
if (button == GLUT_LEFT_BUTTON) {
|
if (button == GLUT_LEFT_BUTTON) {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
/* Initialize light source and lighting model.
|
/* Initialize light source and lighting model.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
myinit(void)
|
myinit(void)
|
||||||
{
|
{
|
||||||
GLfloat light_ambient[] =
|
GLfloat light_ambient[] =
|
||||||
@@ -78,7 +78,7 @@ myinit(void)
|
|||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
display(void)
|
display(void)
|
||||||
{
|
{
|
||||||
GLfloat low_ambient[] =
|
GLfloat low_ambient[] =
|
||||||
@@ -114,7 +114,7 @@ display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
myReshape(int w, int h)
|
myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
* Initialize depth buffer, projection matrix, light source, and lighting
|
* Initialize depth buffer, projection matrix, light source, and lighting
|
||||||
* model. Do not specify a material property here.
|
* model. Do not specify a material property here.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
myinit(void)
|
myinit(void)
|
||||||
{
|
{
|
||||||
GLfloat ambient[] =
|
GLfloat ambient[] =
|
||||||
@@ -83,7 +83,7 @@ myinit(void)
|
|||||||
* Move object into position. Use 3rd through 12th parameters to specify the
|
* Move object into position. Use 3rd through 12th parameters to specify the
|
||||||
* material property. Draw a teapot.
|
* material property. Draw a teapot.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
renderTeapot(GLfloat x, GLfloat y,
|
renderTeapot(GLfloat x, GLfloat y,
|
||||||
GLfloat ambr, GLfloat ambg, GLfloat ambb,
|
GLfloat ambr, GLfloat ambg, GLfloat ambb,
|
||||||
GLfloat difr, GLfloat difg, GLfloat difb,
|
GLfloat difr, GLfloat difg, GLfloat difb,
|
||||||
@@ -117,7 +117,7 @@ renderTeapot(GLfloat x, GLfloat y,
|
|||||||
* 3rd column: black, cyan, green, red, white, yellow plastic
|
* 3rd column: black, cyan, green, red, white, yellow plastic
|
||||||
* 4th column: black, cyan, green, red, white, yellow rubber
|
* 4th column: black, cyan, green, red, white, yellow rubber
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
display(void)
|
display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
@@ -173,7 +173,7 @@ display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
myReshape(int w, int h)
|
myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
GLuint startList;
|
GLuint startList;
|
||||||
|
|
||||||
void display (void) {
|
static void display (void) {
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
glColor3f(1.0, 1.0, 1.0);
|
glColor3f(1.0, 1.0, 1.0);
|
||||||
glCallList(startList);
|
glCallList(startList);
|
||||||
@@ -69,12 +69,12 @@ void display (void) {
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CALLBACK beginCallback(GLenum which)
|
static void CALLBACK beginCallback(GLenum which)
|
||||||
{
|
{
|
||||||
glBegin(which);
|
glBegin(which);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CALLBACK errorCallback(GLenum errorCode)
|
static void CALLBACK errorCallback(GLenum errorCode)
|
||||||
{
|
{
|
||||||
const GLubyte *estring;
|
const GLubyte *estring;
|
||||||
|
|
||||||
@@ -83,12 +83,12 @@ void CALLBACK errorCallback(GLenum errorCode)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CALLBACK endCallback(void)
|
static void CALLBACK endCallback(void)
|
||||||
{
|
{
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CALLBACK vertexCallback(GLvoid *vertex)
|
static void CALLBACK vertexCallback(GLvoid *vertex)
|
||||||
{
|
{
|
||||||
const GLdouble *pointer;
|
const GLdouble *pointer;
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ void CALLBACK vertexCallback(GLvoid *vertex)
|
|||||||
* but weight[4] may be used to average color, normal, or texture
|
* but weight[4] may be used to average color, normal, or texture
|
||||||
* coordinate data. In this program, color is weighted.
|
* coordinate data. In this program, color is weighted.
|
||||||
*/
|
*/
|
||||||
void CALLBACK combineCallback(GLdouble coords[3],
|
static void CALLBACK combineCallback(GLdouble coords[3],
|
||||||
GLdouble *vertex_data[4],
|
GLdouble *vertex_data[4],
|
||||||
GLfloat weight[4], GLdouble **dataOut )
|
GLfloat weight[4], GLdouble **dataOut )
|
||||||
{
|
{
|
||||||
@@ -122,7 +122,7 @@ void CALLBACK combineCallback(GLdouble coords[3],
|
|||||||
*dataOut = vertex;
|
*dataOut = vertex;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init (void)
|
static void init (void)
|
||||||
{
|
{
|
||||||
GLUtesselator *tobj;
|
GLUtesselator *tobj;
|
||||||
GLdouble rect[4][3] = {{50.0, 50.0, 0.0},
|
GLdouble rect[4][3] = {{50.0, 50.0, 0.0},
|
||||||
@@ -199,7 +199,7 @@ void init (void)
|
|||||||
gluDeleteTess(tobj);
|
gluDeleteTess(tobj);
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape (int w, int h)
|
static void reshape (int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -208,7 +208,7 @@ void reshape (int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ GLuint list;
|
|||||||
/* Make four display lists,
|
/* Make four display lists,
|
||||||
* each with a different tessellated object.
|
* each with a different tessellated object.
|
||||||
*/
|
*/
|
||||||
void makeNewLists (void) {
|
static void makeNewLists (void) {
|
||||||
int i;
|
int i;
|
||||||
static GLdouble rects[12][3] =
|
static GLdouble rects[12][3] =
|
||||||
{{ 50.0, 50.0, 0.0}, {300.0, 50.0, 0.0},
|
{{ 50.0, 50.0, 0.0}, {300.0, 50.0, 0.0},
|
||||||
@@ -153,7 +153,7 @@ void makeNewLists (void) {
|
|||||||
glEndList();
|
glEndList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void display (void) {
|
static void display (void) {
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
glColor3f(1.0, 1.0, 1.0);
|
glColor3f(1.0, 1.0, 1.0);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
@@ -168,12 +168,12 @@ void display (void) {
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CALLBACK beginCallback(GLenum which)
|
static void CALLBACK beginCallback(GLenum which)
|
||||||
{
|
{
|
||||||
glBegin(which);
|
glBegin(which);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CALLBACK errorCallback(GLenum errorCode)
|
static void CALLBACK errorCallback(GLenum errorCode)
|
||||||
{
|
{
|
||||||
const GLubyte *estring;
|
const GLubyte *estring;
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ void CALLBACK errorCallback(GLenum errorCode)
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CALLBACK endCallback(void)
|
static void CALLBACK endCallback(void)
|
||||||
{
|
{
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
@@ -193,7 +193,7 @@ void CALLBACK endCallback(void)
|
|||||||
* coordinate data.
|
* coordinate data.
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
void CALLBACK combineCallback(GLdouble coords[3], GLdouble *data[4],
|
static void CALLBACK combineCallback(GLdouble coords[3], GLdouble *data[4],
|
||||||
GLfloat weight[4], GLdouble **dataOut )
|
GLfloat weight[4], GLdouble **dataOut )
|
||||||
{
|
{
|
||||||
GLdouble *vertex;
|
GLdouble *vertex;
|
||||||
@@ -205,7 +205,7 @@ void CALLBACK combineCallback(GLdouble coords[3], GLdouble *data[4],
|
|||||||
*dataOut = vertex;
|
*dataOut = vertex;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor(0.0, 0.0, 0.0, 0.0);
|
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel(GL_FLAT);
|
glShadeModel(GL_FLAT);
|
||||||
@@ -226,7 +226,7 @@ void init(void)
|
|||||||
makeNewLists();
|
makeNewLists();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -240,7 +240,7 @@ void reshape(int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'w':
|
case 'w':
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ static GLubyte otherImage[checkImageHeight][checkImageWidth][4];
|
|||||||
|
|
||||||
static GLuint texName[2];
|
static GLuint texName[2];
|
||||||
|
|
||||||
void makeCheckImages(void)
|
static void makeCheckImages(void)
|
||||||
{
|
{
|
||||||
int i, j, c;
|
int i, j, c;
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ void makeCheckImages(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel(GL_FLAT);
|
glShadeModel(GL_FLAT);
|
||||||
@@ -105,7 +105,7 @@ void init(void)
|
|||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glBindTexture(GL_TEXTURE_2D, texName[0]);
|
glBindTexture(GL_TEXTURE_2D, texName[0]);
|
||||||
@@ -125,7 +125,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -137,7 +137,7 @@ void reshape(int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ GLubyte stripeImage[4*stripeImageWidth];
|
|||||||
static GLuint texName;
|
static GLuint texName;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void makeStripeImage(void)
|
static void makeStripeImage(void)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ static GLfloat *currentCoeff;
|
|||||||
static GLenum currentPlane;
|
static GLenum currentPlane;
|
||||||
static GLint currentGenMode;
|
static GLint currentGenMode;
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
@@ -122,7 +122,7 @@ void init(void)
|
|||||||
glMaterialf (GL_FRONT, GL_SHININESS, 64.0);
|
glMaterialf (GL_FRONT, GL_SHININESS, 64.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -152,7 +152,7 @@ void reshape(int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard (unsigned char key, int x, int y)
|
static void keyboard (unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'e':
|
case 'e':
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
#define GL_TEXTURE_INTERNAL_FORMAT GL_TEXTURE_COMPONENTS
|
#define GL_TEXTURE_INTERNAL_FORMAT GL_TEXTURE_COMPONENTS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
GLint proxyComponents;
|
GLint proxyComponents;
|
||||||
|
|
||||||
@@ -84,12 +84,12 @@ void init(void)
|
|||||||
putchar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape (int w, int h)
|
static void reshape (int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ static GLubyte subImage[subImageHeight][subImageWidth][4];
|
|||||||
|
|
||||||
static GLuint texName;
|
static GLuint texName;
|
||||||
|
|
||||||
void makeCheckImages(void)
|
static void makeCheckImages(void)
|
||||||
{
|
{
|
||||||
int i, j, c;
|
int i, j, c;
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ void makeCheckImages(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel(GL_FLAT);
|
glShadeModel(GL_FLAT);
|
||||||
@@ -102,7 +102,7 @@ void init(void)
|
|||||||
0, GL_RGBA, GL_UNSIGNED_BYTE, checkImage);
|
0, GL_RGBA, GL_UNSIGNED_BYTE, checkImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
@@ -123,7 +123,7 @@ void display(void)
|
|||||||
glDisable(GL_TEXTURE_2D);
|
glDisable(GL_TEXTURE_2D);
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -135,7 +135,7 @@ void reshape(int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard (unsigned char key, int x, int y)
|
static void keyboard (unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 's':
|
case 's':
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ GLfloat ctrlpoints[4][4][3] = {
|
|||||||
GLfloat texpts[2][2][2] = {{{0.0, 0.0}, {0.0, 1.0}},
|
GLfloat texpts[2][2][2] = {{{0.0, 0.0}, {0.0, 1.0}},
|
||||||
{{1.0, 0.0}, {1.0, 1.0}}};
|
{{1.0, 0.0}, {1.0, 1.0}}};
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glColor3f(1.0, 1.0, 1.0);
|
glColor3f(1.0, 1.0, 1.0);
|
||||||
@@ -72,7 +72,7 @@ void display(void)
|
|||||||
#define imageHeight 64
|
#define imageHeight 64
|
||||||
GLubyte image[3*imageWidth*imageHeight];
|
GLubyte image[3*imageWidth*imageHeight];
|
||||||
|
|
||||||
void makeImage(void)
|
static void makeImage(void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
float ti, tj;
|
float ti, tj;
|
||||||
@@ -89,7 +89,7 @@ void makeImage(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void myinit(void)
|
static void myinit(void)
|
||||||
{
|
{
|
||||||
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4,
|
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4,
|
||||||
0, 1, 12, 4, &ctrlpoints[0][0][0]);
|
0, 1, 12, 4, &ctrlpoints[0][0][0]);
|
||||||
@@ -112,7 +112,7 @@ void myinit(void)
|
|||||||
glShadeModel (GL_FLAT);
|
glShadeModel (GL_FLAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void myReshape(int w, int h)
|
static void myReshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, w, h);
|
glViewport(0, 0, w, h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ static void init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Clear window and draw torus */
|
/* Clear window and draw torus */
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
glColor3f (1.0, 1.0, 1.0);
|
glColor3f (1.0, 1.0, 1.0);
|
||||||
@@ -98,7 +98,7 @@ void display(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Handle window resize */
|
/* Handle window resize */
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -112,7 +112,7 @@ void reshape(int w, int h)
|
|||||||
/* Rotate about x-axis when "x" typed; rotate about y-axis
|
/* Rotate about x-axis when "x" typed; rotate about y-axis
|
||||||
when "y" typed; "i" returns torus to original view */
|
when "y" typed; "i" returns torus to original view */
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'x':
|
case 'x':
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ GLUnurbsObj *theNurb;
|
|||||||
* Initializes the control points of the surface to a small hill.
|
* Initializes the control points of the surface to a small hill.
|
||||||
* The control points range from -3 to +3 in x, y, and z
|
* The control points range from -3 to +3 in x, y, and z
|
||||||
*/
|
*/
|
||||||
void init_surface(void)
|
static void init_surface(void)
|
||||||
{
|
{
|
||||||
int u, v;
|
int u, v;
|
||||||
for (u = 0; u < 4; u++) {
|
for (u = 0; u < 4; u++) {
|
||||||
@@ -75,7 +75,7 @@ void init_surface(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nurbsError(GLenum errorCode)
|
static void nurbsError(GLenum errorCode)
|
||||||
{
|
{
|
||||||
const GLubyte *estring;
|
const GLubyte *estring;
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ void nurbsError(GLenum errorCode)
|
|||||||
|
|
||||||
/* Initialize material property and depth buffer.
|
/* Initialize material property and depth buffer.
|
||||||
*/
|
*/
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
GLfloat mat_diffuse[] = { 0.7, 0.7, 0.7, 1.0 };
|
GLfloat mat_diffuse[] = { 0.7, 0.7, 0.7, 1.0 };
|
||||||
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
@@ -112,7 +112,7 @@ void init(void)
|
|||||||
(GLvoid (CALLBACK*) ()) nurbsError);
|
(GLvoid (CALLBACK*) ()) nurbsError);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
GLfloat knots[8] = {0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0};
|
GLfloat knots[8] = {0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0};
|
||||||
GLfloat edgePt[5][2] = /* counter clockwise */
|
GLfloat edgePt[5][2] = /* counter clockwise */
|
||||||
@@ -147,7 +147,7 @@ void display(void)
|
|||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -160,7 +160,7 @@ void reshape(int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -45,14 +45,14 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Change these values for a different transformation */
|
/* Change these values for a different transformation */
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -62,7 +62,7 @@ void reshape(int w, int h)
|
|||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
}
|
}
|
||||||
|
|
||||||
void mouse(int button, int state, int x, int y)
|
static void mouse(int button, int state, int x, int y)
|
||||||
{
|
{
|
||||||
GLint viewport[4];
|
GLint viewport[4];
|
||||||
GLdouble mvmatrix[16], projmatrix[16];
|
GLdouble mvmatrix[16], projmatrix[16];
|
||||||
@@ -98,7 +98,7 @@ void mouse(int button, int state, int x, int y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
int setupMethod = POINTER;
|
int setupMethod = POINTER;
|
||||||
int derefMethod = DRAWARRAY;
|
int derefMethod = DRAWARRAY;
|
||||||
|
|
||||||
void setupPointers(void)
|
static void setupPointers(void)
|
||||||
{
|
{
|
||||||
static GLint vertices[] = {25, 25,
|
static GLint vertices[] = {25, 25,
|
||||||
100, 325,
|
100, 325,
|
||||||
@@ -76,7 +76,7 @@ void setupPointers(void)
|
|||||||
glColorPointer (3, GL_FLOAT, 0, colors);
|
glColorPointer (3, GL_FLOAT, 0, colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupInterleave(void)
|
static void setupInterleave(void)
|
||||||
{
|
{
|
||||||
static GLfloat intertwined[] =
|
static GLfloat intertwined[] =
|
||||||
{1.0, 0.2, 1.0, 100.0, 100.0, 0.0,
|
{1.0, 0.2, 1.0, 100.0, 100.0, 0.0,
|
||||||
@@ -89,14 +89,14 @@ void setupInterleave(void)
|
|||||||
glInterleavedArrays (GL_C3F_V3F, 0, intertwined);
|
glInterleavedArrays (GL_C3F_V3F, 0, intertwined);
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel (GL_SMOOTH);
|
glShadeModel (GL_SMOOTH);
|
||||||
setupPointers ();
|
setupPointers ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear (GL_COLOR_BUFFER_BIT);
|
glClear (GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ void display(void)
|
|||||||
glFlush ();
|
glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape (int w, int h)
|
static void reshape (int w, int h)
|
||||||
{
|
{
|
||||||
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
@@ -126,7 +126,7 @@ void reshape (int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED2 */
|
/* ARGSUSED2 */
|
||||||
void mouse (int button, int state, int x, int y)
|
static void mouse (int button, int state, int x, int y)
|
||||||
{
|
{
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case GLUT_LEFT_BUTTON:
|
case GLUT_LEFT_BUTTON:
|
||||||
@@ -160,7 +160,7 @@ void mouse (int button, int state, int x, int y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard(unsigned char key, int x, int y)
|
static void keyboard(unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 27:
|
case 27:
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ static GLubyte checkImage[checkImageHeight][checkImageWidth][4];
|
|||||||
static GLuint texName;
|
static GLuint texName;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void makeCheckImage(void)
|
static void makeCheckImage(void)
|
||||||
{
|
{
|
||||||
int i, j, c;
|
int i, j, c;
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ void makeCheckImage(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||||
glShadeModel(GL_FLAT);
|
glShadeModel(GL_FLAT);
|
||||||
@@ -101,7 +101,7 @@ void init(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void display(void)
|
static void display(void)
|
||||||
{
|
{
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
@@ -125,7 +125,7 @@ void display(void)
|
|||||||
glDisable(GL_TEXTURE_2D);
|
glDisable(GL_TEXTURE_2D);
|
||||||
}
|
}
|
||||||
|
|
||||||
void reshape(int w, int h)
|
static void reshape(int w, int h)
|
||||||
{
|
{
|
||||||
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
@@ -137,7 +137,7 @@ void reshape(int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED1 */
|
/* ARGSUSED1 */
|
||||||
void keyboard (unsigned char key, int x, int y)
|
static void keyboard (unsigned char key, int x, int y)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 's':
|
case 's':
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ static void Init(void)
|
|||||||
0,
|
0,
|
||||||
sourceFormat,
|
sourceFormat,
|
||||||
GL_UNSIGNED_BYTE,
|
GL_UNSIGNED_BYTE,
|
||||||
//GL_UNSIGNED_INT,
|
/* GL_UNSIGNED_INT, */
|
||||||
tex2d);
|
tex2d);
|
||||||
|
|
||||||
glEnable(Target);
|
glEnable(Target);
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ static void Init( void )
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\nAll %u squares should be the same color.\n", NUM_TESTS + 1);
|
printf("\nAll %lu squares should be the same color.\n", (unsigned long) NUM_TESTS + 1);
|
||||||
|
|
||||||
(void) memset( temp, 0x00, sizeof( temp ) );
|
(void) memset( temp, 0x00, sizeof( temp ) );
|
||||||
glBindTexture( GL_TEXTURE_2D, 1 );
|
glBindTexture( GL_TEXTURE_2D, 1 );
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ static void Key( unsigned char key, int x, int y )
|
|||||||
|
|
||||||
static void Init( void )
|
static void Init( void )
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
static const char *prog0 =
|
static const char *prog0 =
|
||||||
"!!FP1.0\n"
|
"!!FP1.0\n"
|
||||||
"MUL o[COLR], R0, f[WPOS]; \n"
|
"MUL o[COLR], R0, f[WPOS]; \n"
|
||||||
@@ -73,6 +74,7 @@ static void Init( void )
|
|||||||
"MOV HC, H2; \n"
|
"MOV HC, H2; \n"
|
||||||
"END \n"
|
"END \n"
|
||||||
;
|
;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* masked updates, defines, declarations */
|
/* masked updates, defines, declarations */
|
||||||
static const char *prog1 =
|
static const char *prog1 =
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ static void Init( void )
|
|||||||
"square should look upside-down.\n");
|
"square should look upside-down.\n");
|
||||||
|
|
||||||
|
|
||||||
image = LoadRGBImage( IMAGE_FILE, & img_width, & img_height,
|
image = LoadRGBImage( IMAGE_FILE, (GLint *) & img_width, (GLint *) & img_height,
|
||||||
& img_format );
|
& img_format );
|
||||||
if ( image == NULL ) {
|
if ( image == NULL ) {
|
||||||
printf( "Could not open image file \"%s\".\n", IMAGE_FILE );
|
printf( "Could not open image file \"%s\".\n", IMAGE_FILE );
|
||||||
|
|||||||
@@ -274,6 +274,7 @@ Draw(void)
|
|||||||
glRasterPos2i(8, 6);
|
glRasterPos2i(8, 6);
|
||||||
sprintf(s, "Internal Texture Format [f/F]: %s (%d of %lu)",
|
sprintf(s, "Internal Texture Format [f/F]: %s (%d of %lu)",
|
||||||
IntFormats[CurFormat].name, CurFormat + 1, NUM_INT_FORMATS);
|
IntFormats[CurFormat].name, CurFormat + 1, NUM_INT_FORMATS);
|
||||||
|
IntFormats[CurFormat].name, CurFormat + 1, (unsigned long) NUM_INT_FORMATS);
|
||||||
PrintString(s);
|
PrintString(s);
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,10 @@ static GLfloat Xrot = 40, Yrot = 0, Zrot = 0;
|
|||||||
static GLboolean Anim = GL_TRUE;
|
static GLboolean Anim = GL_TRUE;
|
||||||
static GLuint Vbuffer = 0;
|
static GLuint Vbuffer = 0;
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
#else
|
||||||
static GLfloat buf[NUM_QUADS * 6 * 4];
|
static GLfloat buf[NUM_QUADS * 6 * 4];
|
||||||
|
#endif
|
||||||
|
|
||||||
static GLboolean doSwapBuffers = GL_TRUE;
|
static GLboolean doSwapBuffers = GL_TRUE;
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ static void draw(void)
|
|||||||
|
|
||||||
glDisable(GL_SCISSOR_TEST);
|
glDisable(GL_SCISSOR_TEST);
|
||||||
|
|
||||||
//glutSwapBuffers();
|
/* glutSwapBuffers(); */
|
||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
|
|||||||
glutInitWindowPosition(100, 0);
|
glutInitWindowPosition(100, 0);
|
||||||
glutInitWindowSize(prog.width, prog.height);
|
glutInitWindowSize(prog.width, prog.height);
|
||||||
|
|
||||||
//type = GLUT_RGB | GLUT_DOUBLE;
|
/* type = GLUT_RGB | GLUT_DOUBLE; */
|
||||||
type = GLUT_RGB | GLUT_SINGLE;
|
type = GLUT_RGB | GLUT_SINGLE;
|
||||||
glutInitDisplayMode(type);
|
glutInitDisplayMode(type);
|
||||||
|
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ static void draw(void)
|
|||||||
|
|
||||||
glDisable(GL_SCISSOR_TEST);
|
glDisable(GL_SCISSOR_TEST);
|
||||||
|
|
||||||
//glutSwapBuffers();
|
/* glutSwapBuffers(); */
|
||||||
glFlush();
|
glFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ int main(int argc, char **argv)
|
|||||||
glutInitWindowPosition(100, 0);
|
glutInitWindowPosition(100, 0);
|
||||||
glutInitWindowSize(prog.width, prog.height);
|
glutInitWindowSize(prog.width, prog.height);
|
||||||
|
|
||||||
//type = GLUT_RGB | GLUT_DOUBLE;
|
/* type = GLUT_RGB | GLUT_DOUBLE; */
|
||||||
type = GLUT_RGB | GLUT_SINGLE;
|
type = GLUT_RGB | GLUT_SINGLE;
|
||||||
glutInitDisplayMode(type);
|
glutInitDisplayMode(type);
|
||||||
|
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ static void Init( void )
|
|||||||
* part of GL 1.4.
|
* part of GL 1.4.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ver_str = glGetString( GL_VERSION );
|
ver_str = (char *) glGetString( GL_VERSION );
|
||||||
version = (ver_str == NULL) ? 1.0 : atof( ver_str );
|
version = (ver_str == NULL) ? 1.0 : atof( ver_str );
|
||||||
|
|
||||||
wrapping = (glutExtensionSupported("GL_EXT_stencil_wrap") || (version >= 1.4));
|
wrapping = (glutExtensionSupported("GL_EXT_stencil_wrap") || (version >= 1.4));
|
||||||
|
|||||||
@@ -39,11 +39,13 @@ static void draw( void )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
static void idle( void )
|
static void idle( void )
|
||||||
{
|
{
|
||||||
Angle += 2.0;
|
Angle += 2.0;
|
||||||
glutPostRedisplay();
|
glutPostRedisplay();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
static int win_width, win_height;
|
static int win_width, win_height;
|
||||||
|
|
||||||
|
#if 0
|
||||||
static void
|
static void
|
||||||
line(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
|
line(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
|
||||||
{
|
{
|
||||||
@@ -39,6 +40,7 @@ line(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
|
|||||||
glVertex2f(x2, y2);
|
glVertex2f(x2, y2);
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
line3(GLfloat x1, GLfloat y1, GLfloat z1, GLfloat x2, GLfloat y2, GLfloat z2)
|
line3(GLfloat x1, GLfloat y1, GLfloat z1, GLfloat x2, GLfloat y2, GLfloat z2)
|
||||||
|
|||||||
@@ -102,8 +102,8 @@ static void Draw( void )
|
|||||||
|
|
||||||
/* draw to texture image */
|
/* draw to texture image */
|
||||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
|
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
|
||||||
// glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT);
|
/* glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT); */
|
||||||
// glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
|
/* glReadBuffer(GL_COLOR_ATTACHMENT1_EXT); */
|
||||||
|
|
||||||
|
|
||||||
glViewport(0, 0, TexWidth, TexHeight);
|
glViewport(0, 0, TexWidth, TexHeight);
|
||||||
|
|||||||
@@ -116,6 +116,6 @@ int main(int argc, char **argv)
|
|||||||
glutReshapeFunc(Reshape);
|
glutReshapeFunc(Reshape);
|
||||||
glutKeyboardFunc(Key);
|
glutKeyboardFunc(Key);
|
||||||
glutDisplayFunc(Draw);
|
glutDisplayFunc(Draw);
|
||||||
// glutMainLoop();
|
/* glutMainLoop(); */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ static void Init(void)
|
|||||||
*/
|
*/
|
||||||
first_list = glGenLists(1);
|
first_list = glGenLists(1);
|
||||||
glNewList(first_list, GL_COMPILE);
|
glNewList(first_list, GL_COMPILE);
|
||||||
// glColor3f(0,1,0);
|
/* glColor3f(0,1,0); */
|
||||||
glEndList();
|
glEndList();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ static void Display( void )
|
|||||||
|
|
||||||
glEnable(GL_VERTEX_PROGRAM_ARB);
|
glEnable(GL_VERTEX_PROGRAM_ARB);
|
||||||
|
|
||||||
// glDrawArrays( GL_TRIANGLES, 0, 3 );
|
/* glDrawArrays( GL_TRIANGLES, 0, 3 ); */
|
||||||
glDrawArrays( GL_TRIANGLES, 1, 3 );
|
glDrawArrays( GL_TRIANGLES, 1, 3 );
|
||||||
|
|
||||||
glFlush();
|
glFlush();
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ static void Display( void )
|
|||||||
|
|
||||||
glEnable(GL_VERTEX_PROGRAM_ARB);
|
glEnable(GL_VERTEX_PROGRAM_ARB);
|
||||||
|
|
||||||
// glDrawArrays( GL_TRIANGLES, 0, 3 );
|
/* glDrawArrays( GL_TRIANGLES, 0, 3 ); */
|
||||||
glDrawArrays( GL_TRIANGLES, 1, 3 );
|
glDrawArrays( GL_TRIANGLES, 1, 3 );
|
||||||
|
|
||||||
glFlush();
|
glFlush();
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ static void Init(void)
|
|||||||
static const char *prog1 =
|
static const char *prog1 =
|
||||||
"!!ARBfp1.0\n"
|
"!!ARBfp1.0\n"
|
||||||
"MOV result.color, fragment.texcoord[1];\n"
|
"MOV result.color, fragment.texcoord[1];\n"
|
||||||
// "MOV result.color, fragment.color;\n"
|
/* "MOV result.color, fragment.color;\n" */
|
||||||
"END\n";
|
"END\n";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ static void Draw(void)
|
|||||||
glVertex3f( 0.5, -0.5, -30.0);
|
glVertex3f( 0.5, -0.5, -30.0);
|
||||||
glEnd();
|
glEnd();
|
||||||
|
|
||||||
// glLineWidth(12.0);
|
/* glLineWidth(12.0); */
|
||||||
|
|
||||||
/* Redraw parts of the lines:
|
/* Redraw parts of the lines:
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ static void Draw(void)
|
|||||||
glVertex3f( 0.5, -0.5, -30.0);
|
glVertex3f( 0.5, -0.5, -30.0);
|
||||||
glEnd();
|
glEnd();
|
||||||
|
|
||||||
// glLineWidth(12.0);
|
/* glLineWidth(12.0); */
|
||||||
|
|
||||||
/* Redraw parts of the lines to remove them:
|
/* Redraw parts of the lines to remove them:
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ static void Display( void )
|
|||||||
|
|
||||||
glEnable(GL_VERTEX_PROGRAM_ARB);
|
glEnable(GL_VERTEX_PROGRAM_ARB);
|
||||||
|
|
||||||
// glDrawArrays( GL_TRIANGLES, 0, 3 );
|
/* glDrawArrays( GL_TRIANGLES, 0, 3 ); */
|
||||||
glDrawArrays( GL_TRIANGLES, 1, 3 );
|
glDrawArrays( GL_TRIANGLES, 1, 3 );
|
||||||
|
|
||||||
glFlush();
|
glFlush();
|
||||||
|
|||||||
@@ -87,8 +87,8 @@ static void Display( void )
|
|||||||
|
|
||||||
glEnable(GL_VERTEX_PROGRAM_ARB);
|
glEnable(GL_VERTEX_PROGRAM_ARB);
|
||||||
|
|
||||||
// glDrawArrays( GL_TRIANGLES, 0, 3 );
|
/* glDrawArrays( GL_TRIANGLES, 0, 3 ); */
|
||||||
// glDrawArrays( GL_TRIANGLES, 1, 3 );
|
/* glDrawArrays( GL_TRIANGLES, 1, 3 ); */
|
||||||
glDrawArrays( GL_QUADS, 0, 4 );
|
glDrawArrays( GL_QUADS, 0, 4 );
|
||||||
|
|
||||||
glFlush();
|
glFlush();
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ redraw(Display *dpy)
|
|||||||
* Without this glClear(), depth buffer for the second process
|
* Without this glClear(), depth buffer for the second process
|
||||||
* is pretty much broken.
|
* is pretty much broken.
|
||||||
*/
|
*/
|
||||||
/*glClear(GL_DEPTH_BUFFER_BIT);*/
|
/* glClear(GL_DEPTH_BUFFER_BIT); */
|
||||||
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef(1, 0, 0);
|
glTranslatef(1, 0, 0);
|
||||||
|
|||||||
@@ -343,6 +343,9 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg)
|
|||||||
#if DEBUG_PRINT
|
#if DEBUG_PRINT
|
||||||
debug_printf("ExaPrepareSolid(0x%x)\n", fg);
|
debug_printf("ExaPrepareSolid(0x%x)\n", fg);
|
||||||
#endif
|
#endif
|
||||||
|
if (!exa->accel)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (!exa->pipe)
|
if (!exa->pipe)
|
||||||
XORG_FALLBACK("accle not enabled");
|
XORG_FALLBACK("accle not enabled");
|
||||||
|
|
||||||
@@ -361,7 +364,7 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg)
|
|||||||
XORG_FALLBACK("format %s", pf_name(priv->tex->format));
|
XORG_FALLBACK("format %s", pf_name(priv->tex->format));
|
||||||
}
|
}
|
||||||
|
|
||||||
return exa->accel && xorg_solid_bind_state(exa, priv, fg);
|
return xorg_solid_bind_state(exa, priv, fg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -417,6 +420,10 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
|
|||||||
#if DEBUG_PRINT
|
#if DEBUG_PRINT
|
||||||
debug_printf("ExaPrepareCopy\n");
|
debug_printf("ExaPrepareCopy\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!exa->accel)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (!exa->pipe)
|
if (!exa->pipe)
|
||||||
XORG_FALLBACK("accle not enabled");
|
XORG_FALLBACK("accle not enabled");
|
||||||
|
|
||||||
@@ -490,7 +497,7 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return exa->accel;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -598,15 +605,19 @@ ExaCheckComposite(int op,
|
|||||||
ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
|
ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum];
|
||||||
modesettingPtr ms = modesettingPTR(pScrn);
|
modesettingPtr ms = modesettingPTR(pScrn);
|
||||||
struct exa_context *exa = ms->exa;
|
struct exa_context *exa = ms->exa;
|
||||||
boolean accelerated = xorg_composite_accelerated(op,
|
|
||||||
pSrcPicture,
|
|
||||||
pMaskPicture,
|
|
||||||
pDstPicture);
|
|
||||||
#if DEBUG_PRINT
|
#if DEBUG_PRINT
|
||||||
debug_printf("ExaCheckComposite(%d, %p, %p, %p) = %d\n",
|
debug_printf("ExaCheckComposite(%d, %p, %p, %p) = %d\n",
|
||||||
op, pSrcPicture, pMaskPicture, pDstPicture, accelerated);
|
op, pSrcPicture, pMaskPicture, pDstPicture, accelerated);
|
||||||
#endif
|
#endif
|
||||||
return exa->accel && accelerated;
|
|
||||||
|
if (!exa->accel)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return xorg_composite_accelerated(op,
|
||||||
|
pSrcPicture,
|
||||||
|
pMaskPicture,
|
||||||
|
pDstPicture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -620,6 +631,9 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture,
|
|||||||
struct exa_context *exa = ms->exa;
|
struct exa_context *exa = ms->exa;
|
||||||
struct exa_pixmap_priv *priv;
|
struct exa_pixmap_priv *priv;
|
||||||
|
|
||||||
|
if (!exa->accel)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
#if DEBUG_PRINT
|
#if DEBUG_PRINT
|
||||||
debug_printf("ExaPrepareComposite(%d, src=0x%p, mask=0x%p, dst=0x%p)\n",
|
debug_printf("ExaPrepareComposite(%d, src=0x%p, mask=0x%p, dst=0x%p)\n",
|
||||||
op, pSrcPicture, pMaskPicture, pDstPicture);
|
op, pSrcPicture, pMaskPicture, pDstPicture);
|
||||||
@@ -678,8 +692,7 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture,
|
|||||||
render_format_name(pMaskPicture->format));
|
render_format_name(pMaskPicture->format));
|
||||||
}
|
}
|
||||||
|
|
||||||
return exa->accel &&
|
return xorg_composite_bind_state(exa, op, pSrcPicture, pMaskPicture,
|
||||||
xorg_composite_bind_state(exa, op, pSrcPicture, pMaskPicture,
|
|
||||||
pDstPicture,
|
pDstPicture,
|
||||||
pSrc ? exaGetPixmapDriverPrivate(pSrc) : NULL,
|
pSrc ? exaGetPixmapDriverPrivate(pSrc) : NULL,
|
||||||
pMask ? exaGetPixmapDriverPrivate(pMask) : NULL,
|
pMask ? exaGetPixmapDriverPrivate(pMask) : NULL,
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
|
|||||||
GLuint *state = i915->state.Tex[unit], format, pitch;
|
GLuint *state = i915->state.Tex[unit], format, pitch;
|
||||||
GLint lodbias, aniso = 0;
|
GLint lodbias, aniso = 0;
|
||||||
GLubyte border[4];
|
GLubyte border[4];
|
||||||
|
GLfloat maxlod;
|
||||||
|
|
||||||
memset(state, 0, sizeof(state));
|
memset(state, 0, sizeof(state));
|
||||||
|
|
||||||
@@ -175,18 +176,9 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
|
|||||||
|
|
||||||
pitch = intelObj->pitchOverride;
|
pitch = intelObj->pitchOverride;
|
||||||
} else {
|
} else {
|
||||||
GLuint dst_x, dst_y;
|
|
||||||
|
|
||||||
intel_miptree_get_image_offset(intelObj->mt, intelObj->firstLevel, 0, 0,
|
|
||||||
&dst_x, &dst_y);
|
|
||||||
|
|
||||||
dri_bo_reference(intelObj->mt->region->buffer);
|
dri_bo_reference(intelObj->mt->region->buffer);
|
||||||
i915->state.tex_buffer[unit] = intelObj->mt->region->buffer;
|
i915->state.tex_buffer[unit] = intelObj->mt->region->buffer;
|
||||||
/* XXX: This calculation is probably broken for tiled images with
|
i915->state.tex_offset[unit] = 0; /* Always the origin of the miptree */
|
||||||
* a non-page-aligned offset.
|
|
||||||
*/
|
|
||||||
i915->state.tex_offset[unit] = (dst_x + dst_y * intelObj->mt->pitch) *
|
|
||||||
intelObj->mt->cpp;
|
|
||||||
|
|
||||||
format = translate_texture_format(firstImage->TexFormat,
|
format = translate_texture_format(firstImage->TexFormat,
|
||||||
firstImage->InternalFormat,
|
firstImage->InternalFormat,
|
||||||
@@ -204,10 +196,14 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
|
|||||||
state[I915_TEXREG_MS3] |= MS3_TILE_WALK;
|
state[I915_TEXREG_MS3] |= MS3_TILE_WALK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We get one field with fraction bits to cover the maximum addressable (smallest
|
||||||
|
* resolution) LOD. Use it to cover both MAX_LEVEL and MAX_LOD.
|
||||||
|
*/
|
||||||
|
maxlod = MIN2(tObj->MaxLod, tObj->MaxLevel - tObj->BaseLevel);
|
||||||
state[I915_TEXREG_MS4] =
|
state[I915_TEXREG_MS4] =
|
||||||
((((pitch / 4) - 1) << MS4_PITCH_SHIFT) |
|
((((pitch / 4) - 1) << MS4_PITCH_SHIFT) |
|
||||||
MS4_CUBE_FACE_ENA_MASK |
|
MS4_CUBE_FACE_ENA_MASK |
|
||||||
(U_FIXED(CLAMP(tObj->MaxLod, 0.0, 11.0), 2) << MS4_MAX_LOD_SHIFT) |
|
(U_FIXED(CLAMP(maxlod, 0.0, 11.0), 2) << MS4_MAX_LOD_SHIFT) |
|
||||||
((firstImage->Depth - 1) << MS4_VOLUME_DEPTH_SHIFT));
|
((firstImage->Depth - 1) << MS4_VOLUME_DEPTH_SHIFT));
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -392,6 +392,17 @@ static void emit_sge( struct brw_vs_compile *c,
|
|||||||
emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_GE);
|
emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_GE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void emit_cmp( struct brw_compile *p,
|
||||||
|
struct brw_reg dst,
|
||||||
|
struct brw_reg arg0,
|
||||||
|
struct brw_reg arg1,
|
||||||
|
struct brw_reg arg2 )
|
||||||
|
{
|
||||||
|
brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_L, arg0, brw_imm_f(0));
|
||||||
|
brw_SEL(p, dst, arg1, arg2);
|
||||||
|
brw_set_predicate_control(p, BRW_PREDICATE_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
static void emit_max( struct brw_compile *p,
|
static void emit_max( struct brw_compile *p,
|
||||||
struct brw_reg dst,
|
struct brw_reg dst,
|
||||||
struct brw_reg arg0,
|
struct brw_reg arg0,
|
||||||
@@ -1485,6 +1496,9 @@ void brw_vs_emit(struct brw_vs_compile *c )
|
|||||||
brw_MOV(p, brw_acc_reg(), args[2]);
|
brw_MOV(p, brw_acc_reg(), args[2]);
|
||||||
brw_MAC(p, dst, args[0], args[1]);
|
brw_MAC(p, dst, args[0], args[1]);
|
||||||
break;
|
break;
|
||||||
|
case OPCODE_CMP:
|
||||||
|
emit_cmp(p, dst, args[0], args[1], args[2]);
|
||||||
|
break;
|
||||||
case OPCODE_MAX:
|
case OPCODE_MAX:
|
||||||
emit_max(p, dst, args[0], args[1]);
|
emit_max(p, dst, args[0], args[1]);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ int INTEL_DEBUG = (0);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define DRIVER_DATE "20090712 2009Q2 RC3"
|
#define DRIVER_DATE "20091221 2009Q4"
|
||||||
#define DRIVER_DATE_GEM "GEM " DRIVER_DATE
|
#define DRIVER_DATE_GEM "GEM " DRIVER_DATE
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ EGL_SOURCES = server/radeon_egl.c
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(RADEON_LDFLAGS),)
|
ifeq ($(RADEON_LDFLAGS),)
|
||||||
CS_SOURCES = radeon_cs_space_drm.c
|
CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
RADEON_COMMON_SOURCES = \
|
RADEON_COMMON_SOURCES = \
|
||||||
|
|||||||
1
src/mesa/drivers/dri/r200/radeon_bo.c
Symbolic link
1
src/mesa/drivers/dri/r200/radeon_bo.c
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../radeon/radeon_bo.c
|
||||||
1
src/mesa/drivers/dri/r200/radeon_bo_int_drm.h
Symbolic link
1
src/mesa/drivers/dri/r200/radeon_bo_int_drm.h
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../radeon/radeon_bo_int_drm.h
|
||||||
1
src/mesa/drivers/dri/r200/radeon_cs.c
Symbolic link
1
src/mesa/drivers/dri/r200/radeon_cs.c
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../radeon/radeon_cs.c
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user