Welcome, Guest. Please login or register.

Author Topic: picasso96 development  (Read 2252 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Thomas

Re: picasso96 development
« on: January 16, 2004, 09:25:31 AM »

You could do it like this:

ULONG tags[] = {P96SA_Width, 800, P96SA_HEIGHT, 600, P96SA_Depth, 24, P96SA_Title, "doodie", TAG_END};
screen = p96OpenScreenTagList(tags);

But I'd rather use CGX than P96, because it runs on all graphics boards not only on P96 ones. CGX programs run on P96, not vice versa.

And additionally I would by all means avoid using graphics card-only funktions. If you'd use OpenScreenTags instead of p96OpenScreenTags, the program could run on non-graphics card systems also.

Bye,
Thomas

Offline Thomas

Re: picasso96 development
« Reply #1 on: January 16, 2004, 11:48:44 AM »

Perhaps you should try to learn C before you start programming ;-)

Of course you have to cast the type of the pointer to match the prototype. Or declare tags as struct TagItem.

So the correct call should look like this:

screen = p96OpenScreenTagList((struct TagItem *)tags);

There is a good text about AmigaOS 2.0 programming style on the Amiga Developer CD. IIRC it was called AmigaMail volume 2. It is about using tags in function calls and other useful things introduced with OS 2. You should really read it.

Bye,
Thomas

Offline Thomas

Re: picasso96 development
« Reply #2 on: January 16, 2004, 11:52:08 AM »

Oh and as we are at casting, this one has to be casted, too:

ULONG tags[] = {P96SA_Width, 800, P96SA_HEIGHT, 600, P96SA_Depth, 24, P96SA_Title, (ULONG)"doodie", TAG_END};

Because it is a pointer and the array only contains integers.

Bye,
Thomas