Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Can't set cursor shape using gf_cursor_set() function: Page 1 of 2 (26 Items)
   
Can't set cursor shape using gf_cursor_set() function  
devg-tnt driver is in use, cursor is disabled and set to 0,0, then function gf_cursor_set() is called with following 
parameters:

gf_cursor_set(display, 0, internal_cursor);

Dump of internal_cursor:
internal_cursor->type=0
internal_cursor->hotspot.x=8
internal_cursor->hotspot.y=8
internal_cursor->cursor.bitmap.w=16
internal_cursor->cursor.bitmap.h=16
internal_cursor->cursor.bitmap.color0=FF000000
internal_cursor->cursor.bitmap.color1=FFFFFFFF
internal_cursor->cursor.bitmap.stride=2

Next dump:
internal_cursor->type=0
internal_cursor->hotspot.x=0
internal_cursor->hotspot.y=0
internal_cursor->cursor.bitmap.w=16
internal_cursor->cursor.bitmap.h=16
internal_cursor->cursor.bitmap.color0=FF000000
internal_cursor->cursor.bitmap.color1=FFFFFFFF
internal_cursor->cursor.bitmap.stride=2

type 0 is value GF_CURSOR_BITMAP of enum gf_cursor_type_t.

gf_cursor_set() always returns GF_ERR_PARM. These parameters are standard, the same data working with devg-tnt using 
Photon.

Derek, could you trace gf_cursor_set() with these parameters and say me what is wrong ? Looks like it is not a driver 
problem, it is a GF problem.
Re: Can't set cursor shape using gf_cursor_set() function  
Tested on devg-radeon, it doesn't return an error, but there is no cursor (maybe my fault, need to check why).

So previous error GF_ERR_PARM was due to devg-tnt driver, but hardware cursor works fine in photon and why it doesn't 
work while using GF ?

Documentation about gf_cursor_set(), gf_cursor_enable(), gf_cursor_disable(), gf_cursor_set_pos() functions is not 
complete. When using these functions using devg-svga driver these functions return GF_ERR_NOSUPPORT error, which is not 
documented. As far as I understand this error will be on each graphics driver when hardware not supports hardware 
cursors.
Re: Can't set cursor shape using gf_cursor_set() function  
Can't enable cursor at all on devg-radeon.

I use following parameters:
internal_cursor->type=0;
internal_cursor->hotspot.x=0;
internal_cursor->hotspot.y=0;
internal_cursor->cursor.bitmap.w=16;
internal_cursor->cursor.bitmap.h=16;
internal_cursor->cursor.bitmap.color0=00FFFFFF;
internal_cursor->cursor.bitmap.color1=00FFFFFF;
internal_cursor->cursor.bitmap.stride=2;
internal_cursor->cursor.bitmap.image0={0xFF 0xFF 0xFF ... 0xFF 0xFF};
internal_cursor->cursor.bitmap.image1={0xFF 0xFF 0xFF ... 0xFF 0xFF};

Order of function execution (if order means):
1) gf_cursor_disablee();
2) gf_cursor_set_pos(); to 0,0
3) gf_cursor_set();
4) gf_cursor_enable();

With following parameters I must get just white 16x16 square at 0,0 screen position. But there is no any cursor.

What did I do wrong ? I'm tired to fight with windmills...
Re: Can't set cursor shape using gf_cursor_set() function  
Try switch set_pos() and set() around. The cursor should be set before its position is set. Otherwise this snippet looks
 ok.
If this still doesn't work, please post a sample app.
Re: Can't set cursor shape using gf_cursor_set() function  
Just tested, nothing changed. I tried all sixteen function order combinations  to be sure, still doesn't work. Even 
tested on devg-extreme2 driver using i82862 graphics controller, behaviour the same.

Within few hours I will post test application.
Re: Can't set cursor shape using gf_cursor_set() function  
Misha, use gf_cursor utility which shipped with QNX 6.4 default installation. This utility also doesn't work in console 
mode, but works in photon (tested on devg-radeon and devg-extreme2).

Misha, could you say me the truth, am I a first user of GF library ?
Re: Can't set cursor shape using gf_cursor_set() function  
I tested the gf_cursor on my Radeon and it works fine.
I guess you are not running it properly. The gf_cursor doesn't "initialize rendering", it just sets up the cursor and 
moves it. When you run gf_cursor on its own (without any other gf rendering apps) your display most likely just turns 
off. 
Run the demo-alpha application, leave it running and run the gf_cursor . You will see the cursor. ;-)

