1 /* 2 * Copyright 2006 Sony Computer Entertainment Inc. 3 * 4 * Licensed under the MIT Open Source License, for details please see license.txt or the website 5 * http://www.opensource.org/licenses/mit-license.php 6 * 7 */ 8 9 #include <dae.h> 10 #include <dae/daeDom.h> 11 #include <dom/domGl_samplerDEPTH.h> 12 #include <dae/daeMetaCMPolicy.h> 13 #include <dae/daeMetaSequence.h> 14 #include <dae/daeMetaChoice.h> 15 #include <dae/daeMetaGroup.h> 16 #include <dae/daeMetaAny.h> 17 #include <dae/daeMetaElementAttribute.h> 18 19 daeElementRef 20 domGl_samplerDEPTH::create(DAE& dae) 21 { 22 domGl_samplerDEPTHRef ref = new domGl_samplerDEPTH(dae); 23 return ref; 24 } 25 26 27 daeMetaElement * 28 domGl_samplerDEPTH::registerElement(DAE& dae) 29 { 30 daeMetaElement* meta = dae.getMeta(ID()); 31 if ( meta != NULL ) return meta; 32 33 meta = new daeMetaElement(dae); 34 dae.setMeta(ID(), *meta); 35 meta->setName( "gl_samplerDEPTH" ); 36 meta->registerClass(domGl_samplerDEPTH::create); 37 38 daeMetaCMPolicy *cm = NULL; 39 daeMetaElementAttribute *mea = NULL; 40 cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); 41 42 cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); 43 44 mea = new daeMetaElementAttribute( meta, cm, 0, 1, 1 ); 45 mea->setName( "source" ); 46 mea->setOffset( daeOffsetOf(domGl_samplerDEPTH,elemSource) ); 47 mea->setElementType( domSource::registerElement(dae) ); 48 cm->appendChild( mea ); 49 50 mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 ); 51 mea->setName( "wrap_s" ); 52 mea->setOffset( daeOffsetOf(domGl_samplerDEPTH,elemWrap_s) ); 53 mea->setElementType( domWrap_s::registerElement(dae) ); 54 cm->appendChild( mea ); 55 56 mea = new daeMetaElementAttribute( meta, cm, 2, 0, 1 ); 57 mea->setName( "wrap_t" ); 58 mea->setOffset( daeOffsetOf(domGl_samplerDEPTH,elemWrap_t) ); 59 mea->setElementType( domWrap_t::registerElement(dae) ); 60 cm->appendChild( mea ); 61 62 mea = new daeMetaElementAttribute( meta, cm, 3, 0, 1 ); 63 mea->setName( "minfilter" ); 64 mea->setOffset( daeOffsetOf(domGl_samplerDEPTH,elemMinfilter) ); 65 mea->setElementType( domMinfilter::registerElement(dae) ); 66 cm->appendChild( mea ); 67 68 mea = new daeMetaElementAttribute( meta, cm, 4, 0, 1 ); 69 mea->setName( "magfilter" ); 70 mea->setOffset( daeOffsetOf(domGl_samplerDEPTH,elemMagfilter) ); 71 mea->setElementType( domMagfilter::registerElement(dae) ); 72 cm->appendChild( mea ); 73 74 mea = new daeMetaElementArrayAttribute( meta, cm, 5, 0, -1 ); 75 mea->setName( "extra" ); 76 mea->setOffset( daeOffsetOf(domGl_samplerDEPTH,elemExtra_array) ); 77 mea->setElementType( domExtra::registerElement(dae) ); 78 cm->appendChild( mea ); 79 80 cm->setMaxOrdinal( 5 ); 81 cm->getParent()->appendChild( cm ); 82 cm = cm->getParent(); 83 84 cm->setMaxOrdinal( 5 ); 85 meta->setCMRoot( cm ); 86 87 meta->setElementSize(sizeof(domGl_samplerDEPTH)); 88 meta->validate(); 89 90 return meta; 91 } 92 93