From d961ae306461e1606d37539f512a5d907490531b Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Tue, 17 May 2016 23:49:44 +0800 Subject: Fixed a bug in smColorRGBA. Fix and modify smMatrix::lookat. Allow disabling z-test in 3d mode. Add smvec4d. --- smelt/sdl/gfx_sdl.cpp | 6 +++--- smelt/sdl/smelt_internal.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'smelt') 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); -- cgit v1.2.3