You are NOT the first one who is using GF.
Re: Can't set cursor shape using gf_cursor_set() function  
> I tested the gf_cursor on my Radeon and it works fine.
> I guess you are not running it properly.
> The gf_cursor doesn't "initialize 
> rendering", it just sets up the cursor and moves it.

What you mean when said "doesn't initialize rendering" ? Hardware cursor is part of CRTC controller, why I need to setup
 something additionally, like rendering context and how it is connected to hardware cursor ? Or GF is not using hardware
 cursors and requires rendering context to draw software cursor ? Why I need to create rendering contexts using OpenGL 
ES ?

> When you run gf_cursor on
>  its own (without any other gf rendering apps) your display most likely just 
> turns off.

Not, it is not turned off (in my case, running my application) I can see picture, but no cursor.

> Run the demo-alpha application, leave it running and run the gf_cursor . You 
> will see the cursor. ;-)

What EXACTLY demo-alpha initializes to show up cursor ? 
Re: Can't set cursor shape using gf_cursor_set() function  
I meant this:
The gf_cursor doesn't enable layers automatically (that is by the design of the gf_cursor). That is why you see nothing 
when you run the gf_cursor on its own. In order to see the cursor we require to have an enabled layer (that what the 
demo-alpha does, or any other "rendering" app), otherwise if we had just enabled a layer in the gf_cursor, you would see
 "gagbage" displayed and your cursor.
Re: Can't set cursor shape using gf_cursor_set() function  
Main display layer is attached by gf_layer_attach() function, and gf_layer_enable() is called for main display.

gf_layer_set_surfaces() is not called, since my application is using OpenGL ES, and gf_3d_target_create() creates 
surface for OpenGL ES displaying.

I think documentation must mention this behavior of cursor function set.

Ok, I will try to re-setup all layer parameters. Thank you for help.
Re: Can't set cursor shape using gf_cursor_set() function  
Still no any cursor on the screen. I'm using these functions in such order (I use main display layer):

1) gf_layer_attach()
2) gf_layer_set_src_viewport()
3) gf_layer_set_dst_viewport()
4) gf_layer_set_surfaces()
5) gf_layer_update()
6) gf_layer_enable()

What I missed in my code ?
RE: Can't set cursor shape using gf_cursor_set() function  
Hi Mike,
 
I will try and find time to make a code example.  If you are having trouble, then no doubt other people will have as 
well.  It might not be until next week, I have very many things to finish before the week is finished.
 
FYI:  io-graphics uses these gf_cursor_xxxx() calls.  I know I keep mentioning io-graphics, but it was a serious "
regression test" for GF functionality, we found many holes.  As you have also noticed, io-display only has the "hardware
" cursor - the software cursor in io-graphics is accomplished with a back buffer and blitting a surface around.
 
Regards,
-Derek

________________________________

From: Mike Gorchak [mailto:community-noreply@qnx.com]
Sent: Thu 26/03/2009 4:07 AM
To: advanced-graphics
Subject: Re: Can't set cursor shape using gf_cursor_set() function



Still no any cursor on the screen. I'm using these functions in such order (I use main display layer):

1) gf_layer_attach()
2) gf_layer_set_src_viewport()
3) gf_layer_set_dst_viewport()
4) gf_layer_set_surfaces()
5) gf_layer_update()
6) gf_layer_enable()

What I missed in my code ?


_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post25280



Attachment: Text winmail.dat 4.28 KB
Re: RE: Can't set cursor shape using gf_cursor_set() function  
> I will try and find time to make a code example.  If you are having trouble, 
> then no doubt other people will have as well.  It might not be until next week
> , I have very many things to finish before the week is finished.

It would be nice to have such example :)

> FYI:  io-graphics uses these gf_cursor_xxxx() calls.  I know I keep mentioning
>  io-graphics, but it was a serious "regression test" for GF functionality, we 
> found many holes.  As you have also noticed, io-display only has the "hardware
> " cursor - the software cursor in io-graphics is accomplished with a back 
> buffer and blitting a surface around.

