PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Gapi and buffers

Im creating a unsigned short* buffer[320*240], and the anothe with 100* 100 dimensions.

I read a tga into the 100*100 buffer and all is fine

my problem is that when i write this to the 320*240 buffer at 0,0 it appears as interlaced for the length of the screen when i blit the buffer using gapi.

I have set a loop that should copy the pixels from one to the other with the width of the 100 as a pitch

not sure if this makes sense, but im sure somebody else has had this problem and any help would be appreciated.
hi lamondo,

Different devices have differently arranged video memory. You need to get that information from GAPI.

I suggest you take a look at one of the game APIs hosted on Pocketmatrix, like Overloaded, PocketFrog or GapiDraw to see how this is done.

cryo
will do.
i am using an ipaq 3660.
i have looked at easy ce and the sprite stuff that uses..that works,and it seems to set thhings as i have done but i dont get the same output.

thanks for your help
then post your source code here, i'm sure the PM collective will spot the problem in no time.

cryo
here is the basis of code using the easy ce sprite
the only difference is im creating a buffer called disp rather than the update buffer.

Code:
unsigned short* sprdat = new PIXEL[100 * 100];
unsigned short* disp = new PIXEL[320*240]

ATgaFile::load( L"test.tga", 100, 100, sprdat )
sprite = new ASprite( 100, 100, 100, sprdat );
sprite->setflags(SPR_OPAQUE );
sprite->settarget((unsigned short*)disp );
sprite->setpos( 0, 0 );
sprite->draw();


Im using memcpy to copy disp to the screen in GApi
you can't just memcpy the back buffer to the screen, at least not on an 3660 iPAQ. Why don't you just use the update() method in EasyCE?

cryo
I used EasyCE for reference and i wish to build things myself not because i think im better but because i wish to learn

also when i use a loop for x and y i seem to get the drawing 320 * 240 rather than the othe way around

im so used to opengl and d3d that having to do stuff in software is confusing but its great as it destroys the head and nothing is better
The iPaq 36xx's display is actually oriented horizontally in landscape fashion. The origin is the bottom left of the display when the device is held normally. I would strongly recommend you take a look at existing blitting routines that blit to the hardware buffer based off of the display properties. Attempting to write a set of graphic primitives or blit routines for small regions would be an ambitious undertaking, assuming your goal is to provide routines that will support all the different display properties. Generally all drawing is done to a standardized buffer (ie 240x320), then that buffer is blitted to the display with a routine optimized for the display properties.

Dan East
thanks
ill do just that
is easyce the best for looking at these things.?