From: Toby C. <th...@us...> - 2007-11-28 19:38:19
|
Update of /cvsroot/playerstage/code/player/examples/plugins/opaquedriver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21779/plugins/opaquedriver Modified Files: opaquedriver.cc Log Message: fixed opaque driver example for dynamic memory changes Index: opaquedriver.cc =================================================================== RCS file: /cvsroot/playerstage/code/player/examples/plugins/opaquedriver/opaquedriver.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** opaquedriver.cc 24 Oct 2007 22:32:03 -0000 1.3 --- opaquedriver.cc 29 Nov 2007 03:38:22 -0000 1.4 *************** *** 69,73 **** // This is the structure we want to send ! test_t* mTestStruct; // This is the data we store and send --- 69,73 ---- // This is the structure we want to send ! test_t mTestStruct; // This is the data we store and send *************** *** 103,115 **** { mData.data_count = sizeof(test_t); ! mTestStruct = reinterpret_cast<test_t*>(mData.data); ! mTestStruct->uint8 = 0; ! mTestStruct->int8 = 0; ! mTestStruct->uint16 = 0; ! mTestStruct->int16 = 0; ! mTestStruct->uint32 = 0; ! mTestStruct->int32 = 0; ! mTestStruct->doub = 0; return; --- 103,115 ---- { mData.data_count = sizeof(test_t); ! mData.data = reinterpret_cast<uint8_t*>(&mTestStruct); ! mTestStruct.uint8 = 0; ! mTestStruct.int8 = 0; ! mTestStruct.uint16 = 0; ! mTestStruct.int16 = 0; ! mTestStruct.uint32 = 0; ! mTestStruct.int32 = 0; ! mTestStruct.doub = 0; return; *************** *** 189,199 **** void OpaqueDriver::RefreshData() { ! mTestStruct->uint8 += 1; ! mTestStruct->int8 += 1; ! mTestStruct->uint16 += 5; ! mTestStruct->int16 += 5; ! mTestStruct->uint32 += 10; ! mTestStruct->int32 += 10; ! mTestStruct->doub = sin(mTestStruct->uint8/10.0); // only send the data we need to --- 189,199 ---- void OpaqueDriver::RefreshData() { ! mTestStruct.uint8 += 1; ! mTestStruct.int8 += 1; ! mTestStruct.uint16 += 5; ! mTestStruct.int16 += 5; ! mTestStruct.uint32 += 10; ! mTestStruct.int32 += 10; ! mTestStruct.doub = sin(mTestStruct.uint8/10.0); // only send the data we need to |