X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftests.cpp;h=8e24bb52facc436a0a75451a57726737a574bb22;hp=a741b268a998dd31aa425f7df2f647a3095ab2b2;hb=6a832fe1771f8c7bca0faa0d383fbbab062a1c56;hpb=f17794d55923d4fb4f63e9d082d8d84a735a04e8 diff --git a/source/tests.cpp b/source/tests.cpp index a741b268..8e24bb52 100644 --- a/source/tests.cpp +++ b/source/tests.cpp @@ -1,46 +1,8 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007, 2010 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include "tests.h" namespace Msp { namespace GL { -AlphaTest::AlphaTest(): - pred(ALWAYS), - ref(0) -{ } - -AlphaTest::AlphaTest(Predicate p, float r): - pred(p), - ref(r) -{ } - -void AlphaTest::bind() const -{ - if(set_current(this)) - { - glEnable(GL_ALPHA_TEST); - glAlphaFunc(pred, ref); - } -} - -void AlphaTest::unbind() -{ - if(set_current(0)) - glDisable(GL_ALPHA_TEST); -} - -void alpha_func(Predicate func, float ref) -{ - glAlphaFunc(func, ref); -} - - DepthTest::DepthTest(): write(true), pred(LESS) @@ -70,12 +32,11 @@ const DepthTest &DepthTest::lequal() void DepthTest::unbind() { if(set_current(0)) + { glDisable(GL_DEPTH_TEST); -} - -void depth_func(Predicate func) -{ - glDepthFunc(func); + // Allow glClear(GL_DEPTH_BUFFER_BIT) to work + glDepthMask(true); + } } @@ -108,10 +69,5 @@ void ScissorTest::unbind() glDisable(GL_SCISSOR_TEST); } -void scissor(int left, int bottom, unsigned width, unsigned height) -{ - glScissor(left, bottom, width, height); -} - } // namespace GL } // namespace Msp