M
mindbreaker
Guest
hi,
I have double buffered my paint methodes .
they work like it should be but its really intensive job (CPU and RAM)
Is this just intensive or is my code not good for it ?
the only thing that I know that will make it so intesive is the fact that's it's used in a cycle ( 15 FPS )
this is the code :
Bitmap* pMemoryBMap = new Bitmap(GAME_ENGINE->GetWidth(),GAME_ENGINE->GetHeight());
Graphics* pCanvas = Graphics::FromImage(pMemoryBMap);
x++; //integer, constructor sets it to zero
pCanvas->Clear(Color().White);
SolidBrush b(Color(255,x,0,255-x));
pCanvas->FillRectangle(&b,10,10,1000,1000);
Graphics* pGraphics = new Graphics(GAME_ENGINE->GetWindow());
pGraphics->DrawImage(pMemoryBMap, 0, 0);
CachedBitmap* m_pCachedBitmap = new CachedBitmap(pMemoryBMap, pGraphics);
pGraphics->DrawCachedBitmap(m_pCachedBitmap, 0, 0);
delete pMemoryBMap;
delete pCanvas;
delete m_pCachedBitmap;
thx
VS 2005 (prof) | Vista | C++
Continue reading...
I have double buffered my paint methodes .
they work like it should be but its really intensive job (CPU and RAM)
Is this just intensive or is my code not good for it ?
the only thing that I know that will make it so intesive is the fact that's it's used in a cycle ( 15 FPS )
this is the code :
Bitmap* pMemoryBMap = new Bitmap(GAME_ENGINE->GetWidth(),GAME_ENGINE->GetHeight());
Graphics* pCanvas = Graphics::FromImage(pMemoryBMap);
x++; //integer, constructor sets it to zero
pCanvas->Clear(Color().White);
SolidBrush b(Color(255,x,0,255-x));
pCanvas->FillRectangle(&b,10,10,1000,1000);
Graphics* pGraphics = new Graphics(GAME_ENGINE->GetWindow());
pGraphics->DrawImage(pMemoryBMap, 0, 0);
CachedBitmap* m_pCachedBitmap = new CachedBitmap(pMemoryBMap, pGraphics);
pGraphics->DrawCachedBitmap(m_pCachedBitmap, 0, 0);
delete pMemoryBMap;
delete pCanvas;
delete m_pCachedBitmap;
thx
VS 2005 (prof) | Vista | C++
Continue reading...