Assorted updates from John Fay.

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@94 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
brianp 2003-06-23 15:22:20 +00:00
parent 70637945ef
commit 36c63b7b43
7 changed files with 322 additions and 322 deletions

View File

@ -1065,7 +1065,7 @@ is not implemented in <i>freeglut</i>. </p>
<p>
The following state variables may be queried with glutGet.
The following state variables may be queried with "<tt>glutGet</tt>".
The returned value is an integer.
</p>
@ -1134,7 +1134,7 @@ These queries do not depend on the current window.
<h2> 13.7&nbsp; glutGetProcAddress</h2>
<p><tt>glutGetProcAddress</tt> returns
a pointer to a named GL or freeglut function. </p>
a pointer to a named GL or <i>freeglut</i> function. </p>
<p><b>Usage</b></p>
<p><tt>void *glutGetProcAddress ( const
char *procName ) ;</tt></p>
@ -1150,8 +1150,11 @@ the application will avoid this hard dependency and be more portable and interop
better with various implementations of OpenGL. </p>
<p> Both OpenGL functions and freeglut
functions can be queried with this function. </p>
<p><b>NOTE</b>: this function is not supported
in GLUT. </p>
<p><b>Changes From GLUT</b> </p>
<p>GLUT does not include this function.
</p>
<h1> 14.0&nbsp;<a name="FontRendering"></a>
Font Rendering Functions</h1>
<i>Freeglut</i> supports two types of font rendering:&nbsp; bitmap fonts,
@ -1872,15 +1875,17 @@ GLUT State</h1>
<p>
freeglut users should normally just include GL/glut.h in their programs.
Programs which need freeglut-specific functions should also include
GL/freeglut_ext.h as follows:
Application programmers who are porting their GLUT programs to <i>freeglut</i> may continue
to include <tt>&lt;GL/glut.h&gt;</tt> in their programs.
Programs which use the <i>freeglut</i>-specific extensions to GLUT should include
<tt>&lt;GL/freeglut.h&gt;</tt>. One possible arrangement is as follows:
</p>
<pre>
#include &lt;GL/glut.h&gt;
#ifdef FREEGLUT
#include &lt;GL/freeglut_ext.h&gt;
#else
#include &lt;GL/glut.h&gt;
#endif
</pre>

View File

