Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
150 user(s) are online (131 user(s) are browsing Forums)

Members: 1
Guests: 149

LiveForIt, more...

Support us!

Headlines

 
  Register To Post  

How blank mouse pointer on OS4? (Solved)
Home away from home
Home away from home


See User information
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.
Go to top
Re: How blank mouse pointer on OS4?
Home away from home
Home away from home


See User information
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.
Go to top
Re: How blank mouse pointer on OS4?
Just popping in
Just popping in


See User information
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.

Go to top
Re: How blank mouse pointer on OS4?
Home away from home
Home away from home


See User information
@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 bitmappointer:APTR
    
    
IF bitmap  := AllocBitMap(16162BMF_STANDARD OR BMF_CLEAR /*OR BMF_DISPLAYABLE*/NIL)
        IF 
pointer := NewObjectA(NIL/*classID*/ 'pointerclass', [POINTERA_BITMAP,bitmapTAG_END]:tagitem)
            
SetWindowPointer(win, [WA_POINTER,pointerTAG_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.
Go to top
Re: How blank mouse pointer on OS4?
Just popping in
Just popping in


See User information
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_XResolutionPOINTERXRESN_SCREENRES,
POINTERA_YResolutionPOINTERYRESN_SCREENRESASPECT,
TAG_DONE


Have you checked if AllocBitMap() or NewObjectA() fail?

Go to top
Re: How blank mouse pointer on OS4?
Home away from home
Home away from home


See User information
@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.
Go to top
Re: How blank mouse pointer on OS4? (Solved)
Home away from home
Home away from home


See User information
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]:UINT0000)
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.
Go to top
Re: How blank mouse pointer on OS4? (Solved)
Home away from home
Home away from home


See User information
Another option is to use the def_nonepointer.info that comes with OS4.1


Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 2 ( 0 members and 2 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project