Hi. I am running on a macbook pro with these specs:
Hardware Overview:
Model Name: MacBook Pro
Model Identifier: MacBookPro5,5
Processor Name: Intel Core 2 Duo
Processor Speed: 2.26 GHz
Number Of Processors: 1
Total Number Of Cores: 2
L2 Cache: 3 MB
Memory: 2 GB
Bus Speed: 1.07 GHz
NVIDIA GeForce 9400M:
Chipset Model: NVIDIA GeForce 9400M
Type: GPU
Bus: PCI
VRAM (Total): 256 MB
Vendor: NVIDIA (0x10de)
Device ID: 0x0863
Revision ID: 0x00b1
ROM Revision: 3427
Displays:
Color LCD:
Resolution: 1280 x 800
Pixel Depth: 32-Bit Color (ARGB8888)
Main Display: Yes
Mirror: Off
Online: Yes
Built-In: Yes
Display Connector:
Status: No Display Connected
I am experiencing slow down after drawing about 2300 16x16 pixel tiles to the screen. I wanted to know if this is normal. Is there anything I can do to speed this up?
This is the code im using right now. Im looping through all the tiles that need drawn and doing this for each one.
Image *src = tileLayers->image;
int left = tile->tx;
int right = left + 16;
int top = tile->ty;
int bottom = tile->ty + 16;
Sprite sprite;
sprite.SetImage(*src);
sprite.SetSubRect(IntRect( left, top, right, bottom));
sprite.SetX(tile->x*PTM_RATIO);
sprite.SetY(tile->y*PTM_RATIO);
renderWindow->Draw(sprite);
Is there a better way to do this? Would it be faster to draw everything to an image and then just call RenderWindow::Draw() once?
My time profiler tells me im spending
15.4% of my time in glrCompExecuteKernel
10.1% in gldCopyTexSubImage
6.2% in gleUpdateDeferredState
3.4% in gleUpdateFragmentStateProgram
Any help is very appreciated. Thx =)