Hi, I'm triing to write a flext external thats reads a gem_state struct. I 'd like to access the pixBlock data. I wrote the following method ( registered as FLEXT_ADDMETHOD_(0,"gem_state", gem_state) ) I don't know where I am wrong in my code.... any hint ? thanks, Jean-Yves
void my_flext_external::gem_state(int argc, t_atom *argv) { GemState *my_pointer; if (CanbePointer(argv[0])) { my_pointer = (GemState *) GetPointer(argv[0]); // retrieve gem pointer if (!my_pointer) { post ("no pixblock !"); return; } else { //accessing to fields post ("dirty field = %d", my_pointer->dirty); post ("inDisplayList field = %d", my_pointer->inDisplayList); post ("lighting field = %d", my_pointer->lighting); post ("texture field = %d", my_pointer->texture); post ("*image field = %d", my_pointer->image); post ("*texCoords field = %d", my_pointer->texCoords); post ("multiTexUnits field = %d", my_pointer->multiTexUnits); // etc... }
}
Hi, it would be useful to know in which way your code doesn't do what you want. Does it compile or not, are there runtime problems, does it crash? gr~~~
Am 19.02.2009 um 14:25 schrieb Jean-Yves Gratius:
Hi, I'm triing to write a flext external thats reads a gem_state struct. I 'd like to access the pixBlock data. I wrote the following method ( registered as FLEXT_ADDMETHOD_(0,"gem_state", gem_state) ) I don't know where I am wrong in my code.... any hint ? thanks, Jean-Yves
void my_flext_external::gem_state(int argc, t_atom *argv) { GemState *my_pointer; if (CanbePointer(argv[0])) { my_pointer = (GemState *) GetPointer(argv[0]); // retrieve gem pointer if (!my_pointer) { post ("no pixblock !"); return; } else { //accessing to fields post ("dirty field = %d", my_pointer->dirty); post ("inDisplayList field = %d", my_pointer->inDisplayList); post ("lighting field = %d", my_pointer->lighting); post ("texture field = %d", my_pointer->texture); post ("*image field = %d", my_pointer->image); post ("*texCoords field = %d", my_pointer->texCoords); post ("multiTexUnits field = %d", my_pointer->multiTexUnits); // etc... }
}
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
Hi Thomas, oups sorry, I forgot to describe my problem. yes it compiled, didn't crash. it just sended data that didn't correpond to the gem_state struct. Indeed i found my error: I read that gem_state is followed by 2 pointers : gem_state <*GemCache> <*GemState> If I replace in my code GetPointer(argv[0]) by GetPointer(argv[1]), everything is ok. J.Y.
Thomas Grill a écrit :
Hi, it would be useful to know in which way your code doesn't do what you want. Does it compile or not, are there runtime problems, does it crash? gr~~~
Am 19.02.2009 um 14:25 schrieb Jean-Yves Gratius:
Hi, I'm triing to write a flext external thats reads a gem_state struct. I 'd like to access the pixBlock data. I wrote the following method ( registered as FLEXT_ADDMETHOD_(0,"gem_state", gem_state) ) I don't know where I am wrong in my code.... any hint ? thanks, Jean-Yves
void my_flext_external::gem_state(int argc, t_atom *argv) { GemState *my_pointer; if (CanbePointer(argv[0])) { my_pointer = (GemState *) GetPointer(argv[0]); // retrieve gem pointer if (!my_pointer) { post ("no pixblock !"); return; } else { //accessing to fields post ("dirty field = %d", my_pointer->dirty); post ("inDisplayList field = %d", my_pointer->inDisplayList); post ("lighting field = %d", my_pointer->lighting); post ("texture field = %d", my_pointer->texture); post ("*image field = %d", my_pointer->image); post ("*texCoords field = %d", my_pointer->texCoords); post ("multiTexUnits field = %d", my_pointer->multiTexUnits); // etc... }
}
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.0.237 / Virus Database: 270.11.1/1960 - Release Date: 02/19/09 10:48:00
so this means, I can write gem externals using flext? are there examples/documentation around? thanks! marius.
2009/2/20 Jean-Yves Gratius jygratius@club.fr:
Hi Thomas, oups sorry, I forgot to describe my problem. yes it compiled, didn't crash. it just sended data that didn't correpond to the gem_state struct. Indeed i found my error: I read that gem_state is followed by 2 pointers : gem_state <*GemCache> <*GemState> If I replace in my code GetPointer(argv[0]) by GetPointer(argv[1]), everything is ok. J.Y.
Thomas Grill a écrit :
Hi, it would be useful to know in which way your code doesn't do what you want. Does it compile or not, are there runtime problems, does it crash? gr~~~
Am 19.02.2009 um 14:25 schrieb Jean-Yves Gratius:
Hi, I'm triing to write a flext external thats reads a gem_state struct. I 'd like to access the pixBlock data. I wrote the following method ( registered as FLEXT_ADDMETHOD_(0,"gem_state", gem_state) ) I don't know where I am wrong in my code.... any hint ? thanks, Jean-Yves
void my_flext_external::gem_state(int argc, t_atom *argv) { GemState *my_pointer; if (CanbePointer(argv[0])) { my_pointer = (GemState *) GetPointer(argv[0]); // retrieve gem pointer if (!my_pointer) { post ("no pixblock !"); return; } else { //accessing to fields post ("dirty field = %d", my_pointer->dirty); post ("inDisplayList field = %d", my_pointer->inDisplayList); post ("lighting field = %d", my_pointer->lighting); post ("texture field = %d", my_pointer->texture); post ("*image field = %d", my_pointer->image); post ("*texCoords field = %d", my_pointer->texCoords); post ("multiTexUnits field = %d", my_pointer->multiTexUnits); // etc... }
}
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.0.237 / Virus Database: 270.11.1/1960 - Release Date: 02/19/09 10:48:00
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
2009/2/20 marius schebella marius.schebella@gmail.com:
so this means, I can write gem externals using flext? are there examples/documentation around?
I'd think that you just have to include the relevant GEM header files to know what's behind the pointers. I'm not sure however whether you need to access functionality that is inside the GEM library and which is not exported. That would be a problem. gr~~~
Hi, thank, that's valuable feedback... i don't think anyone has used Pd pointers in flext before. gr~~~
2009/2/20 Jean-Yves Gratius jygratius@club.fr:
Hi Thomas, oups sorry, I forgot to describe my problem. yes it compiled, didn't crash. it just sended data that didn't correpond to the gem_state struct. Indeed i found my error: I read that gem_state is followed by 2 pointers : gem_state <*GemCache> <*GemState> If I replace in my code GetPointer(argv[0]) by GetPointer(argv[1]), everything is ok. J.Y.
Thomas Grill a écrit :
Hi, it would be useful to know in which way your code doesn't do what you want. Does it compile or not, are there runtime problems, does it crash? gr~~~
Am 19.02.2009 um 14:25 schrieb Jean-Yves Gratius:
Hi, I'm triing to write a flext external thats reads a gem_state struct. I 'd like to access the pixBlock data. I wrote the following method ( registered as FLEXT_ADDMETHOD_(0,"gem_state", gem_state) ) I don't know where I am wrong in my code.... any hint ? thanks, Jean-Yves
void my_flext_external::gem_state(int argc, t_atom *argv) { GemState *my_pointer; if (CanbePointer(argv[0])) { my_pointer = (GemState *) GetPointer(argv[0]); // retrieve gem pointer if (!my_pointer) { post ("no pixblock !"); return; } else { //accessing to fields post ("dirty field = %d", my_pointer->dirty); post ("inDisplayList field = %d", my_pointer->inDisplayList); post ("lighting field = %d", my_pointer->lighting); post ("texture field = %d", my_pointer->texture); post ("*image field = %d", my_pointer->image); post ("*texCoords field = %d", my_pointer->texCoords); post ("multiTexUnits field = %d", my_pointer->multiTexUnits); // etc... }
}
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.0.237 / Virus Database: 270.11.1/1960 - Release Date: 02/19/09 10:48:00