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

Clipper in 2.02? Comments and suggestions please


Clipper in 2.02? Comments and suggestions please

Postby Johan » Jul 9, 2003 @ 8:52pm

Johan Sanneblad, M.Sc, Ph.D
GapiDraw Systems Architect
[]
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby ppcStudios » Jul 9, 2003 @ 9:08pm

Sounds great Johan!
G.R. Moore
President/CEO
Pocket PC Studios
www.ppcstudios.com

Image
User avatar
ppcStudios
pm Insider
 
Posts: 744
Joined: Aug 23, 2002 @ 3:53pm
Location: Canfield, Ohio


Postby DillRye » Jul 9, 2003 @ 9:26pm

User avatar
DillRye
pm Insider
 
Posts: 477
Joined: Apr 25, 2002 @ 7:28am
Location: Iowa State University of Eng


Postby 8bit » Jul 9, 2003 @ 10:31pm

8bit
pm Member
 
Posts: 8
Joined: Jul 6, 2003 @ 10:09am
Location: South Africa


Postby fzammetti » Jul 9, 2003 @ 11:23pm

I'm all for native clipping. I got spoiled with PocketFrog having it built-in.

I'm guessing that adding clipping doesn't hurt performance much at all. Doing our own clipping externally doesn't seem to cost very much, I'd bet that doing it internally, and based on the fact that your an optimization monster Johan!, I very much look forward to this.

The idea of a SetViewport function I like a great deal. It's very helpful just to clip to the physical screen, but as an example, my current game would benefit greatly if I could say "ok, clip against this particular RECT until further notice". That would allow me to go directly against backbuffer rather than the temporary surface concept I've been using. I'd bet I would see a frame rate increase if I unbound the frame rate.

By all means, you absolutely have my support! (not as if you needed it, but still :) )
...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 egarayblas » Jul 10, 2003 @ 1:36am

-- home of the think & tap games!
User avatar
egarayblas
pm Insider
 
Posts: 627
Joined: Sep 14, 2002 @ 1:50am
Location: Philippines


Postby bluescrn » Jul 10, 2003 @ 7:56am

User avatar
bluescrn
pm Member
 
Posts: 107
Joined: Jul 6, 2003 @ 4:20pm
Location: Manchester, England


Postby maurice » Jul 10, 2003 @ 8:38am

maurice
pm Member
 
Posts: 37
Joined: Feb 26, 2003 @ 9:08pm
Location: Rotterdam


Postby Johan » Jul 10, 2003 @ 8:58am

Johan Sanneblad, M.Sc, Ph.D
GapiDraw Systems Architect
[]
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby maurice » Jul 10, 2003 @ 9:04am

maurice
pm Member
 
Posts: 37
Joined: Feb 26, 2003 @ 9:08pm
Location: Rotterdam


Postby 8bit » Jul 10, 2003 @ 9:39am

You've got my vote for the GDBLTFAST_CLIP route! One can always complicate things, but I think you should K.I.S.S (Keep It Simple Sam)... :)
8bit
pm Member
 
Posts: 8
Joined: Jul 6, 2003 @ 10:09am
Location: South Africa


Postby Sparkie » Jul 10, 2003 @ 4:29pm

Sparkie
pm Member
 
Posts: 35
Joined: May 7, 2003 @ 2:05pm
Location: Budapest/Hungary


Postby InexorableTash » Jul 10, 2003 @ 6:40pm

I have to admit that I'm a fan of making SetViewport apply to the surface and all subsequent operations to the surface, without requiring additional flags on the calls.

So in Johan's example of a game with smaller viewport for the playing area and an overlayed UI, presumably overlapping the edges of the play area to make it non-rectangular:

surface.SetViewport( CRect(10, 10, 50, 50) );
surface.BltFast( sprite1 );
surface.BltFast( sprite2 );
surface.BltFast( sprite3 );

surface.SetViewport( NULL );
surface.BltFast( ui_overlay );

Requiring the flags on the individual calls doesn't seem like a benefit to me; the perf impact of testing for a clipper inside the Blt functions is infinitesimal compared to the cost of pushing pixels around. It keeps the client code cleaner since the bulk of the game code doesn't even need to be aware that a clipper is being used.

You could imagine taking the GD sprite demo and adding a few lines of code outside the main sprite loop which implement a clipper rect which is moving from frame to frame; it would be nice to be able to simply add that code without modifying any of the rest of the code.
User avatar
InexorableTash
pm Member
 
Posts: 99
Joined: Sep 13, 2002 @ 6:14am


Postby warmi » Jul 10, 2003 @ 6:56pm

I agree with InexorableTash.

This soluton is similar what is used in most of GUI toolkits = some sort of graphics context which is set/reset using its own set of calls and which then gets applied to every graphic call.
warmi
pm Insider
 
Posts: 518
Joined: Aug 24, 2002 @ 8:07am
Location: Chicago USA


Postby CpuWhiz105 » Jul 10, 2003 @ 7:32pm

If you don't stop adding so many good features, I will go crazy waiting for the release! :D I like the idea. Hope GD 2.02 comes out soon.
All men are created equal,
but geeks are a little more equal.
User avatar
CpuWhiz105
pm Member
 
Posts: 39
Joined: Feb 24, 2003 @ 8:33pm
Location: Colorado Springs, CO - U.S.A.


Next

Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

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