arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

StupidCrank.cpp

Go to the documentation of this file.
00001 //------------------------------------------------------------------------
00002 //
00003 //   Joe Kniss
00004 //     3-20-03
00005 //                   ________    ____   ___ 
00006 //                  |        \  /    | /  /
00007 //                  +---+     \/     |/  /
00008 //                  +--+|  |\    /|     < 
00009 //                  |  ||  | \  / |  |\  \ 
00010 //                  |      |  \/  |  | \  \ 
00011 //                   \_____|      |__|  \__\
00012 //                       Copyright  2003 
00013 //                      Joe Michael Kniss
00014 //                   <<< jmk@cs.utah.edu >>>
00015 //               "All Your Base are Belong to Us"
00016 //-------------------------------------------------------------------------
00017 
00018 /// StupidCrank.cpp /// so stupid, I couldn't even match the .h and .cpp names!
00019 
00020 #include "CrankStupid.h"
00021 
00022 using namespace glift;
00023 
00024 glift::PixelShaderSP StupidFPCrank::getPixelShader()
00025 {
00026    if(!mpsChanged()) return _lastPS;
00027 
00028    MetaProgSPVecIter mpi = _mprogs.begin();
00029    
00030    std::ostringstream text;
00031    text << "!!ARBfp1.0\n\n";
00032    
00033    while(mpi != _mprogs.end())
00034    {
00035       if((*mpi).isNull()) continue;
00036       
00037       text << (*mpi);
00038       
00039       ++mpi;
00040    }
00041 
00042    text << "\n\nEND\n\n";
00043 
00044    glift::FragProgARB *fp = dynamic_cast<FragProgARB*>(_lastPS.getPtr());
00045 
00046    if(!fp)
00047    {
00048       fp = new glift::FragProgARB(text.str().c_str());
00049       _lastPS = fp;
00050    }
00051    else
00052    {
00053       fp->reload(text.str().c_str());
00054    }
00055 
00056    return _lastPS;
00057 }

Send questions, comments, and bug reports to:
jmk