PDA

View Full Version : How to effectively use g_lock starting with 1.12


kornalius
01-16-2007, 09:34 PM
Here is how you can use g_lock to access the screen pixels from an array starting with version 1.12 and beyond. We have made some changes to the way multidimensional arrays are stored in PPL 1.12.</p><pre>***** struct(lockinf$, LockInfo);
***** &amp;lockinf$ = G_Lock(null);
***** pitch$ = lockinf.pitch$ &gt;&gt; 1;
***** SDIM(pixarray$, TShort, 240, 320);
***** ColumnMajor(pixarray$);
***** &amp;pixarray$ = lockinf.pixels$;</pre><pre>***** for (x$, 10, 150)
******* for (y$, 100, 150)
********* pixarray$[x$, y$] = g_rgb(100, 150, 100);
******* end;
***** end;</pre><pre>***** G_Unlock(lockinf$, null, false);
</pre>