<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://fpcamigawiki.alb42.de/index.php?action=history&amp;feed=atom&amp;title=Intuition.SetWindowPointerA%28%29</id>
	<title>Intuition.SetWindowPointerA() - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://fpcamigawiki.alb42.de/index.php?action=history&amp;feed=atom&amp;title=Intuition.SetWindowPointerA%28%29"/>
	<link rel="alternate" type="text/html" href="http://fpcamigawiki.alb42.de/index.php?title=Intuition.SetWindowPointerA()&amp;action=history"/>
	<updated>2026-04-28T08:43:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>http://fpcamigawiki.alb42.de/index.php?title=Intuition.SetWindowPointerA()&amp;diff=205&amp;oldid=prev</id>
		<title>Molly: Corrected name of image and added some extra line between image and source code</title>
		<link rel="alternate" type="text/html" href="http://fpcamigawiki.alb42.de/index.php?title=Intuition.SetWindowPointerA()&amp;diff=205&amp;oldid=prev"/>
		<updated>2014-08-09T11:16:18Z</updated>

		<summary type="html">&lt;p&gt;Corrected name of image and added some extra line between image and source code&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:16, 9 August 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l13&quot; &gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;First a little picture of a slight variation on the presented code (using 64x64 pointer instead of 32x32)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;First a little picture of a slight variation on the presented code (using 64x64 pointer instead of 32x32)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[File:MousePointer64x64.jpg]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[[File&lt;/del&gt;:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Example.jpg]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;And the code that made it happen&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;pascal&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;pascal&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key db624220369-ntdbjym2gu:diff::1.12:old-203:rev-205 --&gt;
&lt;/table&gt;</summary>
		<author><name>Molly</name></author>
	</entry>
	<entry>
		<id>http://fpcamigawiki.alb42.de/index.php?title=Intuition.SetWindowPointerA()&amp;diff=203&amp;oldid=prev</id>
		<title>Molly: Initial content</title>
		<link rel="alternate" type="text/html" href="http://fpcamigawiki.alb42.de/index.php?title=Intuition.SetWindowPointerA()&amp;diff=203&amp;oldid=prev"/>
		<updated>2014-08-09T11:06:53Z</updated>

		<summary type="html">&lt;p&gt;Initial content&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Unfortunately no real explanation(s) yet, just some piece of code i wanted to &amp;#039;rescue&amp;#039; out of the aros-exec.org &amp;#039;haystack&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The code is quite self-explanatory though.&lt;br /&gt;
&lt;br /&gt;
The code was originally presented in [http://aros-exec.org/modules/newbb/viewtopic.php?viewmode=flat&amp;amp;type=&amp;amp;topic_id=8050&amp;amp;forum=1 this thread], [http://aros-exec.org/modules/newbb/viewtopic.php?post_id=79294#forumpost79294 this post] to be exact (2-3-2013).&lt;br /&gt;
&lt;br /&gt;
Another interesting (related) thread is [http://aros-exec.org/modules/newbb/viewtopic.php?viewmode=flat&amp;amp;type=&amp;amp;topic_id=8081&amp;amp;forum=2 this one], in which i stumbled upon some WritePixelArray() (/Alpha) curiosity (5-3-2013).&lt;br /&gt;
&lt;br /&gt;
But the &amp;#039;mother&amp;#039; of all threads is [http://aros-exec.org/modules/newbb/viewtopic.php?viewmode=flat&amp;amp;type=&amp;amp;topic_id=4176&amp;amp;forum=1 this one] (21-1-2010)), in which the author of the new mouse pointer implementation explains how things are suppose to work in practice (don&amp;#039;t worry, all the important information is already supplied in the comments of the presented source-code).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unfortunately code is also still in my old stubborn &amp;#039;use my unts and types&amp;#039;-format, so it won&amp;#039;t compile out of the box (hence this example is not situated on the main page from ALB).&lt;br /&gt;
&lt;br /&gt;
First a little picture of a slight variation on the presented code (using 64x64 pointer instead of 32x32)&lt;br /&gt;
&lt;br /&gt;
[[File:Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;pascal&amp;quot;&amp;gt;&lt;br /&gt;
program SinglePointerV2b; &lt;br /&gt;
&lt;br /&gt;
{$MODE OBJFPC}{$H+} &lt;br /&gt;
&lt;br /&gt;
uses &lt;br /&gt;
  aros_types, &lt;br /&gt;
  aros_exec, &lt;br /&gt;
  aros_dos, &lt;br /&gt;
  aros_graphics, &lt;br /&gt;
  aros_intuition, &lt;br /&gt;
  aros_cybergraphics, &lt;br /&gt;
  mytagsarray; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(* &lt;br /&gt;
  author    : MaGoRiuM &lt;br /&gt;
  date      : 03-march-2013 &lt;br /&gt;
  Name      : singlepointer revision V2b &lt;br /&gt;
  Topic     : A quick&amp;#039;n&amp;#039;dirty mousepointer changing test &lt;br /&gt;
  Target    : AROS &lt;br /&gt;
  Usage     : Start from shell. No other windows must be open &lt;br /&gt;
              to ensure the shell-window is the first window &lt;br /&gt;
              on the screen. If not then the windows that has its &lt;br /&gt;
              cursor changed needs to be activated before the changes &lt;br /&gt;
              to the mousepointer are visible. &lt;br /&gt;
              The name of the window for which the mousepointer &lt;br /&gt;
              is changed is written in the shell along with  &lt;br /&gt;
              other debug information. &lt;br /&gt;
              Tested in vesa mode only. Max dimensions tested &lt;br /&gt;
              64*64*32 (w*h*d) &lt;br /&gt;
  Disclaimer: Use and abuse at your own risk. &lt;br /&gt;
              This file is not meant for distribution. Its &lt;br /&gt;
              purpose is being an example. Bad coding style(tm) &lt;br /&gt;
              applies. &lt;br /&gt;
*) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(* &lt;br /&gt;
  Important notes: &lt;br /&gt;
   &lt;br /&gt;
  From Sonic in &amp;quot;New Mouse Pointer&amp;quot; thread on aros-exec.org &lt;br /&gt;
&lt;br /&gt;
  FWIW Sonic is the AROS system developer that implemented the  &lt;br /&gt;
  mousepointerclass. &lt;br /&gt;
   &lt;br /&gt;
  - The pointerclass attributes are not settable. You can pass them only  &lt;br /&gt;
    during object creation. &lt;br /&gt;
  - If you want several different pointers then create several different  &lt;br /&gt;
    objects. Then just switch between them using SetWindowPointer(). &lt;br /&gt;
  - Dont recreate the bitmap each time. After creating a pointerclass  &lt;br /&gt;
    object you may re-use it. The bitmap is NOT attached to the created  &lt;br /&gt;
    object in any way, data are copied and stored internally. &lt;br /&gt;
    See rom/intuition/pointerclass.c for more details. &lt;br /&gt;
  - Pixelformat specifies the order of bytes in RAM, not in a longword. So  &lt;br /&gt;
    they are endianess-dependant. Take this into account if you use longword  &lt;br /&gt;
    to specify your pointer image. &lt;br /&gt;
*) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(***************************************************************************) &lt;br /&gt;
(**                                                                       **) &lt;br /&gt;
(**       Routines that are missing from default units                    **) &lt;br /&gt;
(**                                                                       **) &lt;br /&gt;
(***************************************************************************) &lt;br /&gt;
&lt;br /&gt;
Const &lt;br /&gt;
  BMF_SPECIALFMT = 1 shl 7;   // Missing tag in agraphics unit. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function  NewObject(classPtr : pIClass; const classID: pChar; const tags : array of const) : Pointer; &lt;br /&gt;
begin &lt;br /&gt;
  // Cast to pointer to avois clas between aros_utility and utility unit. &lt;br /&gt;
  NewObject := NewObjectA(classPtr, ClassID, Pointer(readinTags(tags))); &lt;br /&gt;
end; &lt;br /&gt;
&lt;br /&gt;
procedure SetWindowPointer(win : pWindow; const tags : array of const); &lt;br /&gt;
begin &lt;br /&gt;
  // Cast to pointer to avoid clash between aros_utility and utility unit. &lt;br /&gt;
  SetWindowPointerA(win, pointer(readintags(tags))); &lt;br /&gt;
end; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(***************************************************************************) &lt;br /&gt;
(**                                                                       **) &lt;br /&gt;
(**       Actual implementation                                           **) &lt;br /&gt;
(**                                                                       **) &lt;br /&gt;
(***************************************************************************) &lt;br /&gt;
&lt;br /&gt;
Const &lt;br /&gt;
  TAG_DONE          =  0;   // for convenience, no need for utility unit. &lt;br /&gt;
&lt;br /&gt;
  RawDataWidth      = 16;  // The width in pixels of our rawdata &lt;br /&gt;
  RawDataHeight     = 16;  // The height in pixels of our rawdata &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Var &lt;br /&gt;
  RawData_16x16     : packed array[0..(RawDataWidth*RawDataHeight)-1] of longword = &lt;br /&gt;
  ( &lt;br /&gt;
    // format AABBGGRR; &lt;br /&gt;
    $00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FF0000, &lt;br /&gt;
    $00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FFFFFF,$00FF0000, &lt;br /&gt;
    $000000FF,$000000FF,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00FF0000,$00FF0000, &lt;br /&gt;
    $000000FF,$000000FF,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00FF0000,$00FF0000, &lt;br /&gt;
    $000000FF,$000000FF,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00FF0000,$00FF0000, &lt;br /&gt;
    $000000FF,$000000FF,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00FF0000,$00FF0000, &lt;br /&gt;
    $000000FF,$000000FF,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00FF0000,$00FF0000, &lt;br /&gt;
    $000000FF,$000000FF,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00FF0000,$00FF0000, &lt;br /&gt;
    $000000FF,$000000FF,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00FF0000,$00FF0000, &lt;br /&gt;
    $000000FF,$000000FF,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00FF0000,$00FF0000, &lt;br /&gt;
    $000000FF,$000000FF,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00FF0000,$00FF0000, &lt;br /&gt;
    $000000FF,$000000FF,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00FF0000,$00FF0000, &lt;br /&gt;
    $000000FF,$000000FF,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00FF0000,$00FF0000, &lt;br /&gt;
    $000000FF,$000000FF,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00FF0000,$00FF0000, &lt;br /&gt;
    $000000FF,$000000FF,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00, &lt;br /&gt;
    $000000FF,$000000FF,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00,$0000FF00 &lt;br /&gt;
  ); &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(* &lt;br /&gt;
          Routine that creates an actual AROS cursor from the raw cursor data. &lt;br /&gt;
          Width, Height and Depth describes the raw data. &lt;br /&gt;
*) &lt;br /&gt;
Function AllocAROSPointer(Width, Height, Depth: Integer; RawData: pLongWord): pObject_; &lt;br /&gt;
var &lt;br /&gt;
  px, py, r     : Integer; &lt;br /&gt;
  CursorBM      : pBitmap; &lt;br /&gt;
  CursorRP      : pRastPort; &lt;br /&gt;
  cc            : LongWord; &lt;br /&gt;
  aa,rr,gg,bb   : Byte; &lt;br /&gt;
  AROSCursor    : pObject_; &lt;br /&gt;
  WordWidth     : LongInt; &lt;br /&gt;
  //RawDataAccess : pRawCursorData; &lt;br /&gt;
     &lt;br /&gt;
begin &lt;br /&gt;
  AROSCursor := nil; &lt;br /&gt;
  { &lt;br /&gt;
    Now we need to actually make real AROS cursor &lt;br /&gt;
    out of the raw data that is given. &lt;br /&gt;
     &lt;br /&gt;
    It is a slow process but luckiliy this could     &lt;br /&gt;
    be execute tbefore a program actually runs so  &lt;br /&gt;
    that it will not take away runtime performance. &lt;br /&gt;
  } &lt;br /&gt;
&lt;br /&gt;
  {  &lt;br /&gt;
    Step 1:  &lt;br /&gt;
    allocate an offscreen bitmap to copy the rgb32 pixeldata  &lt;br /&gt;
    into. This creates a bitmap, that is unfortunately needed &lt;br /&gt;
    by AROS to create a new pointer. &lt;br /&gt;
  }  &lt;br /&gt;
  CursorBM := AllocBitMap( &lt;br /&gt;
    Width,          // sizeX, pixelwidth desired for bitmapdata &lt;br /&gt;
    Height,         // sizey, pixelheight desired for bitmapdata &lt;br /&gt;
    Depth,          // depth, number of bitplanes tha are at least allocated (32 bit for RGBA32) &lt;br /&gt;
    BMF_MINPLANES or BMF_SPECIALFMT or (PIXFMT_RGBA32 shl 24), // flags, see documentation &lt;br /&gt;
    nil // pRastPort(window^.RPort)^.BitMap &lt;br /&gt;
  ); &lt;br /&gt;
&lt;br /&gt;
  if (CursorBM &amp;lt;&amp;gt; nil)  &lt;br /&gt;
  then writeln(&amp;#039;allocated bitmap&amp;#039;)  &lt;br /&gt;
  else writeln(&amp;#039;ERROR: allocating bitmap failed&amp;#039;); &lt;br /&gt;
&lt;br /&gt;
  {  &lt;br /&gt;
    Step 2: &lt;br /&gt;
    A rastport to the offscreen-bitmap is needed in order to be able to &lt;br /&gt;
    actually write anything into the bitmap. &lt;br /&gt;
    On classic we would use initrastport, but AROS specifically tells use to  &lt;br /&gt;
    use CreateRastPort(). Using inintrastport in this situation will freeze &lt;br /&gt;
    AROS-OS. &lt;br /&gt;
    NOTE: the rastport needs to be freed as well. &lt;br /&gt;
  }  &lt;br /&gt;
&lt;br /&gt;
  CursorRP := CreateRastPort; &lt;br /&gt;
  if (CursorRP &amp;lt;&amp;gt; nil)  &lt;br /&gt;
  then writeln(&amp;#039;created rastport for cursor&amp;#039;)  &lt;br /&gt;
  else writeln(&amp;#039;ERROR: creating rastport for cursor failed&amp;#039;); &lt;br /&gt;
&lt;br /&gt;
  {  &lt;br /&gt;
    Step 3: &lt;br /&gt;
    Attach bitmap to rastport to make connection. &lt;br /&gt;
  } &lt;br /&gt;
  CursorRP^.Bitmap := CursorBM; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  {  &lt;br /&gt;
    Step 4: &lt;br /&gt;
    The RAW defined pixeldata needs to be: &lt;br /&gt;
    - copied into the bitmap &lt;br /&gt;
    - an cursor object needs to be created from this bitmap &lt;br /&gt;
  } &lt;br /&gt;
&lt;br /&gt;
  begin &lt;br /&gt;
    { &lt;br /&gt;
      Step 4a: &lt;br /&gt;
      Copy data into the bitmap       &lt;br /&gt;
    } &lt;br /&gt;
    // initialize the counter used to count the nr of pixels that are &lt;br /&gt;
    // drawn into the bitmap without any error. &lt;br /&gt;
    r := 0;     &lt;br /&gt;
     &lt;br /&gt;
    for py := 0 to Height-1 do &lt;br /&gt;
    begin &lt;br /&gt;
      for px := 0 to Width-1 do &lt;br /&gt;
      begin &lt;br /&gt;
        // get color asociated with the current pixel &lt;br /&gt;
        cc := rawdata[py*width+px]; &lt;br /&gt;
        // break color component of pixel into seperate ARGB colorvalues &lt;br /&gt;
        rr := cc shr  0 and $FF; &lt;br /&gt;
        gg := cc shr  8 and $FF; &lt;br /&gt;
        bb := cc shr 16 and $FF; &lt;br /&gt;
        aa := cc shr 24 and $FF; &lt;br /&gt;
&lt;br /&gt;
        { &lt;br /&gt;
        // Check if the pixel is transparant (RGB=000) &lt;br /&gt;
        // If pixel is transparent we override alpha channel &lt;br /&gt;
        // if pixel has alphavalue we need to fill in alphavalue &lt;br /&gt;
        // for testing purpose only we fill in $FF which mean full color, no alpha &lt;br /&gt;
        } &lt;br /&gt;
        if (rr+gg+bb = 0) then aa := $00 else aa := $FF; &lt;br /&gt;
        // Put back the colors + corrected alpha value into the correct format in order to be able to write a pixel &lt;br /&gt;
        cc := (aa shl 24) + (rr shl 16) + (gg shl 8) + (bb); &lt;br /&gt;
        // write the pixel into the bitmap &lt;br /&gt;
        // cast to pointer because of type conflict between aros_graphics and agraphics unit. &lt;br /&gt;
        If WriteRGBPixel(Pointer(CursorRp), px, py, cc) = 0 then &lt;br /&gt;
        begin &lt;br /&gt;
          // if the pixel is written ok, increase counter so pixelwritecount can be checked &lt;br /&gt;
          inc(r); &lt;br /&gt;
        end; &lt;br /&gt;
      end; // for pixel-coordinates x &lt;br /&gt;
    end; // for pixel-coordinates y &lt;br /&gt;
&lt;br /&gt;
    // write out the number of pixels that were written into the bitmap &lt;br /&gt;
    // if it doesn&amp;#039;t match px*py then an error occured. &lt;br /&gt;
    writeln(&amp;#039;wrote &amp;#039;, r, &amp;#039; pixels into bitmap&amp;#039;); &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    { &lt;br /&gt;
      Step 4b: &lt;br /&gt;
      Now that the bitmap is setup correctly we attempt to create a cursor from it.         &lt;br /&gt;
    } &lt;br /&gt;
    WordWidth := (Width + 15) shr 4; &lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
    AROSCursor := NewObject(nil,&amp;#039;pointerclass&amp;#039;,  &lt;br /&gt;
    [ &lt;br /&gt;
      POINTERA_BitMap    , CursorBM, &lt;br /&gt;
      POINTERA_WordWidth , WordWidth,    // width of cursor in words. &lt;br /&gt;
      //POINTERA_XResolution, POINTERXRESN_DEFAULT, &lt;br /&gt;
      //POINTERA_YResolution, POINTERYRESN_DEFAULT, &lt;br /&gt;
      POINTERA_XResolution, POINTERXRESN_SCREENRES, &lt;br /&gt;
      POINTERA_YResolution, POINTERYRESN_SCREENRESASPECT, &lt;br /&gt;
      //POINTERA_XOffset   , 0,    // Hotspot x &lt;br /&gt;
      //POINTERA_YOffset   , 0,    // hotspot y         &lt;br /&gt;
      TAG_DONE &lt;br /&gt;
    ]); &lt;br /&gt;
&lt;br /&gt;
    If (AROSCursor &amp;lt;&amp;gt; nil) &lt;br /&gt;
    then writeln(&amp;#039;allocated new pointer object&amp;#039;) &lt;br /&gt;
    else writeln (&amp;#039;ERROR: could not create new pointer object&amp;#039;); &lt;br /&gt;
       &lt;br /&gt;
    // assume object is created &lt;br /&gt;
    Result := AROSCursor; &lt;br /&gt;
  end;  // done creating mousepointer object &lt;br /&gt;
   &lt;br /&gt;
  { Step 5: &lt;br /&gt;
    Give back the rastport &lt;br /&gt;
  } &lt;br /&gt;
  FreeRastPort(CursorRP); &lt;br /&gt;
&lt;br /&gt;
  { Step 6: &lt;br /&gt;
    Give back the bitmap &lt;br /&gt;
  } &lt;br /&gt;
  FreeBitMap(CursorBM); &lt;br /&gt;
&lt;br /&gt;
  { &lt;br /&gt;
  !!!!! DONE !!!!! &lt;br /&gt;
  }        &lt;br /&gt;
   &lt;br /&gt;
end; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(* &lt;br /&gt;
          Routine that free the AROS cursor and so give back the created object &lt;br /&gt;
*) &lt;br /&gt;
Procedure FreeAROSPointer(Var AROSCursor: PObject_); &lt;br /&gt;
begin &lt;br /&gt;
  if AROSCursor &amp;lt;&amp;gt; nil then &lt;br /&gt;
  begin &lt;br /&gt;
    // we are done with our pointer so we can free the pointerclass &lt;br /&gt;
    // Actually it is undetermined what happens if a cursor is &lt;br /&gt;
    // still in use by the AROS system. &lt;br /&gt;
    DisPoseObject(AROSCursor); &lt;br /&gt;
    AROSCursor := nil; &lt;br /&gt;
    writeln(&amp;#039;Disposed AROS object&amp;#039;); &lt;br /&gt;
  end &lt;br /&gt;
  else writeln(&amp;#039;ERROR: AROS pointerObject was not allocated and could therefore not be destroyed&amp;#039;); &lt;br /&gt;
end; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(* &lt;br /&gt;
          Routine to test the mousepointer &lt;br /&gt;
          Delaycount   = the nr of milliseconds to change the pointer &lt;br /&gt;
          AROSPointer  = the feshly created mousepointer class that &lt;br /&gt;
                         needs is being shown. &lt;br /&gt;
*) &lt;br /&gt;
Procedure TestPointer(delaycount: Integer; AROSPointer: pObject_); &lt;br /&gt;
var &lt;br /&gt;
  screen    : pScreen; &lt;br /&gt;
  Window    : pWindow; &lt;br /&gt;
begin &lt;br /&gt;
  // A window is needed, so start-out with a screen. &lt;br /&gt;
  Screen := LockPubScreen(nil); &lt;br /&gt;
  if (screen &amp;lt;&amp;gt; nil) then &lt;br /&gt;
  begin &lt;br /&gt;
    writeln(&amp;#039;found screen &amp;#039;, screen^.Title); &lt;br /&gt;
     &lt;br /&gt;
    // get the window that is desperately needed &lt;br /&gt;
    window := Screen^.firstwindow; &lt;br /&gt;
    if (window &amp;lt;&amp;gt; nil) then &lt;br /&gt;
    begin &lt;br /&gt;
      writeln(&amp;#039;found window &amp;#039;,window^.title); &lt;br /&gt;
&lt;br /&gt;
      writeln(&amp;#039;Starting cursor demo&amp;#039;); &lt;br /&gt;
      begin &lt;br /&gt;
        writeln(&amp;#039;Attempting to display cursor&amp;#039;); &lt;br /&gt;
         &lt;br /&gt;
        // if the given pointer is valid then continue &lt;br /&gt;
        If AROSPointer &amp;lt;&amp;gt; nil then &lt;br /&gt;
        begin &lt;br /&gt;
          // actually link the mousepointer to the window &lt;br /&gt;
          // so that it becomes visible when the window is &lt;br /&gt;
          // activated. &lt;br /&gt;
          SetWindowPointer(Window, [WA_Pointer, AROSPointer, TAG_DONE]); &lt;br /&gt;
                 &lt;br /&gt;
          writeln(&amp;#039;Current cursor is being displayed&amp;#039;); &lt;br /&gt;
          // Wait some time before returning back. &lt;br /&gt;
          DOSDelay(DelayCount); &lt;br /&gt;
        end  &lt;br /&gt;
        else writeln(&amp;#039;ERROR: Cursor did not had a valid object&amp;#039;); &lt;br /&gt;
       &lt;br /&gt;
      end; &lt;br /&gt;
      writeln(&amp;#039;ending cursor demo&amp;#039;); &lt;br /&gt;
&lt;br /&gt;
      // after fiddling and changing the cursor, the window &lt;br /&gt;
      // needs back its original cursor. &lt;br /&gt;
      // Unfortunatly there is no way of knowing if giving &lt;br /&gt;
      // back the default cursor succeeded or not. &lt;br /&gt;
      SetWindowPointer(Window, [WA_Pointer, 0, TAG_DONE]);       &lt;br /&gt;
&lt;br /&gt;
    end else writeln(&amp;#039;CERROR: ould not locate a window&amp;#039;); &lt;br /&gt;
&lt;br /&gt;
    // Albeit a bit late, the locked screen must really be unlocked. &lt;br /&gt;
    unlockpubscreen(nil, screen); &lt;br /&gt;
     &lt;br /&gt;
  end else WriteLn(&amp;#039;ERROR: could not locate a screen&amp;#039;); &lt;br /&gt;
end; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(* &lt;br /&gt;
       MAIN &lt;br /&gt;
*) &lt;br /&gt;
Var &lt;br /&gt;
  AROSMousePointer : pObject_; &lt;br /&gt;
   &lt;br /&gt;
begin &lt;br /&gt;
  writeln(&amp;#039;enter&amp;#039;); &lt;br /&gt;
&lt;br /&gt;
  // create real AROS mousepointer class from raw data &lt;br /&gt;
  AROSMousePointer := AllocAROSPointer(16,16,32, @RawData_16x16[0] ); &lt;br /&gt;
  //AROSMousePointer := AllocAROSPointer(32,32,32, @RawData_32x32[0] ); &lt;br /&gt;
  //AROSMousePointer := AllocAROSPointer(64,64,32, @RawData_64x64[0] ); &lt;br /&gt;
  If AROSMousePointer &amp;lt;&amp;gt; nil then &lt;br /&gt;
  begin &lt;br /&gt;
    writeln; &lt;br /&gt;
    // Do some visual mousepointer changing &lt;br /&gt;
    TestPointer(1000, AROSMousePointer); &lt;br /&gt;
    writeln; &lt;br /&gt;
    // Free the AROS mousepointer object. &lt;br /&gt;
    FreeAROSPointer(AROSMousePointer);        &lt;br /&gt;
  end; &lt;br /&gt;
  writeln(&amp;#039;leave&amp;#039;); &lt;br /&gt;
end.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Molly</name></author>
	</entry>
</feed>