This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Functions List


Functions List

Postby WauloK » Jun 10, 2005 @ 12:38am

There doesn't seem to be much of a function list with descriptions on how to use them, so I've been looking through demo code and the PF code itself to try and figure out how it all works. I've listed below the stuff I've figured out. Please post any corrections and additions.

Delay:
Sleep(10); // Sleep 10 (microseconds?)

Reseed randomizer:
srand(PocketPC::GetTickCount());

Get Random Number:
x=rand()%5; // Random number 0-4

Before using display functions, set up display pointer:
Display* display=GetDisplay();

Get Display size:
dWidth=display->GetWidth();
dHeight=display->GetHeight();

Clear Display to color:
display->Clear(Color(0,0,0)); // Color black. Color function numbers are R,G,B = Red,Green,Blue

Draw Circle:
display->DrawCircle(120,160,80,Color(255,0,0)); //Red
ie.
display->DrawCircle(Point,radius,color) OR
display->DrawCircle(x,y,radius,color)

Draw Filled Rectangle:
display->FillRect(Rect(0,299,240,319),0xffff); // Cyan
OR
display->FillRect(x1,y1,x2,y2,color)

** Colors can be in hex (eg 0xffffff = white) or in RGB format (255,255,255 = white?)

Draw a pixel:
display->SetPixel(x,y,Color)
display->SetPixel(Point,color); // not sure how to set point yet
Possibly:
Point& spot;
spot.x=10; spot.y=20; // Don't quote me on this ;)

Draw a line:
display->DrawLine(x1,y1,x2,y2,color);
** These functions can use Point as well. I dont know how

Draw Horizontal Line (presumably faster than above function):
display->DrawHLine(x,y,length,color); // x,y is top. Draws right?

Draw Vertical Line (ditto):
display->DrawVLine(x,y,length,color); // Draws down?

Draw Polygons:
display->DrawPoly(points[],numberofpoints,color); // need example code for creating point array

display->FillPoly(points[],numberofpoints,color); // ditto

Get color of pixel:
display->GetPixel(x,y);

display->SetBlending(x); // x=0 transparent. x=255 opaque

display->SetClipping(Rect); // Rectangle defined for clipping drawing

display->SetDefaultShader(); // resets to the default shader
** Not sure about shader use yet.

display->BlitRotated(x,y,angle,surface); // Draw an image rotated 'angle' degrees on a surface

display->BlitStretched(Rect,surface,source,Rect); // Not sure about this one yet. Stretches an image to fit a surface.

display->BitRotatedStretch(x,y,angle,surface,destSurface,Rect); // Draw an image rotated 'angle' degrees from a surface onto another surface 'destSurface', stretched to fit the new surface.

There's much more, of course, but I don't want to post what Conan's done on his site. Not sure how to get sytlus x,y coordinates, but I think it's something to do with a point. eg. stylus.x,stylus.y if 'stylus' is defined as a Point. eg:
void BlitSample::StylusDown( Point stylus )
Half-ten? Half-ten?
I've never been up at Half-ten.
What happens?

HP iPaq 4150 (WM2003) & Motorola A1000 (Symbian UIQ)
WauloK
pm Member
 
Posts: 14
Joined: Jun 9, 2005 @ 11:32am
Location: Gold Coast, Aussieland


Postby fast_rx » Jun 10, 2005 @ 3:20am

User avatar
fast_rx
pm Member
 
Posts: 660
Joined: Jun 10, 2003 @ 4:24pm


Postby WauloK » Jun 10, 2005 @ 5:49am

Half-ten? Half-ten?
I've never been up at Half-ten.
What happens?

HP iPaq 4150 (WM2003) & Motorola A1000 (Symbian UIQ)
WauloK
pm Member
 
Posts: 14
Joined: Jun 9, 2005 @ 11:32am
Location: Gold Coast, Aussieland


Postby fzammetti » Jun 10, 2005 @ 5:56am

...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby WauloK » Jun 10, 2005 @ 6:05am

Half-ten? Half-ten?
I've never been up at Half-ten.
What happens?

HP iPaq 4150 (WM2003) & Motorola A1000 (Symbian UIQ)
WauloK
pm Member
 
Posts: 14
Joined: Jun 9, 2005 @ 11:32am
Location: Gold Coast, Aussieland


Re: Functions List

Postby BIGBEN » Jun 10, 2005 @ 6:36am

User avatar
BIGBEN
pm Member
 
Posts: 281
Joined: Mar 18, 2003 @ 10:18pm
Location: Saint-Petersburg, Russia


Re: Functions List

Postby WauloK » Jun 10, 2005 @ 7:20am

Half-ten? Half-ten?
I've never been up at Half-ten.
What happens?

HP iPaq 4150 (WM2003) & Motorola A1000 (Symbian UIQ)
WauloK
pm Member
 
Posts: 14
Joined: Jun 9, 2005 @ 11:32am
Location: Gold Coast, Aussieland


Re: Functions List

Postby BIGBEN » Jun 10, 2005 @ 7:30am

User avatar
BIGBEN
pm Member
 
Posts: 281
Joined: Mar 18, 2003 @ 10:18pm
Location: Saint-Petersburg, Russia


Postby fast_rx » Jun 10, 2005 @ 2:08pm

User avatar
fast_rx
pm Member
 
Posts: 660
Joined: Jun 10, 2003 @ 4:24pm


Return to PocketFrog & PocketHAL


Sort


Forum Description

SDKs for fast and robust device-independent access to Pocket PC display hardware.

Moderators:

sponge, Kzinti

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron