Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: Tinsa on January 16, 2004, 08:16:39 AM
-
Hi again.
I changed p96OpenScreenTagList to p96OpenScreenTags and managed to compile, but now the linker says: "Symbol "p96OpenScreenTags(...) Not defined"...
Any suggestions?
/*
I am trying to open a screen in picasso96 and it's driving me crazy....
I have this piece of code:
screen = p96OpenScreenTagList(P96SA_Width, 800, P96SA_HEIGHT, 600, P96SA_Depth, 24, P96SA_Title, "doodie", TAG_END);
The compiler (StormC3 from devcd) complains about : "Illegal argument"...
I have added the "Picasso96API.lib" library to the project...
I would really appreciate any halp on this matter...
*/
Thanks in advance
-
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
-
Thomas wrote:
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
That did not work either, I still got "Illegal argument", it seems as if the error must be in the tag list, but i can not find it...
-
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
-
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
-
To use Picasso96 with stormc3 you should adapt the includes with FD2Pragma.
There's no need to add the Picasso96.lib...
-
Crumb wrote:
To use Picasso96 with stormc3 you should adapt the includes with FD2Pragma.
There's no need to add the Picasso96.lib...
ok, thanks. But how would the commandline look for fd2pragma?