| 1 | |
| 2 | #include <OpenGl_tgl_all.hxx> |
| 3 | |
| 4 | #include <stddef.h> |
| 5 | #include <stdio.h> |
| 6 | |
| 7 | #include <OpenGl_cmn_varargs.hxx> |
| 8 | #include <OpenGl_telem_attri.hxx> |
| 9 | #include <OpenGl_tsm.hxx> |
| 10 | #include <OpenGl_telem.hxx> |
| 11 | #include <OpenGl_telem_inquire.hxx> |
| 12 | |
| 13 | static TStatus FaceCullingModeDisplay( TSM_ELEM_DATA, Tint, cmn_key* ); |
| 14 | static TStatus FaceCullingModeAdd( TSM_ELEM_DATA, Tint, cmn_key* ); |
| 15 | static TStatus FaceCullingModePrint( TSM_ELEM_DATA, Tint, cmn_key* ); |
| 16 | static TStatus FaceCullingModeInquire( TSM_ELEM_DATA, Tint, cmn_key* ); |
| 17 | |
| 18 | static TStatus (*MtdTbl[])( TSM_ELEM_DATA, Tint, cmn_key* ) = |
| 19 | { |
| 20 | FaceCullingModeDisplay, /* PickTraverse */ |
| 21 | FaceCullingModeDisplay, |
| 22 | FaceCullingModeAdd, |
| 23 | 0, /* Delete */ |
| 24 | FaceCullingModePrint, |
| 25 | FaceCullingModeInquire |
| 26 | }; |
| 27 | |
| 28 | |
| 29 | MtblPtr |
| 30 | TelFaceCullingModeInitClass( TelType *el ) |
| 31 | { |
| 32 | *el = TelFaceCullingMode; |
| 33 | return MtdTbl; |
| 34 | } |
| 35 | |
| 36 | static TStatus |
| 37 | FaceCullingModeAdd( TSM_ELEM_DATA d, Tint n, cmn_key *k ) |
| 38 | { |
| 39 | ((tsm_elem_data)(d.pdata))->ldata = k[0]->data.ldata; |
| 40 | |
| 41 | return TSuccess; |
| 42 | } |
| 43 | |
| 44 | |
| 45 | static TStatus |
| 46 | FaceCullingModeDisplay( TSM_ELEM_DATA d, Tint n, cmn_key *k ) |
| 47 | { |
| 48 | CMN_KEY key; |
| 49 | |
| 50 | key.id = TelFaceCullingMode; |
| 51 | key.data.ldata = d.ldata; |
| 52 | TsmSetAttri( 1, &key ); |
| 53 | |
| 54 | return TSuccess; |
| 55 | } |
| 56 | |
| 57 | |
| 58 | static TStatus |
| 59 | FaceCullingModePrint( TSM_ELEM_DATA data, Tint n, cmn_key *k ) |
| 60 | { |
| 61 | switch( data.ldata ) |
| 62 | { |
| 63 | case TelCullNone: |
| 64 | fprintf( stdout, "TelFaceCullingMode. Value = CULL_NONE\n" ); |
| 65 | break; |
| 66 | |
| 67 | case TelCullFront: |
| 68 | fprintf( stdout, "TelFaceCullingMode. Value = CULL_FRONT\n" ); |
| 69 | break; |
| 70 | |
| 71 | case TelCullBack: |
| 72 | fprintf( stdout, "TelFaceCullingMode. Value = CULL_BACK\n" ); |
| 73 | break; |
| 74 | } |
| 75 | fprintf( stdout, "\n" ); |
| 76 | |
| 77 | return TSuccess; |
| 78 | } |
| 79 | |
| 80 | |
| 81 | static TStatus |
| 82 | FaceCullingModeInquire( TSM_ELEM_DATA data, Tint n, cmn_key *k ) |
| 83 | { |
| 84 | Tint i; |
| 85 | |
| 86 | for( i = 0; i < n; i++ ) |
| 87 | { |
| 88 | switch( k[i]->id ) |
| 89 | { |
| 90 | case INQ_GET_SIZE_ID: |
| 91 | { |
| 92 | k[i]->data.ldata = sizeof( Tint ); |
| 93 | break; |
| 94 | } |
| 95 | case INQ_GET_CONTENT_ID: |
| 96 | { |
| 97 | TEL_INQ_CONTENT *c; |
| 98 | Teldata *w; |
| 99 | |
| 100 | c = (tel_inq_content)k[i]->data.pdata; |
| 101 | w = c->data; |
| 102 | c->act_size = 0; |
| 103 | /* w->face_processing_mode.cull = data.ldata; */ |
| 104 | w->idata = data.ldata; |
| 105 | break; |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | return TSuccess; |
| 111 | } |