Пример #1
0
void Template::OnDraw(){
    static int coldelta = 0;

    CMainCanvas* m_pMainCanvas = Master()->GetMainCanvas();
    m_pMainCanvas->Lock();

    //m_pMainCanvas->Blit( m_pMainCanvas->GetDimension(), *m_pBackground,
    // m_pBackground->GetDimension() );
    m_pBackground->RenderCopy();
    CRectangle frect(700, 500, 185, 185);
    SDL_Color* wavemap = ColorData::Instance()->Wavemap();
    int index = (coldelta * 2 & 63);

    //m_pMainCanvas->FillRect( frect, mcol );
    SDL_Color& fcol = wavemap[index];
    CColor color = CColor(fcol.r, fcol.g, fcol.b);
    m_pMainCanvas->RenderFillRect( frect, &color );
    //m_pMainCanvas->AddUpdateRect(frect);

    CRectangle dstDims( 0, 0, 200, 200);
    //m_pScrollText->RenderPut(m_pBackground.get(), dstDims, dstDims );
    //m_pMainCanvas->AddUpdateRect(dstDims);
    m_pScroller->Render();

    coldelta++;

    if (coldelta > 64) {
        coldelta = 0;
    }

    //controls::CControl::Redraw();
    m_pOverlay->Draw();
    m_pMainCanvas->Unlock();
}   // OnDraw
Пример #2
0
  /** TestScreen, OnDraw:
   *  Detailed description.
   *  @return TODO
   */
  void TestScreen::OnDraw(){
      static int coldelta = 0;

      CMainCanvas* m_pMainCanvas = Master()->GetMainCanvas();
      m_pMainCanvas->Lock();

      m_pMainCanvas->Blit( m_pMainCanvas->GetDimension(), *m_pBackground, m_pBackground->GetDimension() );
      CRectangle frect(700, 500, 185, 185);
      SDL_Color* wavemap = ColorData::Instance()->Wavemap();
      int index = (coldelta * 2 & 63);

      //m_pMainCanvas->FillRect( frect, mcol );
      SDL_Color& fcol = wavemap[index];
      m_pMainCanvas->FillRect( frect, CColor(fcol.r, fcol.g, fcol.b) );
      m_pMainCanvas->AddUpdateRect(frect);

      CRectangle dstDims( 0, 0, 200, 200);
      m_pScrollText->Put(m_pBackground.get(), dstDims, dstDims );
      m_pMainCanvas->AddUpdateRect(dstDims);

      coldelta++;

      if (coldelta > 64) {
          coldelta = 0;
      }

      m_pMainCanvas->Unlock();
  } // OnDraw