I noticed recently that io-graphics has the same problem with cursor as my application has. Cursor often (but not each 
time) is placed beyond the bottom-right or top-right border of displayable screen. I need sometimes to move mouse around
 table to get cursor on screen.
RE: RE: Can't set cursor shape using gf_cursor_set() function  
ok, cool ... when I get a chance, I will put debug messages in io-graphics and see if I can catch these 'out-of-bound' 
conditions.
 
-Derek

________________________________

From: Mike Gorchak [mailto:community-noreply@qnx.com]
Sent: Fri 27/03/2009 1:32 AM
To: advanced-graphics
Subject: Re: RE: Can't set cursor shape using gf_cursor_set() function



> I will try and find time to make a code example.  If you are having trouble,
> then no doubt other people will have as well.  It might not be until next week
> , I have very many things to finish before the week is finished.

It would be nice to have such example :)

> FYI:  io-graphics uses these gf_cursor_xxxx() calls.  I know I keep mentioning
>  io-graphics, but it was a serious "regression test" for GF functionality, we
> found many holes.  As you have also noticed, io-display only has the "hardware
> " cursor - the software cursor in io-graphics is accomplished with a back
> buffer and blitting a surface around.

I noticed recently that io-graphics has the same problem with cursor as my application has. Cursor often (but not each 
time) is placed beyond the bottom-right or top-right border of displayable screen. I need sometimes to move mouse around
 table to get cursor on screen.


_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post25416



Attachment: Text winmail.dat 4.26 KB
Re: RE: RE: Can't set cursor shape using gf_cursor_set() function  
Hi Mike,

Code example posted at:

http://community.qnx.com/sf/frs/do/viewRelease/projects.graphics/frs.advanced_graphics.ag_cursor_demo?_message=
1238412211185

If there is any problems with it, let me know.  There may be garbage on the screen with some graphics drivers, but you 
should still see the cursor move around.  The demo is self contained (you don't need to run another AG app), and just 
moves the cursor around the perimeter of the screen.

Regards,
-Derek
Re: RE: RE: Can't set cursor shape using gf_cursor_set() function  
> If there is any problems with it, let me know.  There may be garbage on the 
> screen with some graphics drivers, but you should still see the cursor move 
> around.  The demo is self contained (you don't need to run another AG app), 
> and just moves the cursor around the perimeter of the screen.

Thanks, Derek, for the demo. Finally I have found bug in my code which prevented hardware cursor appearance due to 
numerous video mode switches.

RE: RE: RE: Can't set cursor shape using gf_cursor_set() function  
No problem, glad it worked out.
 
-Derek

________________________________

From: Mike Gorchak [mailto:community-noreply@qnx.com]
Sent: Thu 02/04/2009 2:48 AM
To: advanced-graphics
Subject: Re: RE: RE: Can't set cursor shape using gf_cursor_set() function



> If there is any problems with it, let me know.  There may be garbage on the
> screen with some graphics drivers, but you should still see the cursor move
> around.  The demo is self contained (you don't need to run another AG app),
> and just moves the cursor around the perimeter of the screen.

Thanks, Derek, for the demo. Finally I have found bug in my code which prevented hardware cursor appearance due to 
numerous video mode switches.



_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post25809



Attachment: Text winmail.dat 3.85 KB
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function  
Hi derek,

I studying your demo but I can't any curson on screen?
Code running.

is there any configuration for this project?

because I can't open downloaded file.

I copied text to new project and then compiled, 
Attachment: Image Untitled-2.jpg 485.64 KB
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function  
Are you running io-display?
Have you enabled the layer, and called gf_layer_update()?

Why can you not download the file?
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function  
I can't open anyway?

I copied full text to new cursor emty project and I didn't anychange in code lines.
project->properties->linker->options -lgf

only that modification and then running.

gf_layer_update is existing in project


How can open whicj I downloaded?

I don't want to do copy-paste, may be problem is there.
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function  
io-display is running!...
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function  
Oh, do you mean the gf_cursor application?  Sorry, this thread is so old, I completely forgot about the context.
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function  
this code is wrong?
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function  
Just to clarify, what devg driver are you using?

Can you please post your code, with the parameter calls?

thx.
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function  
gdev_info.description = vesa - unaccelerated driver for VESA 2.00 compliant adapters


is this which you want?