I found that the drawPixel function for Burnings is going directly to the backBuffer rather than via the render target. This doesn't look consistent with the other drivers. I've shown OpenGL below, and it looks like the drawPixel goes to the render target.
Burnings (CSoftwareDriver2.cpp, line 2267):
Code: Select all
void CBurningVideoDriver::drawPixel(u32 x, u32 y, const SColor & color)
{
BackBuffer->setPixel(x, y, color, true);
// Should probably be the following:
// if ( x < RenderTargetSize.Width && y < RenderTargetSize.Height )
//RenderTargetSurface->setPixel(x, y, color, true);
}
Code: Select all
void COpenGLDriver::drawPixel(u32 x, u32 y, const SColor &color)
{
const core::dimension2d<u32>& renderTargetSize = getCurrentRenderTargetSize();
if (x > (u32)renderTargetSize.Width || y > (u32)renderTargetSize.Height)
return;
disableTextures();
setRenderStates2DMode(color.getAlpha() < 255, false, false);
glBegin(GL_POINTS);
glColor4ub(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha());
glVertex2i(x, y);
glEnd();
}
I just wanted consistency across drivers.
There are also some other spots in Burnings where the Backbuffer is directly accessed rather than via the render target, such as the next function: draw2DRectangle(SColor color, const core::rect<s32>& pos, const core::rect<s32>* clip) on line 2275.
Notably, though, the drawRectangle with all of the colors (up-left, down-right, etc) goes to the render target. It's code, however, seems rather inefficient, so I plan on re-writing it, and I may post the code here later (if I get it to work, lol). Just musing....
Edit: Now that I see it, what if you try calling the setPixel( renderTarget width, renderTarget height ) for OpenGL? Wouldn't that crash or do the pixel indices start at (1,1)?