How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)

Forum for discussion about the documentation project.
dodicat
Posts: 5335
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)

Postby dodicat » Jun 08, 2018 14:33

OK, I have added 8 bytes all round in my above snippet.
Should now cover the full image area plus the header.
Thank you for pointing out the error.
coderJeff
Site Admin
Posts: 2733
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)

Postby coderJeff » Jun 09, 2018 14:05

The wiki shows the image buffer returned by ImageCreate as ANY PTR, however, it has a known public structure.
See: inc/fbgfx.bi
Also this tutorial: FBgfx Image and Font Buffers.
Maybe the wiki has historically, shown fb image buffers as ANY PTR only because fbgfx.bi and FB.Image type declaration is optional to the programmer.
fxm
Posts: 8524
Joined: Apr 22, 2009 12:46
Location: Paris (suburbs), FRANCE

Re: How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)

Postby fxm » Jun 09, 2018 14:54

Indeed, ImageCreate() returns an Any Ptr.
I seem to remember that we discussed this topic (return either an Any Ptr or an Image Ptr) at time when adding the ImageCreate () statement, but I do not remember the reason of choice (maybe to avoid a Cast if the user want to use a numeric pointer).
Maybe dkl?
coderJeff
Site Admin
Posts: 2733
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)

Postby coderJeff » Jun 09, 2018 15:04

fxm wrote:maybe to avoid a Cast if the user want to use a numeric pointer

That would make sense. That image buffer data location could be declared as a variety of data types. BYTE PTR, array() as BYTE, etc.

Return to “Documentation”

Who is online

Users browsing this forum: Foneo and 3 guests