442 GLfloat texLow = 0.0, texHigh = 0.0;
448 if (slices < 2 || loops < 1 || outerRadius <= 0.0 || innerRadius < 0.0 ||
449 innerRadius > outerRadius) {
454 if (sweepAngle < -360.0) sweepAngle = 360.0;
455 if (sweepAngle > 360.0) sweepAngle = 360.0;
456 if (sweepAngle < 0) {
457 startAngle += sweepAngle;
458 sweepAngle = -sweepAngle;
461 if (sweepAngle == 360.0) {
464 slices2 = slices + 1;
468 deltaRadius = outerRadius - innerRadius;
472 angleOffset = startAngle / 180.0 *
PI;
473 for (
i = 0;
i <= slices;
i++) {
474 angle = angleOffset + ((
PI * sweepAngle) / 180.0) *
i / slices;
479 if (sweepAngle == 360.0) {
480 sinCache[slices] = sinCache[0];
481 cosCache[slices] = cosCache[0];
484 switch(qobj->normals) {
498 switch (qobj->drawStyle) {
500 if (innerRadius == 0.0) {
504 if (qobj->textureCoords) {
508 radiusLow = outerRadius -
509 deltaRadius * ((
float) (loops-1) / loops);
510 if (qobj->textureCoords) {
511 texLow = radiusLow / outerRadius / 2;
515 for (
i = slices;
i >= 0;
i--) {
516 if (qobj->textureCoords) {
518 texLow * cosCache[
i] + 0.5);
521 radiusLow * cosCache[
i], 0.0);
524 for (
i = 0;
i <= slices;
i++) {
525 if (qobj->textureCoords) {
527 texLow * cosCache[
i] + 0.5);
530 radiusLow * cosCache[
i], 0.0);
538 radiusLow = outerRadius - deltaRadius * ((
float)
j / loops);
539 radiusHigh = outerRadius - deltaRadius * ((
float) (
j + 1) / loops);
540 if (qobj->textureCoords) {
541 texLow = radiusLow / outerRadius / 2;
542 texHigh = radiusHigh / outerRadius / 2;
546 for (
i = 0;
i <= slices;
i++) {
548 if (qobj->textureCoords) {
550 texLow * cosCache[
i] + 0.5);
553 radiusLow * cosCache[
i], 0.0);
555 if (qobj->textureCoords) {
557 texHigh * cosCache[
i] + 0.5);
560 radiusHigh * cosCache[
i], 0.0);
562 if (qobj->textureCoords) {
564 texHigh * cosCache[
i] + 0.5);
567 radiusHigh * cosCache[
i], 0.0);
569 if (qobj->textureCoords) {
571 texLow * cosCache[
i] + 0.5);
574 radiusLow * cosCache[
i], 0.0);
582 for (
i = 0;
i < slices2;
i++) {
583 sintemp = sinCache[
i];
584 costemp = cosCache[
i];
585 for (
j = 0;
j <= loops;
j++) {
586 radiusLow = outerRadius - deltaRadius * ((
float)
j / loops);
588 if (qobj->textureCoords) {
589 texLow = radiusLow / outerRadius / 2;
592 texLow * cosCache[
i] + 0.5);
594 glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0);
600 if (innerRadius == outerRadius) {
603 for (
i = 0;
i <= slices;
i++) {
604 if (qobj->textureCoords) {
606 cosCache[
i] / 2 + 0.5);
609 innerRadius * cosCache[
i], 0.0);
614 for (
j = 0;
j <= loops;
j++) {
615 radiusLow = outerRadius - deltaRadius * ((
float)
j / loops);
616 if (qobj->textureCoords) {
617 texLow = radiusLow / outerRadius / 2;
621 for (
i = 0;
i <= slices;
i++) {
622 if (qobj->textureCoords) {
624 texLow * cosCache[
i] + 0.5);
627 radiusLow * cosCache[
i], 0.0);
631 for (
i=0;
i < slices2;
i++) {
632 sintemp = sinCache[
i];
633 costemp = cosCache[
i];
635 for (
j = 0;
j <= loops;
j++) {
636 radiusLow = outerRadius - deltaRadius * ((
float)
j / loops);
637 if (qobj->textureCoords) {
638 texLow = radiusLow / outerRadius / 2;
641 if (qobj->textureCoords) {
643 texLow * cosCache[
i] + 0.5);
645 glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0);
651 if (sweepAngle < 360.0) {
652 for (
i = 0;
i <= slices;
i+= slices) {
653 sintemp = sinCache[
i];
654 costemp = cosCache[
i];
656 for (
j = 0;
j <= loops;
j++) {
657 radiusLow = outerRadius - deltaRadius * ((
float)
j / loops);
659 if (qobj->textureCoords) {
660 texLow = radiusLow / outerRadius / 2;
662 texLow * cosCache[
i] + 0.5);
664 glVertex3f(radiusLow * sintemp, radiusLow * costemp, 0.0);
669 for (
j = 0;
j <= loops;
j += loops) {
670 radiusLow = outerRadius - deltaRadius * ((
float)
j / loops);
671 if (qobj->textureCoords) {
672 texLow = radiusLow / outerRadius / 2;
676 for (
i = 0;
i <= slices;
i++) {
677 if (qobj->textureCoords) {
679 texLow * cosCache[
i] + 0.5);
682 radiusLow * cosCache[
i], 0.0);
685 if (innerRadius == outerRadius)
break;
static void gluQuadricError(GLUquadric *qobj, GLenum which)
GLAPI void GLAPIENTRY glVertex3f(GLfloat x, GLfloat y, GLfloat z)
GLAPI void GLAPIENTRY glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
GLAPI void GLAPIENTRY glBegin(GLenum mode)
#define GLU_INVALID_VALUE
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static float(__cdecl *square_half_float)(float x
GLAPI void GLAPIENTRY glTexCoord2f(GLfloat s, GLfloat t)
GLAPI void GLAPIENTRY glEnd(void)