Hi,
I've being playing around with rotations of 90,180 and 270 degrees to rotate the display.
I have come up with the following two methods. On my spv c600 I get 180fps while clearing the screen and printing fps in 90degrees. In 180 degrees I get 190fps doing the same. Is there anyway to speed this up? I have run out of ideas and it makes me wonder as GAPIDRAW state they can rotate the screen with no performance loss. I also read about cache misses but I dont fully understand this and wondered if this is being effected by them?
90 degree
180 degree
Any help appreciated
thanks
Mike
I've being playing around with rotations of 90,180 and 270 degrees to rotate the display.
I have come up with the following two methods. On my spv c600 I get 180fps while clearing the screen and printing fps in 90degrees. In 180 degrees I get 190fps doing the same. Is there anyway to speed this up? I have run out of ideas and it makes me wonder as GAPIDRAW state they can rotate the screen with no performance loss. I also read about cache misses but I dont fully understand this and wondered if this is being effected by them?
90 degree
- Code:
USHORT* p = (USHORT*)m_rfbi.pFramePointer;
int wid = m_windowHeight;
int hi = m_windowWidth;
int start1 = wid;
int loopX = 0;
USHORT* buffer = m_screenBuffer;
//Rotate one pixel at a time
for (int x=wid;x!=0;--x)
{
for(int y=hi;y!=0;--y)
{
p[start1-loopX]=*(buffer);
start1+=wid;
++buffer;
}
start1=wid;
++loopX;
}
180 degree
- Code:
int end = m_windowArea;
USHORT* buffer = m_screenBuffer;
USHORT* p = (USHORT*)m_rfbi.pFramePointer;
p+=end;
for(int i=m_windowHeight; i !=0; --i)
{
for(int j=m_windowWidth; j !=0; --j)
{
*(p) = *(buffer);
++buffer;
--p;
}
}
Any help appreciated
thanks
Mike