Problem using large offscreen context

Hi!

I have a problem using offscreen context.

I use PdCreateOffscreenContext to get a memory area in the video ram (there
is enough space).
For Example: 800 x 50 dots.
When the width of the OffscreenContext is smaller than the screen resolution
(ie. 800 dots) everything works fine.
But when I get a OffscreenContext with more than this assumed 800 dots, and
I Blit the right end to the display there is snow visible from the context
area larger than 800 dots. (not always but often). Changing resolution and
color depth of the display don’t change anything.

Question: How can I get a OffscreenContext larger than the screen resolution
width?

I try to build a ticker application and I need this larger offscreen context
for performance reasons.

Thanx in advance.

Mike

Hello Michael

Would it be possible for you to send me an sample application that shows
this problem?

Thanks,
Rodney

“Janssen Michael” <janssen.michael@scheidt-bachmann.de> wrote in message
news:ajd7dp$ref$1@inn.qnx.com

Hi!

I have a problem using offscreen context.

I use PdCreateOffscreenContext to get a memory area in the video ram
(there
is enough space).
For Example: 800 x 50 dots.
When the width of the OffscreenContext is smaller than the screen
resolution
(ie. 800 dots) everything works fine.
But when I get a OffscreenContext with more than this assumed 800 dots,
and
I Blit the right end to the display there is snow visible from the context
area larger than 800 dots. (not always but often). Changing resolution and
color depth of the display don’t change anything.

Question: How can I get a OffscreenContext larger than the screen
resolution
width?

I try to build a ticker application and I need this larger offscreen
context
for performance reasons.

Thanx in advance.

Mike

Hello Rodney,

I am not able to reach you directly, so I post my answer in the newsgroup.


here is a very basic version of my ticker. (see below)

This function runs in a thread. Starting it with a screen resolution of 1024
x 768 dots it works fine, but when I start it with a screen resolution of
800 x 600 the last 100 dots (the overhead) are ‘snow’.
The base widget of this application is a window without header and border.

I hope thats all you need.
Thanx.

Cheers
Michael



void vtickerScroll() /* scrolls continously */
{
Boolean bScroll = XTRUE;

PhArea_t offscreenSrcArea; /* offscreen area for copy to display /
PhArea_t displayDstArea; /
display position for copy from offscreen */

int overhead;
int fullWidth;
int windowWidth;

PdOffscreenContext_t *context;

overhead = 100;
windowWidth = 800;
fullWidth = (windowWidth + overhead);


context = PdCreateOffscreenContext(0, fullWidth, 50, 0);
if (context == NULL)
{
printf(" vtickerScroll - Error by creation of OffscreenContext\n");
}


/* Source Area in the offscreen context /
offscreenSrcArea.pos.x = 0;
offscreenSrcArea.pos.y = 0;
offscreenSrcArea.size.w = fullWidth;
offscreenSrcArea.size.h = 50;


/
destination position on our window on the display /
displayDstArea.pos.x = windowWidth;
displayDstArea.pos.y = 0;
displayDstArea.size.w = fullWidth;
displayDstArea.size.h = 50;



PhDCSetCurrent(context); /
switch current context to offscreen /


while (bScroll == XTRUE) /
scroll until scrolling should stop /
{
displayDstArea.pos.x = windowWidth; /
set back to startposition /

PgSetFillColor(Pg_DBLUE); /
set fill color for background /
PgDrawIRect( 0, 0, fullWidth, 50, Pg_DRAW_FILL); /
draw full size
rectangle /

/
draw the ticker text here /

// scroll untill overhead of offscreen buffer is completly used
while (displayDstArea.pos.x > (-1 * overhead))


displayDstArea.pos.x = displayDstArea.pos.x - 1;


/
display context area on the display /
PgContextBlitArea(context, &offscreenSrcArea, NULL, &displayDstArea);

delay(10);
}
// End of one loop reached
}

PhDCRelease(context);

} /

/
/
**************************************************************************
******************************/
/
eof (ticker_scroll.c) ***/