[Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1.6 ?

Have a question about our Software Developer Kit? Ask them here.

[Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1.6 ?

Postby zzd10h » Tue Sep 22, 2015 8:48 pm

Hi,
when new FE SDK was published I changed all my Picasso functions to graphics ones.

Under FE, no problem, by changing :
Code: Select all
bitmap_vignette = p96AllocBitMap( bmh->bmh_Width, bmh->bmh_Height, 32, BMF_DISPLAYABLE, NULL, RGBFB_A8R8G8B8 );

to
Code: Select all
bitmap_vignette = AllocBitMapTags( bmh->bmh_Width, bmh->bmh_Height,32, BMATags_Displayable, TRUE, BMATags_PixelFormat,RGBFB_A8R8G8B8);


Works well, no gcc warning about obsolete picasso96 functions and overall, program runs well.

But under 4.1.6, the same program freezes the system.

As BMATags_PixelFormat is not known in the previous 4.1.6 SDK, I can't recompile the graphics AllocBitmap under 4.1.6.

By restoring Picasso96 functions and by compiling the program with the newest FE SDK, makes it work again under 4.1.6.

1) Therefore, is this AllocBitmapTags() works under 4.1.6 ?

2) Or is it a way to make the diferrence between OS level in the code ?
#ifdef __amigaos4.1.6__
or
#ifdef __amigaos4.1.8__

Thank you by advance.
Guillaume
Last edited by zzd10h on Wed Sep 23, 2015 12:26 am, edited 1 time in total.
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
zzd10h
 
Posts: 544
Joined: Sun Sep 16, 2012 6:40 am
Location: France

Re: AllocBitMapTags(BMATags_PixelFormat) freeze 4.1.6 ?

Postby colinw » Tue Sep 22, 2015 11:01 pm

I think a TAG_END may help..
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 160
Joined: Mon Aug 15, 2011 10:20 am
Location: Brisbane, QLD. Australia.

Re: AllocBitMapTags(BMATags_PixelFormat) freeze 4.1.6 ?

Postby zzd10h » Tue Sep 22, 2015 11:40 pm

Thank you Colin for your reply.

You are right, I added a TAG_END (shame on me :? )

Code: Select all
bitmap_vignette = AllocBitMapTags( bmh->bmh_Width, bmh->bmh_Height,32, BMATags_Displayable, TRUE, BMATags_PixelFormat,RGBFB_A8R8G8B8,TAG_END);


It still works under FE

Under 4.1.6, no more freeze but an ISI at this exact AllocBitmapTags instruction.

Thank you
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
zzd10h
 
Posts: 544
Joined: Sun Sep 16, 2012 6:40 am
Location: France

Re: AllocBitMapTags(BMATags_PixelFormat) freeze 4.1.6 ?

Postby colinw » Wed Sep 23, 2015 12:20 am

zzd10h wrote:It still works under FE
Under 4.1.6, no more freeze but an ISI at this exact AllocBitmapTags instruction.
Thank you


According to the autodocs, AllocBitmapTags() only existed from graphics.library verion 53.7 (6.5.2013)
I don't remember what graphics version was included in 4.1.6

You should always employ a version check if it's likely your program depends on a specific mimimum
version of a component, especially when it's likely that earlier versions may still be in use somewhere.

See; include_h/exec/libraries.h -> LIB_IS_AT_LEAST() macro.
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 160
Joined: Mon Aug 15, 2011 10:20 am
Location: Brisbane, QLD. Australia.

Re: AllocBitMapTags(BMATags_PixelFormat) freeze 4.1.6 ?

Postby zzd10h » Wed Sep 23, 2015 12:25 am

I didn't though (wrongly) that AllocBitMapTags() was a new function...

Thank you, too, for the tip about lib_at_least
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
zzd10h
 
Posts: 544
Joined: Sun Sep 16, 2012 6:40 am
Location: France

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Postby broadblues » Wed Sep 23, 2015 6:29 am

Works well, no gcc warning about obsolete picasso96 functions and overall, program runs well.

But under 4.1.6, the same program freezes the system.


The new gfx functions need FE or greater (gfxlib 54.148 giver or take a revision).

If you want to program to run pre FE you will have to use P96 still.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 474
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Postby salass00 » Wed Sep 23, 2015 5:56 pm

@zzd10h

For older graphics.library versions where the AllocBitMapTags() function isn't available there's a kind of hack/cludge you can use with AllocBitMap() if you don't want to use Picasso96API.library.

I don't remember the exact details since I've never had to use it for anything but essentially what you have to do IIRC is set the flags parameter (and maybe some others as well?) to some magic value(s) and then you can set the friend bitmap parameter to a taglist with extra RTG parameters. The AllocBitMapTags() function is just a convenient way to bypass all this legacy crap.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 478
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Postby zzd10h » Wed Sep 23, 2015 8:32 pm

@Salass0
thank you for the advice but I don't succeed to find how to pass the Pixel format to this function.

@Broadblues
yes, you are right, I will still use P96 for 4.1.6 programs.
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
zzd10h
 
Posts: 544
Joined: Sun Sep 16, 2012 6:40 am
Location: France

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Postby salass00 » Wed Sep 23, 2015 10:40 pm

zzd10h wrote:@Salass0
thank you for the advice but I don't succeed to find how to pass the Pixel format to this function.


The flags parameter should be set to BMF_CHECKVALUE (this is described in <graphics/gfx.h>).

For the tag list (specfied using the friend bitmap parameter) you should use the same tags as you would use for AllocBitMapTags().
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 478
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: [Solved] AllocBitMapTags(BMATags_PixelFormat) freeze 4.1

Postby zzd10h » Wed Sep 23, 2015 11:35 pm

Sorry my ignorance, but I made that :

Code: Select all
                 struct TagItem tags[3] ;
            tags[0].ti_Tag = BMATags_Displayable ;
            tags[0].ti_Data = TRUE ;
            tags[1].ti_Tag = BMATags_PixelFormat ;
            tags[1].ti_Data = RGBFB_A8R8G8B8 ;
            tags[2].ti_Tag = TAG_DONE;                         
                               
            bitmap_vignette = AllocBitMap( bmh->bmh_Width, bmh->bmh_Height,32, BMF_CHECKVALUE, tags);    



but it complains about

warning: passing argument 6 of 'IGraphics->AllocBitMap' from incompatible pointer type


Thank you for your help.
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
zzd10h
 
Posts: 544
Joined: Sun Sep 16, 2012 6:40 am
Location: France

Next

Return to SDK Support

Who is online

Users browsing this forum: No registered users and 1 guest