Yes, good point Dan. memset is filling on a per-byte basis and if your upper byte isn't the same as your lower byte then you're hosed.<br><br>BTW, you've got a typo in that source you've posted:<br><br>couplet<<16;<br><br>should be<br><br>couplet<<=16;<br><br>
How about this? This assumes PIXEL is two bytes:<br>[fixed]<br>void clear(PIXEL color) {<br> unsigned int couplet=color;<br> couplet<<=16;<br> couplet|=color;<br><br> unsigned int *cur=(unsigned int *)getbuffer();<br> unsigned int *end=cur+<br> (320*240*sizeof(color))/sizeof(unsigned int);<br><br> while (cur<end)<br> *cur++=couplet;<br>}[/fixed]<br><br>Dan East<br>You would normally see "Last modification..." here, but I'm hiding it from you. [color=#3366cc]Last modification: Dan East - 12/14/01 at 11:31:02
Thanks Digby! Those types of errors really suck. I don't know if eVC++ would give you a "this operator has no effect" warning or not.<br><br>The sample code has been corrected...<br><br>Dan East
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum