WINTERMUTE: Implement proper 3d setup function

This commit is contained in:
Gunnar Birke 2020-05-26 13:10:42 +02:00 committed by Paweł Kołodziejski
parent bf43ae1588
commit 1d6a47c8b3
4 changed files with 22 additions and 3 deletions

View file

@ -256,6 +256,11 @@ bool BaseRenderer::setup2D(bool Force) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
bool BaseRenderer::setup3D(Camera3D* camera, bool force) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
bool BaseRenderer::setupLines() {

View file

@ -41,6 +41,7 @@ class BaseActiveRect;
class BaseObject;
class BaseSurface;
class BasePersistenceManager;
class Camera3D;
/**
* @class BaseRenderer a common interface for the rendering portion of WME
@ -120,6 +121,7 @@ public:
virtual bool forcedFlip() = 0;
virtual void initLoop();
virtual bool setup2D(bool force = false);
virtual bool setup3D(Camera3D* camera = nullptr, bool force = false);
virtual bool setupLines();
/**

View file

@ -256,8 +256,20 @@ bool BaseRenderOpenGL3D::setup2D(bool force) {
return true;
}
bool BaseRenderOpenGL3D::setup3D(bool force) {
warning("BaseRenderOpenGL3D::setup3D not yet implemented");
bool BaseRenderOpenGL3D::setup3D(Camera3D* camera, bool force) {
if (!_state3D || force) {
_state3D = true;
glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glAlphaFunc(GL_GEQUAL, 0x08);
// no culling for the moment
glDisable(GL_CULL_FACE);
setProjection();
}
return true;
}

View file

@ -101,7 +101,7 @@ public:
bool forcedFlip() override;
void initLoop() override;
bool setup2D(bool force = false) override;
bool setup3D(bool force = false);
bool setup3D(Camera3D *camera, bool force = false) override;
bool setupLines() override;
/**