| 43 | | EN_POINT_SMOOTH = 0x0040, |
| 44 | | EN_POINT_SPRITE = 0x0080, |
| 45 | | EN_SCISSOR_TEST = 0x0100, |
| 46 | | EN_STENCIL_TEST = 0x0200, |
| 47 | | EN_TEXTURE_2D = 0x0400, |
| 48 | | EN_VERTEX_PROGRAM_POINT_SIZE = 0x0800 |
| | 43 | EN_MULTISAMPLE = 0x0040, |
| | 44 | EN_POINT_SMOOTH = 0x0080, |
| | 45 | EN_POINT_SPRITE = 0x0100, |
| | 46 | EN_SCISSOR_TEST = 0x0200, |
| | 47 | EN_STENCIL_TEST = 0x0400, |
| | 48 | EN_TEXTURE_2D = 0x0800, |
| | 49 | EN_VERTEX_PROGRAM_POINT_SIZE = 0x1000 |
| | 738 | This should only be used from a compiled draw list since a GLUquadricObj |
| | 739 | is created and deleted. |
| | 740 | */ |
| | 741 | static UCell* dop_sphere( UThread* ut, UCell* pc ) |
| | 742 | { |
| | 743 | GLdouble radius; |
| | 744 | GLint slices, stacks; |
| | 745 | |
| | 746 | ++pc; |
| | 747 | if( ur_is(pc, UT_DECIMAL) ) |
| | 748 | radius = ur_decimal(pc); |
| | 749 | else if( ur_is(pc, UT_INT) ) |
| | 750 | radius = (GLdouble) ur_int(pc); |
| | 751 | else |
| | 752 | { |
| | 753 | ur_throwErr( UR_ERR_DATATYPE, "sphere expected number! for radius" ); |
| | 754 | return 0; |
| | 755 | } |
| | 756 | |
| | 757 | ++pc; |
| | 758 | if( ur_is(pc, UT_COORD) ) |
| | 759 | { |
| | 760 | slices = pc->coord.elem[0]; |
| | 761 | stacks = pc->coord.elem[1]; |
| | 762 | } |
| | 763 | else |
| | 764 | { |
| | 765 | ur_throwErr( UR_ERR_DATATYPE, |
| | 766 | "sphere expected coord! for slices,stacks" ); |
| | 767 | return 0; |
| | 768 | } |
| | 769 | |
| | 770 | GLUquadricObj* obj = gluNewQuadric(); |
| | 771 | if( obj ) |
| | 772 | { |
| | 773 | gluQuadricTexture( obj, GL_TRUE ); |
| | 774 | gluQuadricNormals( obj, GLU_SMOOTH ); |
| | 775 | gluQuadricDrawStyle( obj, GLU_FILL ); |
| | 776 | gluQuadricOrientation( obj, GLU_OUTSIDE ); |
| | 777 | |
| | 778 | gluSphere( obj, radius, slices, stacks ); |
| | 779 | |
| | 780 | gluDeleteQuadric( obj ); |
| | 781 | } |
| | 782 | |
| | 783 | return pc; |
| | 784 | } |
| | 785 | |
| | 786 | |
| | 787 | /* |