- added a software scene drawer to the GL renderer.

It still looks like shit and only works on the modern render path but at least the basics are working.
This commit is contained in:
Christoph Oelckers 2018-04-05 23:08:09 +02:00
commit b34d7f9e08
32 changed files with 564 additions and 297 deletions

View file

@ -73,6 +73,22 @@ FGLTexture::FGLTexture(FTexture * tx, bool expandpatches)
tex->gl_info.SystemTexture[expandpatches] = this;
}
//===========================================================================
//
// Constructor 2 for the SW framebuffer which provides its own hardware texture.
//
//===========================================================================
FGLTexture::FGLTexture(FTexture * tx, FHardwareTexture *hwtex)
{
assert(tx->gl_info.SystemTexture[0] == NULL);
tex = tx;
mHwTexture = hwtex;
lastSampler = 254;
lastTranslation = -1;
tex->gl_info.SystemTexture[0] = this;
}
//===========================================================================
//
// Destructor
@ -82,6 +98,7 @@ FGLTexture::FGLTexture(FTexture * tx, bool expandpatches)
FGLTexture::~FGLTexture()
{
Clean(true);
for (auto & i : tex->gl_info.SystemTexture) if (i == this) i = nullptr;
}
//===========================================================================
@ -174,7 +191,7 @@ const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int transla
int w=0, h=0;
// Create this texture
unsigned char * buffer = NULL;
unsigned char * buffer = nullptr;
if (!tex->bHasCanvas)
{