I have code that is used to draw on both the screen and surfaces, so I use SetRenderTarget to select the target surface, or bypass it to draw to the screen.
The problem comes in when I have code that uses a surface lock().
I call
which works perfect for drawing to the screen, however, if I have used
The actual screen is still draw to instead of the surface. Any other operations like SetPixel, DrawLine, etc. work correctly when the target is the tempscreen.
I also looked into using a Rasterizer, but there's no way to code it so that either a Rasterizer or Display object can be passed, not to mention it seems as if ->Lock() is not available to a Rasterizer.
Any ideas?
The problem comes in when I have code that uses a surface lock().
I call
- Code:
Display * display= GetDisplay();
display->GetBackBuffer()->Lock(buffer, false);
for(int i=0; i<32; i++)
*( buffer.pixels + i ) = Color(255,0,0);
display->GetBackBuffer()->Unlock();
display->Update();
which works perfect for drawing to the screen, however, if I have used
- Code:
Display * display= GetDisplay();
display->SetRenderTarget(tempscreen);
display->GetBackBuffer()->Lock(buffer, false);
...
The actual screen is still draw to instead of the surface. Any other operations like SetPixel, DrawLine, etc. work correctly when the target is the tempscreen.
I also looked into using a Rasterizer, but there's no way to code it so that either a Rasterizer or Display object can be passed, not to mention it seems as if ->Lock() is not available to a Rasterizer.
Any ideas?