Who's Online
134 user(s) are online (
121 user(s) are browsing
Forums )
Members: 1
Guests: 133
VooDoo ,
more...
Topic options
View mode
Newest First
How blank mouse pointer on OS4? (Solved)
Posted on:
2012/8/4 15:57
#1
Home away from home
Joined: 2007/5/19 14:23Last Login
: 1/2 17:30
From England
Group:
Registered Users
Is there any official way to blank the mouse pointer on OS4?
I assume there must be, but so far I have only found code to do it on OS3, and that is such yucky low-level stuff that I doubt it work on OS4 (and even if it worked it must be depreciated). For example:
Quote:
#include <graphics/gfxmacros.h> #include <hardware/custom.h> OFF_SPRITE; custom.spr[0].dataa = 0; /* sprite0 DMA */ custom.spr[0].datab = 0; /* data register */ ON_SPRITE; (DMouse)
Quote:
#include <clib/graphics_protos.h> struct SimpleSprite simplesprite = { NULL, /* UWORD *posctldata; filled later */ 0, /* UWORD height; */ 0, 0, /* UWORD x,y; current position */ 0 /* UWORD num; */ }; Forbid(); FreeSprite(0); GetSprite(&simplesprite, 0); Permit(); (MouseBlanker - and I haven't yet worked-out how it unblanks the mouse!)
Edited by ChrisH on 2012/8/4 19:05:02
Author of the
PortablE programming language.
Re: How blank mouse pointer on OS4?
Posted on:
2012/8/4 17:05
#2
Home away from home
Joined: 2007/5/19 14:23Last Login
: 1/2 17:30
From England
Group:
Registered Users
I'm now suspecting that I might be able to achieve what I want using SetWindowPointer(), but need to find out how to create a (blank) pointer...
Author of the
PortablE programming language.
Re: How blank mouse pointer on OS4?
Posted on:
2012/8/4 17:51
#3
Just popping in
Joined: 2007/4/15 2:51Last Login
: 9/21 21:13
From Waterville, Minnesota, USA
Group:
Registered Users
I think you need to create a simple_sprite structure. I'm not sure if ext_sprite structures are even supported by the OS 4 pointer. I know for sure that 16-color pointers aren't supported but that wasn't what you asked.
Re: How blank mouse pointer on OS4?
Posted on:
2012/8/4 18:01
#4
Home away from home
Joined: 2007/5/19 14:23Last Login
: 1/2 17:30
From England
Group:
Registered Users
@Samurai_Crow
I don't think a sprite structure is needed for Set*Window*Pointer().
@anyone (!)
I thought
this code would help, but not enough it seems. I am beginning to get annoyed now (i.e. I am all out of ideas for the moment). AFAICS, the following code *should* work:
PROC blankMousePointer ( win : PTR TO window )
DEF bitmap : PTR TO bitmap , pointer : APTR
IF bitmap := AllocBitMap ( 16 , 16 , 2 , BMF_STANDARD OR BMF_CLEAR /*OR BMF_DISPLAYABLE*/ , NIL )
IF pointer := NewObjectA ( NIL , /*classID*/ 'pointerclass' , [ POINTERA_BITMAP , bitmap , TAG_END ]: tagitem )
SetWindowPointer ( win , [ WA_POINTER , pointer , TAG_END ]: tagitem )
ENDIF
ENDIF
ENDPROC
(This is E code, but it should be almost identical to equivalent C code.)
Author of the
PortablE programming language.
Re: How blank mouse pointer on OS4?
Posted on:
2012/8/4 18:59
#5
Just popping in
Joined: 2007/5/15 13:42Last Login
: 2023/3/8 14:54
From Austria
Group:
Registered Users
Just some thoughts:
You're using NewObject*A*() but SetWindowPointer() with the same []:tagitem construct. I don't know which one is correct.
The tag is "POINTERA_BitMap", aren't tags case sensitive?
Have you tried with additional tags:
POINTERA_BitMap , bitmap ,
POINTERA_XOffset , 0 ,
POINTERA_YOffset , 0 ,
POINTERA_WordWidth , 1 ,
POINTERA_XResolution , POINTERXRESN_SCREENRES ,
POINTERA_YResolution , POINTERYRESN_SCREENRESASPECT ,
TAG_DONE
Have you checked if AllocBitMap() or NewObjectA() fail?
Re: How blank mouse pointer on OS4?
Posted on:
2012/8/4 19:04
#6
Home away from home
Joined: 2007/5/19 14:23Last Login
: 1/2 17:30
From England
Group:
Registered Users
@Gazelle Quote:
You're using NewObject*A*() but SetWindowPointer() with the same []:tagitem construct. I don't know which one is correct. Thank you! I should have been using SetWindowPointerA(). Who knows how long that would have taken me to spot? It works brilliantly now, thanks
P.S. My shown code fragment is not "final", because I don't take care to deallocate anything.
Author of the
PortablE programming language.
Re: How blank mouse pointer on OS4? (Solved)
Posted on:
2012/8/9 19:22
#7
Home away from home
Joined: 2007/5/19 14:23Last Login
: 1/2 17:30
From England
Group:
Registered Users
It turns out that I am making this way too complicated, as it can be achieved much simpler:
PROC blankMousePointer ( win : PTR TO window )
SetPointer ( win , [ 0 , 0 ]: UINT , 0 , 0 , 0 , 0 )
ENDPROC
PROC unblankMousePointer ( win : PTR TO window )
IF win THEN ClearPointer ( win )
ENDPROC
(This will need OPT POINTER until the next beta release of PortablE r6)
Thanks to BillEaves for the big hint!
Author of the
PortablE programming language.
Re: How blank mouse pointer on OS4? (Solved)
Posted on:
2012/8/9 20:13
#8
Home away from home
Joined: 2006/12/4 23:15Last Login
: 10/14 16:04
Group:
Registered Users
Another option is to use the def_nonepointer.info that comes with OS4.1
Currently Active Users Viewing This Thread:
1
(
0 members
and 1 Anonymous Users
)