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

How do I make a surface manually


How do I make a surface manually

Postby Conan » Jun 15, 2003 @ 4:54pm

I have PocketGL working inside PF.
Currently I copy PocketGLs buffer to PocketFrog's buffer for blitting but I realised (once I heard that another PGL user had pointed PGL to using GapiDraw's back buffer) that I should be doing something similar in PocketFrog to save on a big copy every frame.

The PGL data is created as follows:-
header file has
extern unsigned short VScreen[DISP_X*DISP_Y]
and the PGL cpp has
unsigned short VScreen[DISP_X*DISP_Y]

and what I want to do is get that data blitted without having to lock, copy, blit, unlock in PF as this takes too long

Having spent a couple of hours messing with my code ( & thank goodness I made a backup first ) I still don't see how to get this to happen.
I thought I could get PGL to simply look at PFs back buffer in some way or get PF to treat PGLs data as a surface so it could be blitted but my C++ is letting me down

Does anyone have any suggestions on how to approach this?

thanks in advance
What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Postby fzammetti » Jun 15, 2003 @ 6:22pm

Keep in mind that I'm just thinking out loud without thinking terribly hard about it, or researching in the slightest, so this may be worth less than the electrons used to render it on your screen...

I don't think there's any way, give PF's public interface, that you will be able to do anything but the lock/copy/unlock cycle you are already doing.

I think a minor PF hack might do the trick though, and I *THINK* this may work...

If you modify display.h and make m_backSurface public instead of private, I believe that will give you access to the pointer to the back buffer, and you can then hand that off to PGL to render to. I think that's all that would be required. You will still need to do a lock/unlock at some point to get the pitch to work with, assuming PGL doesn't handle that for you, but that should only have to be done once.

Let me know if that works out. If so, I might be inclined to make that change for the next PF revision as it seems like something that might give everyone more flexibility without breaking anything.
...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 Conan » Jun 16, 2003 @ 2:01pm

What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Postby fzammetti » Jun 16, 2003 @ 3:57pm

...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


clipping, learning curve etc

Postby Conan » Jun 17, 2003 @ 5:59pm

What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Postby fzammetti » Jun 18, 2003 @ 12:20am

...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 Conan » Jun 18, 2003 @ 8:38am

ok, when time allows I will have a look however I use the line hline vline & circle functions so if GD does not already have them I will need to port.

With the reference to a possible PF2 coming along there is the possibility of not needing to change of course.
What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Postby fzammetti » Jun 18, 2003 @ 2:53pm

...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 Kzinti » Jun 18, 2003 @ 8:05pm

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


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