//this is actually the core renderloop for the whole demo. PixelArray *Scene::Render(float ftime) { Timer::Update(); //Update global timer. //sett spole timer her: Timer::SetTime(ftime); float time = Timer::GetTime(); //PRACHK! clear_zbuffer(); for (int i=0; iRun(time)) //if true then draw { effects[i]->ProcessEffectChanges(); //todo: blendmodes and overdraw stuff.. effects[i]->Draw(); //draw each effect first //in each pass we overdraw the framebuffer with the chosen blendmode if (effects[i]->GetBlendMode() == BLENDMODE_NORMAL) frameBuffer.Copy(this->GetEffect(i)); if (effects[i]->GetBlendMode() == BLENDMODE_ADDITIVE) frameBuffer.BlendAdd(this->GetEffect(i), this->GetEffect(i)->varBlend); if (effects[i]->GetBlendMode() == BLENDMODE_SUBTRACTIVE) frameBuffer.BlendSub(this->GetEffect(i), this->GetEffect(i)->varBlend); if (effects[i]->GetBlendMode() == BLENDMODE_ALPHA) frameBuffer.BlendAlpha(this->GetEffect(i), this->GetEffect(i)->varBlend); if (effects[i]->GetBlendMode() == BLENDMODE_INVERT) frameBuffer.Invert(&this->frameBuffer, this->GetEffect(i)->varBlend); if (effects[i]->GetBlendMode() == BLENDMODE_NONZERO) frameBuffer.CopyNonZero(this->GetEffect(i)); } } return &frameBuffer; }