English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. System (https://eab.abime.net/forumdisplay.php?f=113)
-   -   Open Screen / Open Font (https://eab.abime.net/showthread.php?t=72245)

AGS 18 January 2014 17:09

Open Screen / Open Font
 
Hi,

I am trying to clone the Workbench-Screen. Therefore I need to set up a TextAttr-Structure to open the Screen's Font for myself. My question is, if I must store that TextAttr-Structure and the fontname in it until I close the font or if I can free both after I have the font opened?

I have read this: http://amigadev.elowar.com/read/ADCD.../node05B2.html
but it is still not clear to me.

a


EDIT: I am now using the tag "Sa_SysFont" (set to 1) to say that I want to have the WB's font in my screen. No need to do any further font stuff. ;)

mark_k 18 January 2014 18:34

Not directly answering your question, but if you're running on Kickstart 3.0 or later, you can use the SA_LikeWorkbench tag when opening the screen instead.

If you want to clone the default public screen (which is usually Workbench, but might not be) use LockPubScreen(0) instead of LockPubScreen("Workbench").
Generally, I think you may as well also pass SA_MinimizeISG when opening a custom screen too.

AGS 18 January 2014 20:42

Well, I followed your tip. Everything is well, except the icons have all the wrong colors.

mark_k 18 January 2014 21:04

Maybe try using SA_FullPalette when you open the screen? Or set the palette manually with SA_Colors?

From the OpenScreen autodoc:
SA_FullPalette: this is a Boolean attribute. Prior to V36, there
were just 7 RGB color values that Intuition maintained
in its user preferences (playfield colors 0-3, and colors
17-19 for the sprite). When opening a screen, the color
map for the screens viewport is first initialized by
graphics (graphics.library/GetColorMap()) then these
seven values are overridden to take the preferences values.

In V36, Intuition maintains a full set of 32 preferences colors.
If you specify TRUE for SA_FullPalette, Intuition will
override ALL color map entries with its full suite of
preferred colors.

thomas 18 January 2014 21:50

Quote:

Originally Posted by AGS (Post 933611)
Well, I followed your tip. Everything is well, except the icons have all the wrong colors.


Like with everything screen-related you have to load the icons after the screen has been opened and you have to tell icon.library which screen to use to allocate pens.

AGS 18 January 2014 22:34

But I noticed with PeterK's new icon.library the colors are correct always. :)

Michael 02 March 2014 04:27

A lot depends on picture.datatype and type of video output AGA/CGX/P96.
Old versions incl. OS3.9 version of picture.datatype can cause funny colours on custom screens.

PeterK 02 March 2014 05:08

Quote:

Originally Posted by AGS (Post 933632)
But I noticed with PeterK's new icon.library the colors are correct always. :)

That's probably only when you use a Hi/TrueColor screenmode, because then my icon.library displays the 24 bit RGB colors with direct drawing onto the screen by using the CGX-function WritePixelArray(). If you switch to 256 colors or AGA you will get the same results as with the original icon.library.

Did you call LayoutIconA() -- Adapt a palette-mapped icon for display ?


All times are GMT +2. The time now is 04:24.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04310 seconds with 11 queries