Hello,
I am still having problems with my program, inside my display.h
private:
TUint8* iScreenAdr;
CFbsBitmap* iOffScreenBmp;
CFbsScreenDevice* iScreenDevice;
CFbsBitGc* iGc;
#endif
inside my engine,
void Test::Setup()
{
iOffScreenBmp = new (ELeave) CFbsBitmap;
iOffScreenBmp->Create(TSize(176,208), EColor4K);
iScreenDevice = CFbsScreenDevice::NewL(_L(""😉, EColor4K, TRgb(255,255,255));
iScreenDevice->ChangeScreenDevice(NULL);
iScreenDevice->SetAutoUpdate(EFalse);
iScreenAdr = (TUint8*)iOffScreenBmp->DataAddress();
iScreenDevice->CreateContext(iGc);
}void Test::TryIt()
{
TUint16* ptr = (TUint16*)iScreenAdr;
for(TInt k = 0; k < 208*176; k++)
{
*ptr++ = 0x0afe; // it crashes in here because it seems like iScreenAdr points
// to TUint8 [208*176] instead of
// TUint16[208*176]; :icon13:
}
// It never reaches here.
CConsoleBase*cons=Console::NewL(_L("a"😉, TSize(-1,-1));
cons->Printf(_L("here"😉);
cons->Getch();
delete cons;
}
As indicated above it crashes inside of the function Test::TryIt(), when I change ptr to TUint8* ptr = iScreenAdr; it works just fine, but it doesn't cover the hole device
Emu Image------------------- I made the following changes to the code ------------------------
void Test::Setup()
{
iOffScreenBmp = new (ELeave) CFbsBitmap;
iOffScreenBmp->Create(TSize(4*176,4*208), EColor4K);
iScreenDevice = CFbsScreenDevice::NewL(_L(""😉, EColor4K, TRgb(255,255,255));
iScreenDevice->ChangeScreenDevice(NULL);
iScreenDevice->SetAutoUpdate(EFalse);
iScreenAdr = (TUint8*)iOffScreenBmp->DataAddress();
iScreenDevice->CreateContext(iGc);
}
void Test::TryIt()
{
TUint16* ptr = (TUint16*)iScreenAdr;
for(TInt k = 0; k < 2*208*2*176; k++)
{
*ptr++ = 0x9afe; // this does NOT crash now!! unless I change loop to
// 4 * 208 * 4 * 176. strange
}
}
This almost works, it fills most of the screen although there are still some gaps there
Emu Image ,
why do I have to multiply screen width/depth by 4 iOffScreenBmp->Create(TSize(
4*176,
4*208), EColor4K);
What do you think is going on here? Why don't you have to go through all this on your software?
I'm running Symbian 7.0s SDK on windows 2000 pro.
Thanks,
Erica