aboutsummaryrefslogtreecommitdiff
path: root/smelt
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2016-05-17 23:49:44 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2016-05-17 23:49:44 +0800
commitd961ae306461e1606d37539f512a5d907490531b (patch)
tree346b7c15df4cd50a16e38594063e25b25cb22a30 /smelt
parent3b2a801f86f4ce7cdca8681b619fe3ff88307ef2 (diff)
downloadSMELT-d961ae306461e1606d37539f512a5d907490531b.tar.xz
Fixed a bug in smColorRGBA.
Fix and modify smMatrix::lookat. Allow disabling z-test in 3d mode. Add smvec4d.
Diffstat (limited to 'smelt')
-rw-r--r--smelt/sdl/gfx_sdl.cpp6
-rw-r--r--smelt/sdl/smelt_internal.hpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/smelt/sdl/gfx_sdl.cpp b/smelt/sdl/gfx_sdl.cpp
index 1c8545f..ae50db2 100644
--- a/smelt/sdl/gfx_sdl.cpp
+++ b/smelt/sdl/gfx_sdl.cpp
@@ -47,7 +47,7 @@ bool SMELT_IMPL::smRenderBegin2D(bool ztest,SMTRG trg)
vertexArray=vertexBuf;
return true;
}
-bool SMELT_IMPL::smRenderBegin3D(float fov,SMTRG trg)
+bool SMELT_IMPL::smRenderBegin3D(float fov,bool ztest,SMTRG trg)
{
TRenderTargetList *targ=(TRenderTargetList*)trg;
if(vertexArray)
@@ -55,8 +55,8 @@ bool SMELT_IMPL::smRenderBegin3D(float fov,SMTRG trg)
if(pOpenGLDevice->have_GL_EXT_framebuffer_object)
pOpenGLDevice->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT,(targ)?targ->frame:0);
pOpenGLDevice->glDepthFunc(GL_LESS);
- pOpenGLDevice->glEnable(GL_DEPTH_TEST);
- zbufenabled=true;
+ ztest?pOpenGLDevice->glEnable(GL_DEPTH_TEST):pOpenGLDevice->glDisable(GL_DEPTH_TEST);
+ zbufenabled=ztest;
if(targ)
{
pOpenGLDevice->glScissor(0,0,targ->w,targ->h);
diff --git a/smelt/sdl/smelt_internal.hpp b/smelt/sdl/smelt_internal.hpp
index f514c54..a14e151 100644
--- a/smelt/sdl/smelt_internal.hpp
+++ b/smelt/sdl/smelt_internal.hpp
@@ -144,7 +144,7 @@ public:
virtual bool smGetInpEvent(smInpEvent *e);
virtual bool smRenderBegin2D(bool ztest=0,SMTRG trg=0);
- virtual bool smRenderBegin3D(float fov,SMTRG trg=0);
+ virtual bool smRenderBegin3D(float fov,bool ztest=0,SMTRG trg=0);
virtual bool smRenderEnd();
virtual void sm3DCamera6f2v(float *pos,float *rot);
virtual void sm2DCamera5f3v(float *pos,float *dpos,float *rot);