Show
Ignore:
Timestamp:
08/05/07 00:26:17 (16 months ago)
Author:
krobillard
Message:

Added ++/-- to replace word inc/dec.
Renamed UR_FLAG_EOL as UR_FLAG_SOL.
GL - Added 'sphere draw opcode and 'curve-value call.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/thune/thread_safe/gl/draw_list.c

    r438 r442  
    4141    EN_LIGHTING     = 0x0010, 
    4242    EN_LINE_SMOOTH  = 0x0020, 
    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 
    4950}; 
    5051 
     
    735736 
    736737/* 
     738   This should only be used from a compiled draw list since a GLUquadricObj 
     739   is created and deleted. 
     740*/ 
     741static 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/* 
    737788  attrib/1 shader/my-attrib float-count #[...] 
    738789 
     
    927978    PRINT_STATE( "GL_LIGHTING/l",     EN_LIGHTING,     GL_LIGHTING ) 
    928979    PRINT_STATE( "GL_LINE_SMOOTH/n",  EN_LINE_SMOOTH,  GL_LINE_SMOOTH ) 
     980    PRINT_STATE( "GL_MULTISAMPLE/m",  EN_MULTISAMPLE,  GL_MULTISAMPLE ) 
    929981    PRINT_STATE( "GL_POINT_SMOOTH/o", EN_POINT_SMOOTH, GL_POINT_SMOOTH ) 
    930982    PRINT_STATE( "GL_POINT_SPRITE/p", EN_POINT_SPRITE, GL_POINT_SPRITE ) 
     
    9701022                ENABLE( EN_LIGHTING, GL_LIGHTING ) 
    9711023                break; 
     1024            case 'm': 
     1025                ENABLE( EN_MULTISAMPLE, GL_MULTISAMPLE ) 
     1026                break; 
    9721027            case 'n': 
    9731028                ENABLE( EN_LINE_SMOOTH, GL_LINE_SMOOTH ) 
     
    10231078            case 'l': 
    10241079                DISABLE( EN_LIGHTING, GL_LIGHTING ) 
     1080                break; 
     1081            case 'm': 
     1082                DISABLE( EN_MULTISAMPLE, GL_MULTISAMPLE ) 
    10251083                break; 
    10261084            case 'n': 
     
    12091267                        break; 
    12101268                } 
     1269                break; 
     1270 
     1271            case DOP_SPHERE:                 // sphere rad silces,stacks 
     1272                pc = dop_sphere( ut, pc ); 
     1273                if( ! pc ) 
     1274                    return 0; 
    12111275                break; 
    12121276