}
private:
+ // Just change the image in some (quick) way to show that it's really being
+ // updated on screen.
+ void UpdateRGB(unsigned char* data, int n)
+ {
+ for ( int y = 0; y < opts.height; ++y )
+ {
+ memset(data, n % 256, 3*opts.width);
+
+ data += 3*opts.width;
+ n++;
+ }
+ }
void OnPaint(wxPaintEvent& WXUNUSED(event))
{
if ( opts.usePaint )
wxStopWatch sw;
for ( int n = 0; n < opts.numIters; n++ )
{
- image.Clear(n % 256);
+ UpdateRGB(image.GetData(), n);
dc.DrawBitmap(image, 0, 0);
}
wxStopWatch sw;
for ( int n = 0; n < opts.numIters; n++ )
{
- const unsigned char c = n % 256;
+ unsigned char c = n % 256;
{
wxNativePixelData::Iterator p(data);
for ( int y = 0; y < opts.height; ++y )
p = rowStart;
p.OffsetY(data, 1);
+ c++;
}
}