@ -100,7 +100,7 @@ void FGAPIENTRY glutSwapBuffers( void )
if (fgState.SwapTime == 0)
fgState.SwapTime = t;
else if (t - fgState.SwapTime > fgState.FPSInterval) {
float time = 0.001 * (t - fgState.SwapTime);
float time = 0.001f * (t - fgState.SwapTime);
float fps = (float) fgState.SwapCount / time;
fprintf(stderr, "freeglut: %d frames in %.2f seconds = %.2f FPS\n",
fgState.SwapCount, time, fps);

View File

@ -75,7 +75,7 @@ void fghRememberState( void )
#elif TARGET_HOST_WIN32
DEVMODE devMode;
/* DEVMODE devMode; */
/*
* Grab the current desktop settings...
@ -250,7 +250,7 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
unsigned int displayModes = 0, mode = 0xffffffff;
GLboolean success = FALSE;
HDC desktopDC;
/* HDC desktopDC; */
DEVMODE devMode;
/*
@ -278,33 +278,33 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
displayModes++;
}
if( mode == 0xffffffff )
if ( mode == 0xffffffff )
{
/* then try without Display Frequency */
displayModes=0;
displayModes = 0;
/*
* Enumerate the available display modes
*/
while( EnumDisplaySettings( NULL, displayModes, &devMode ) == TRUE )
{
/* then try without Display Frequency */
{
/* then try without Display Frequency */
if( fghCheckDisplayMode( devMode.dmPelsWidth, devMode.dmPelsHeight,
devMode.dmBitsPerPel, fgState.GameModeRefresh))
{
/*
* OKi, we've found a matching display mode, remember its number and break
*/
mode = displayModes;
break;
}
if( fghCheckDisplayMode( devMode.dmPelsWidth, devMode.dmPelsHeight,
devMode.dmBitsPerPel, fgState.GameModeRefresh))
{
/*
* OKi, we've found a matching display mode, remember its number and break
*/
mode = displayModes;
break;
}
/*
* Switch to the next display mode, if any
*/
displayModes++;
}
/*
* Switch to the next display mode, if any
*/
displayModes++;
}
}
/*

File diff suppressed because it is too large Load Diff

View File

@ -80,9 +80,6 @@
#include "../include/GL/freeglut.h"
#include "freeglut_internal.h"
#ifdef TARGET_HOST_WIN32
#pragma warning ( once:4305 )
#endif
/* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
@ -104,7 +101,7 @@ static int patchdata[][16] =
{ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 }
};
static float cpdata[][3] =
static double cpdata[][3] =
{
{0.2, 0, 2.7}, {0.2, -0.112, 2.7}, {0.112, -0.2, 2.7}, {0,
-0.2, 2.7}, {1.3375, 0, 2.53125}, {1.3375, -0.749, 2.53125},
@ -149,15 +146,15 @@ static float cpdata[][3] =
{0.84, -1.5, 0.075}
};
static float tex[2][2][2] =
static double tex[2][2][2] =
{
{ {0, 0}, {1, 0} },
{ {0, 1}, {1, 1} }
{ {0.0, 0.0}, {1.0, 0.0} },
{ {0.0, 1.0}, {1.0, 1.0} }
};
static void teapot( GLint grid, GLdouble scale, GLenum type )
{
float p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3];
double p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3];
long i, j, k, l;
glPushAttrib( GL_ENABLE_BIT | GL_EVAL_BIT );
@ -167,9 +164,9 @@ static void teapot( GLint grid, GLdouble scale, GLenum type )
glEnable( GL_MAP2_TEXTURE_COORD_2 );
glPushMatrix();
glRotatef(270.0, 1.0, 0.0, 0.0);
glRotated(270.0, 1.0, 0.0, 0.0);
glScaled(0.5 * scale, 0.5 * scale, 0.5 * scale);
glTranslatef(0.0, 0.0, -1.5);
glTranslated(0.0, 0.0, -1.5);
for (i = 0; i < 10; i++) {
for (j = 0; j < 4; j++) {
@ -194,20 +191,20 @@ static void teapot( GLint grid, GLdouble scale, GLenum type )
}
}
glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2,
glMap2d(GL_MAP2_TEXTURE_COORD_2, 0.0, 1.0, 2, 2, 0.0, 1.0, 4, 2,
&tex[0][0][0]);
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
glMap2d(GL_MAP2_VERTEX_3, 0.0, 1.0, 3, 4, 0.0, 1.0, 12, 4,
&p[0][0][0]);
glMapGrid2f(grid, 0.0, 1.0, grid, 0.0, 1.0);
glMapGrid2d(grid, 0.0, 1.0, grid, 0.0, 1.0);
glEvalMesh2(type, 0, grid, 0, grid);
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
glMap2d(GL_MAP2_VERTEX_3, 0.0, 1.0, 3, 4, 0.0, 1.0, 12, 4,
&q[0][0][0]);
glEvalMesh2(type, 0, grid, 0, grid);
if (i < 6) {
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
glMap2d(GL_MAP2_VERTEX_3, 0.0, 1.0, 3, 4, 0.0, 1.0, 12, 4,
&r[0][0][0]);
glEvalMesh2(type, 0, grid, 0, grid);
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
glMap2d(GL_MAP2_VERTEX_3, 0.0, 1.0, 3, 4, 0.0, 1.0, 12, 4,
&s[0][0][0]);
glEvalMesh2(type, 0, grid, 0, grid);
}

View File

@ -46,7 +46,9 @@
#define GLUT_WINDOW_BORDER_WIDTH 0x01FA
#define GLUT_WINDOW_HEADER_HEIGHT 0x01FB
#define GLUT_VERSION 0x01FC
/*
* Process loop function, see freeglut_main.c
*/
@ -84,8 +86,8 @@ FGAPI void FGAPIENTRY glutStrokeString( void* font, const char *string );
*/
FGAPI void FGAPIENTRY glutWireRhombicDodecahedron( void );
FGAPI void FGAPIENTRY glutSolidRhombicDodecahedron( void );
FGAPI void FGAPIENTRY glutWireSierpinskiSponge ( int num_levels, GLfloat offset[3], GLfloat scale ) ;
FGAPI void FGAPIENTRY glutSolidSierpinskiSponge ( int num_levels, GLfloat offset[3], GLfloat scale ) ;
FGAPI void FGAPIENTRY glutWireSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale ) ;
FGAPI void FGAPIENTRY glutSolidSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale ) ;
/*
* Extension functions, see freeglut_ext.c

View File

@ -75,10 +75,6 @@
#define GLUT_API_VERSION 4
#define FREEGLUT_VERSION_1_4 1
#define VERSION_MAJOR 1
#define VERSION_MINOR 4
#define VERSION_PATCH 0
/*
* Always include OpenGL and GLU headers
*/