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

Surfaces not loading when using vector?


Surfaces not loading when using vector?

Postby Volte6 » Mar 5, 2004 @ 7:06pm

Image
User avatar
Volte6
pm Member
 
Posts: 77
Joined: Feb 16, 2004 @ 8:14pm


Postby Volte6 » Mar 5, 2004 @ 7:26pm

Image
User avatar
Volte6
pm Member
 
Posts: 77
Joined: Feb 16, 2004 @ 8:14pm


Postby ppcStudios » Mar 5, 2004 @ 10:00pm

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 Volte6 » Mar 5, 2004 @ 10:29pm

Image
User avatar
Volte6
pm Member
 
Posts: 77
Joined: Feb 16, 2004 @ 8:14pm


Postby ppcStudios » Mar 5, 2004 @ 10:43pm

You'll want to verify the path information for your image file. Based on what you have listed, the image is located in the root directory.
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 Volte6 » Mar 5, 2004 @ 10:56pm

Yeah, everythign runs from the root.

Plus, I load at least 3 other surfaces, with no problem.

It has somethign to do with the way i'm doing it... i'm sure of it. But I can't possibly guess WHAT i'm doing wrong.

I may end up instantiating the object with "new" and just passing a pointer into the vector container. I have a feeling that will work, for some reason. I hate to do it. And i'm gonna have to worry about deleting them too. Le argh.

Anybody ever try to do something like this, pushing an object with a surface into a vector? Problems? No problems?

Thanks
Image
User avatar
Volte6
pm Member
 
Posts: 77
Joined: Feb 16, 2004 @ 8:14pm


Postby ppcStudios » Mar 5, 2004 @ 11:01pm

I've not used vector, but have used arrays of surfaces with no problem. Using a vector shouldn't be an issue. Without seeing the actual code, I can only guess at what the problem may be. I would first check those return codes...
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 Volte6 » Mar 5, 2004 @ 11:13pm

That's pretty much the code, actually...

I mean, you can use that same code to do whatever is needed...

I'll check the return codes when I can though. thanks.
Image
User avatar
Volte6
pm Member
 
Posts: 77
Joined: Feb 16, 2004 @ 8:14pm


Postby Pejo Software - Per » Mar 5, 2004 @ 11:15pm

When you add you Object to the vector you are making a copy and since CGapiSurface doesn't have a copy constructor that copies the image data the Object in the vector will not contain the image data.
User avatar
Pejo Software - Per
pm Insider
 
Posts: 343
Joined: Apr 25, 2002 @ 1:00pm
Location: Mölndal, Sweden


Postby Volte6 » Mar 5, 2004 @ 11:49pm

Image
User avatar
Volte6
pm Member
 
Posts: 77
Joined: Feb 16, 2004 @ 8:14pm


Postby fzammetti » Mar 6, 2004 @ 12:55am

...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 Volte6 » Mar 6, 2004 @ 4:53am

Still not working.

I dunno what format to specify that an HRESULT is, so I'm using %0u for _stprintf to display the value.

That gives me: 3362128032

How do I find out what that sort of thing means?
Image
User avatar
Volte6
pm Member
 
Posts: 77
Joined: Feb 16, 2004 @ 8:14pm


Postby fzammetti » Mar 6, 2004 @ 5:03am

Compare the result to the constants in GD. For instance, you can generally do:

HRESULT hr;
hr = graphic.CreateSurface(GDSURFACE_SYSTEMMEMORY, pImageFile);
if (hr != GD_OK) {
// Do some sort of error handling
}

You could do something as simple as:

if (hr == GDERR_BITMAPNOTFOUND) { // Pop error message }
if (hr == GDERR_INCOMPATIBLEPRIMARY { // Pop error message }
if (hr == GDERR_INVALIDBITMAP { // Pop error message }
if (hr == GDERR_INVALIDPARAMS { // Pop error message }
if (hr == GDERR_INVALIDSURFACETYPE { // Pop error message }
if (hr == GDERR_LOCKEDSURFACES { // Pop error message }
if (hr == GDERR_OUTOFMEMORY { // Pop error message }
if (hr == GDERR_SURFACELOST { // Pop error message }

Those are all the errors defined for this function to return.

Personally, I have a simple wrapper function that I call in place of CreateSurface that handles this so I don't have a bunch of repeated code. I suspect everyone does a very similar thing too.
...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 Volte6 » Mar 6, 2004 @ 6:05am

Okay, it's this:

GDERR_INCOMPATIBLEPRIMARY

What does it mean, and how do I fix it? :(
Image
User avatar
Volte6
pm Member
 
Posts: 77
Joined: Feb 16, 2004 @ 8:14pm


Postby Volte6 » Mar 6, 2004 @ 6:13am

And finally, where can I find a list describing these error messages? Thanks!
Image
User avatar
Volte6
pm Member
 
Posts: 77
Joined: Feb 16, 2004 @ 8:14pm


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

cron