From: | |
Date: | 02 Feb 2001 at 16:27:27 |
Subject: | Re: Can someone look at this code? |
On 02-Feb-01, Jack York wrote:
-snip-
> Does one of your programs have custom colors
> that you change after it is up and running?
> Don't you see it start in one color and then
> switch to another this way?
> Jack
All of them that use a custom screen use custom colours,
and no, you don't see it, because the pens are set within
microseconds after the display opens,
of course, the pens are set before I attach any GUI elements...
Here is a bit of a program I have......
UWORD default_palette[]={
0x0888,
0x0FFF,
0x0999,
0x0000,
0x0777,
0x0060,
0x0FF0,
0x000A
};
#define SHADE1 0
#define WHITE 1
#define SHADE2 2
#define BLACK 3
#define SHADE0 4
#define GREEN 5
#define YELLOW 6
#define BLUE 7
VOID main()
{
readconfig(); /* screenmode info is fetched from here */
ScreenPTR = OpenScreenTags( NULL,
SA_Left, 0L,
SA_Top, 0L,
SA_Width, (ulong)CON.ScreenWidth,
SA_Height, (ulong)CON.ScreenHeight,
SA_DisplayID, (ulong)CON.ScreenMode,
SA_Font, (ulong)&TXA,
SA_Depth, 3L,
SA_DetailPen, SHADE1,
SA_BlockPen, BLACK,
SA_Title, NULL,
SA_BitMap, NULL,
SA_ShowTitle, 0L,
SA_Behind, 0L,
SA_Quiet, 0L,
SA_Type, (ulong)CUSTOMSCREEN,
TAG_DONE, NULL
);
if( ! ScreenPTR ){
puts("Can't Open Screen.");
cleanup();
}
WindowPTR = OpenWindowTags(NULL,
WA_CustomScreen, ScreenPTR,
WA_Left, 0L,
WA_Top, 0L,
WA_Width, (ulong)CON.ScreenWidth,
WA_Height, (ulong)CON.ScreenHeight,
WA_DetailPen, SHADE1,
WA_BlockPen, BLACK,
WA_MinWidth,100,
WA_MinHeight,100,
WA_MaxWidth,-1,
WA_MaxHeight,-1,
WA_CloseGadget,FALSE,
WA_SizeGadget,FALSE,
WA_DepthGadget,FALSE,
WA_Backdrop, FALSE,
WA_DragBar,FALSE,
WA_SmartRefresh,TRUE,
WA_Borderless, FALSE,
WA_Activate,TRUE,
WA_Title, NULL,
WA_IDCMP,IDCMP_MENUPICK | IDCMP_VANILLAKEY | IDCMP_RAWKEY,
TAG_END);
if( ! WindowPTR ){
puts("Can't Open Window.");
cleanup();
}
RastPRT = (struct RastPort *)WindowPTR->RPort;
ViewPRT = ViewPortAddress(WindowPTR);
LoadRGB4(ViewPRT, &default_palette[0], 8L);
/*------------ snipped here --------------*/
cleanup();
}
Regards
Colin Wenzel. Quensland, Australia.
EMAIL: colstv@hotkey.net.au
URL: http://www.hotkey.net.au/~colstv/
AMIGA: 4000T, 68060/50, 150Mb RAM,
OS 3.9, Spectrum Gfx Card + P96.
Need an Image Generator For CATV ??
http://connect.to/products
_________________________________________
------------------------ Yahoo! Groups Sponsor ---------------------~-~>
eGroups is now Yahoo! Groups
Click here for more details
http://click.egroups.com/1/11231/0/_/451227/_/981127758/
---------------------------------------------------------------------_->