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

GapiDraw 3.5 dll for emulator


Postby Kiyote » Jan 13, 2005 @ 6:47pm

Kiyote
pm Member
 
Posts: 45
Joined: Dec 27, 2004 @ 9:33pm


Postby Johan » Jan 13, 2005 @ 7:47pm

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 Kiyote » Jan 13, 2005 @ 8:16pm

Kiyote
pm Member
 
Posts: 45
Joined: Dec 27, 2004 @ 9:33pm


Postby Kiyote » Jan 14, 2005 @ 7:19pm

Johan,

I downloaded the new 3.5a package just to make sure, but I think there's a discrepancy somewhere inbetween the code and the documentation.

The documentation says:

No matter what format you choose from, the steps involved to create a font are always:

1. Create a CGapiBitmapFont object.
2. Call CGapiBitmapFont::CreateSurface and supply a valid font bitmap.
3. Call CGapiBitmapFont::CreateFont to calculate the font offsets and widths.
4. Draw some text with the font using CGapiSurface::DrawText.


Step 2 mentions calling CGapiBitmapFont::CreateSurface, but this method is not exported to the flat API. Is this a C++ class-only method? Or is it a method from another object and the CGapiBitmapFont reference is erroneous?

If I skip this step, I get a NotInitialized error return code.
Kiyote
pm Member
 
Posts: 45
Joined: Dec 27, 2004 @ 9:33pm


Postby Johan » Jan 14, 2005 @ 10:42pm

CGapiBitmapFont::CreateSurface is subclassed from CGapiSurface::CreateSurface. CGapiBitmapFont is a subclass of CGapiSurface.

So you should call GapiSurfaceCreateSurface.
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 Kiyote » Jan 15, 2005 @ 4:26pm

Kiyote
pm Member
 
Posts: 45
Joined: Dec 27, 2004 @ 9:33pm


Postby Kiyote » Jan 15, 2005 @ 5:19pm

Kiyote
pm Member
 
Posts: 45
Joined: Dec 27, 2004 @ 9:33pm


Postby InexorableTash » Jan 15, 2005 @ 11:39pm

User avatar
InexorableTash
pm Member
 
Posts: 99
Joined: Sep 13, 2002 @ 6:14am


Postby Kiyote » Jan 16, 2005 @ 12:51am

Kiyote
pm Member
 
Posts: 45
Joined: Dec 27, 2004 @ 9:33pm


Postby InexorableTash » Jan 16, 2005 @ 10:07am

Hmmm. Yeah, that makes life trickier.

Since the base class is effectively a member of the derived class, and since the whole .NET-wrapper-over-native-structs approach is predicated on a fixed memory layout for the structures, you should be able to do pointer math to turn a CGapiBitmapFont into a CGapiSurface - just write a dummy C++ app that computes the pointer delta; for any given build of GapiDraw this should be fixed. Then, in your .NET wrappers just add the delta to the IntPtr to convert from CGapiBitmapFont to CGapiSurface.

Of course, this is just theory - I haven't written this. When I was doing wrappers I had the luxury of being able to add native stubs in such cases so that the compiler did all of the hard thinking. :)
User avatar
InexorableTash
pm Member
 
Posts: 99
Joined: Sep 13, 2002 @ 6:14am


Postby Johan » Jan 16, 2005 @ 11:20am

Kiyote: The easiest thing to do seems for me to just add the CreateSurface subclassed method to CGapiBitmapFont. I'll add the RGBA blit functions to the CGapiSurface<n> functions as well.
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 Kiyote » Jan 17, 2005 @ 6:27pm

Kiyote
pm Member
 
Posts: 45
Joined: Dec 27, 2004 @ 9:33pm


Postby Kiyote » Jan 18, 2005 @ 9:12pm

Johan, FYI: CGapiBitmapFont_CreateFont can return GDERR_NOTINITIALIZED. This isn't mentioned in the online documentation.

(Is my QA getting annoying yet?)
Kiyote
pm Member
 
Posts: 45
Joined: Dec 27, 2004 @ 9:33pm


Postby Kiyote » Jan 18, 2005 @ 9:23pm

Ooh...ooh...feature request. CGapiBitmapFont. Can it expose the height of the font somehow? I'm not expecting an actual "measure" function, just something that returns the height of the surface used to create the font (less the kerning line)?
Kiyote
pm Member
 
Posts: 45
Joined: Dec 27, 2004 @ 9:33pm


Postby Kiyote » Jan 20, 2005 @ 2:48am

Kiyote
pm Member
 
Posts: 45
Joined: Dec 27, 2004 @ 9:33pm


PreviousNext

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