Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
174 user(s) are online (132 user(s) are browsing Forums)

Members: 4
Guests: 170

hotrod, bigmac, sailor, jarokuczi, more...

Headlines

 
  Register To Post  

How create an 8-bit screen that ObtainBestPen() will work on? (SOLVED)
Home away from home
Home away from home


See User information
The AutoDocs for OpenScreen() are not very helpful, and I am having trouble working out what magic tag(s) I need to get ObtainBestPen() working on my custom 8-bit screen. (BTW, I do not want to use SA_LikeWorkbench, even though that appears to work.)

"SA_Pens,-1" seems to get it *slightly* working, such that a tiny handful of colours get allocated (perhaps 7), but it looks pretty horrid.

I'd appreciate advice, as it appears that colour palettes are one of the Amiga's most messy subjects (seemingly having slowly evolved over time).


Edited by ChrisH on 2012/4/5 22:54:43
Author of the PortablE programming language.
Go to top
Re: How create an 8-bit screen that ObtainBestPen() will work on?
Amigans Defender
Amigans Defender


See User information
AFAIK any 8-bit screen should cope with ObtainBestPen(), even 32-bit screens should work. What exactly isn't working?

Go to top
Re: How create an 8-bit screen that ObtainBestPen() will work on?
Home away from home
Home away from home


See User information
@Chris Quote:
AFAIK any 8-bit screen should cope with ObtainBestPen()

That's what I had imagined, but that doesn't seem to be the case . It *does* work on 24-bit screens though, which is what had lulled me into a false sense of security. It also *does* work when using SA_LikeWorkbench, but I can't use that for what I want.

Quote:
What exactly isn't working?

Without any special tags, ObtainBestPen() does not seem able to allocate any new pens, so it just returns pen 18 for any requested colour (which gives me a completely black screen when I am drawing).

When using "SA_Pens,-1", ObtainBestPen() appears able to allocate at least 6 pens, so that it returns pens 18, 11, 10, 12, 4, 8 & 7. This gives me very poor quality drawing, but at least I can see something!

Author of the PortablE programming language.
Go to top
Re: How create an 8-bit screen that ObtainBestPen() will work on?
Home away from home
Home away from home


See User information
OK, it turns out that I need to use "SA_SharePens,TRUE" for ObtainBestPen() to work.

I don't really understand why, but it seems to be for maintaining backwards compatibility with OS3.0 or earlier. If you don't use that tag, then Intuition marks all non-system-allocated pens (everything in my case) as being "exclusive", which I *think* means they are marked as being already 'allocated' (for use exclusively by the screen's owner, probably poking colours directly into the palette).

Author of the PortablE programming language.
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project