English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 06 June 2013, 01:53   #1
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
WB windows in graphic cards

Hi,

I´ve tried to change the values for default pens in this asm window definitions code but, no matter the values I give, the colors didn´t changed in the chars printed in my window in WinUAE 32bit colors.

How can I change the colors for block and detail pens for my windows when WB has more then 256 colors, like in an Amiga with graphics card?


Code:
 
WinDefs: 
 dc.w 50,50        ;x posn, y posn
 dc.w 200,75      ;width,height
 dc.b  -1,-1        ;default pens
 dc.l   CLOSEWINDOW   ;easy IDCMP flag
 dc.l   WINDOWDEPTH!WINDOWCLOSE!SMART_REFRESH!ACTIVATE!WINDOWDRAG
 dc.l   0              ;no gadgets
 dc.l   0              ;no checkmarks
 dc.l   winTitle     ;title of window
 dc.l   0              ;no screen
 dc.l   0              ;no bitmap
 dc.w 0,0,0,0       ;minimum, irrelevant as no sizing gadget
 dc.w WBENCHSCREEN   ;in workbench
AlfaRomeo is offline  
Old 06 June 2013, 08:12   #2
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,009
BlockPen and DetailPen have no effect since Kick 2.0.

Colors of window borders and text are set by the user in Prefs/Palette. The settings apply to the whole screen. If you want different colors for the window borders, you have to open your own screen.

Note that on a graphics card you have the same 256 pens as on a native screen. In order to use more colors, you have to use cybergraphics.library. But you can still not change the window borders, only the window contents.
thomas is offline  
Old 06 June 2013, 09:16   #3
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
Thanks for reply thomas.
I don´t want to change colors for window borders but for the chars I want to print inside the window.
I think already know best way to change the colors for the chars printed in my window with GetColorMap, ObtainBestPen and SetAPen functions. Will try to know how to use those functions.
AlfaRomeo is offline  
Old 06 June 2013, 14:48   #4
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,009
GetColorMap will make a new colormap for you. It will not have any effect on your Window.

To get a pen to draw into your window you should call ObtainBestPen with Screen->ViewPort.ColorMap.

If you are sure to run on a truecolor screen (check if GetBitMapAttr(screen->RastPort.BitMap,BMA_DEPTH) > 8) then you can use ObtainPen with PENF_EXCLUSIVE to get one pen to draw with. Then use SetRGB32 to set the desired RGB value for this pen.

Note that this only works on a truecolor screen. On CLUT screens (BMA_DEPTH <= 8) SetRGB32 will change all pixels which have been drawn with this pen before.
thomas is offline  
Old 06 June 2013, 15:43   #5
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
Thanks for your help thomas.
Already had tried this code with default values for the ObtainBestPen()Tag List but instead the desired near green color for the chars within the window they are full black.

Code:
 
* lock the screen
 move.l   IntuiBase,a6
 lea        scrName,a0                     ;WBscreen
 jsr         LockPubScreen(a6)

 move.l   d0,scrPtr
 move.l   d0,a0                             ;screen pointer in a0
 move.l   sc_ViewPort+vp_ColorMap(a0),a0       ;get ColorMap
 
* Obtain near green pen
 clr.l d0
 move.l   GfxBase,a6
 move.l   #0,d1
 move.l   #255,d2                         ;green
 move.l   #0,d3
 lea        tagList,a1
 jsr         ObtainBestPen(a6)

* set the pen with near green 
 move.l   winPtr,a0
 move.l   wd_RPort(a0),a1
 jsr        SetAPen(a6) 
 
* unlock the screen
 move.l   scrPtr,a1
 sub.l     a0,a0
 jsr        UnlockPubScreen(a6)         
   
*  move the cursor to place
 moveq   #20,d0    ;x posn
 moveq   #40,d1    ;y pos
 move.l   GfxBase,a6   
 move.l   winPtr,a1
 move.l   wd_RPort(a1),a1      ;get window rastport
 jsr        Move(a6)
 
* printing chars
 move.l   winPtr,a1
 move.l   wd_RPort(a1),a1
 move.l   GfxBase,a6
 lea        String,a0                ;string
 moveq   #StringLen,d0          ;length
 jsr  Text(a6)
Quote:
Originally Posted by thomas View Post
If you are sure to run on a truecolor screen (check if GetBitMapAttr(screen->RastPort.BitMap,BMA_DEPTH) > 8) then you can use ObtainPen with PENF_EXCLUSIVE to get one pen to draw with. Then use SetRGB32 to set the desired RGB value for this pen.
Now will try the SetRGB32
AlfaRomeo is offline  
Old 06 June 2013, 15:49   #6
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,009
Quote:
Originally Posted by AlfaRomeo View Post
Code:
 
 move.l   #255,d2                         ;green
Color values are 32 bits, not 8 bits. To get highest volume, you have to use $ffffffff and not $ff.
thomas is offline  
Old 07 June 2013, 00:09   #7
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
Quote:
Originally Posted by thomas View Post
Color values are 32 bits, not 8 bits. To get highest volume, you have to use $ffffffff and not $ff.
Greattttt, when I changed the value #255 by #$ffffffff the chars within the window finally appeared in the beautiful green.
You´re the best thomas thanks for your help
AlfaRomeo is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
a (silly?) question about graphic cards on A1200 loth77 support.Hardware 19 15 January 2012 15:37
Amiga ethernet cards still compatible with Windows? Fingerlickin_B support.Hardware 49 05 December 2008 13:55
What the best graphic card? AlfaRomeo support.Hardware 2 26 August 2008 01:24
use filters with graphic cards display ? turrican3 request.UAE Wishlist 1 08 November 2007 07:43
Help on Graphic Cards Fenrir New to Emulation or Amiga scene 21 31 August 2005 03:21

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:21.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07257 seconds with 13 queries