Mike Gorchak
|
Can't set cursor shape using gf_cursor_set() function
|
Mike Gorchak
03/24/2009 4:17 AM
post25071
|
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.
|
|
|
Mike Gorchak
|
Re: Can't set cursor shape using gf_cursor_set() function
|
Mike Gorchak
03/24/2009 5:48 AM
post25077
|
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.
|
|
|
Mike Gorchak
|
Re: Can't set cursor shape using gf_cursor_set() function
|
Mike Gorchak
03/25/2009 5:14 AM
post25152
|
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...
|
|
|
Misha Nefedov
|
Re: Can't set cursor shape using gf_cursor_set() function
|
Misha Nefedov
03/25/2009 8:50 AM
post25162
|
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.
|
|
|
Mike Gorchak
|
Re: Can't set cursor shape using gf_cursor_set() function
|
Mike Gorchak
03/25/2009 9:17 AM
post25166
|
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.
|
|
|
Mike Gorchak
|
Re: Can't set cursor shape using gf_cursor_set() function
|
Mike Gorchak
03/25/2009 9:29 AM
post25170
|
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 ?
|
|
|
Misha Nefedov
|
Re: Can't set cursor shape using gf_cursor_set() function
|
Misha Nefedov
03/25/2009 9:54 AM
post25175
|
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.
|
|
|
Mike Gorchak
|
Re: Can't set cursor shape using gf_cursor_set() function
|
Mike Gorchak
03/25/2009 10:08 AM
post25180
|
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 ?
|
|
|
Misha Nefedov
|
Re: Can't set cursor shape using gf_cursor_set() function
|
Misha Nefedov
03/25/2009 10:34 AM
post25183
|
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.
|
|
|
Mike Gorchak
|
Re: Can't set cursor shape using gf_cursor_set() function
|
Mike Gorchak
03/25/2009 10:56 AM
post25188
|
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.
|
|
|
Mike Gorchak
|
Re: Can't set cursor shape using gf_cursor_set() function
|
Mike Gorchak
03/26/2009 4:07 AM
post25280
|
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 ?
|
|
|
Derek Leach
|
RE: Can't set cursor shape using gf_cursor_set() function
|
Derek Leach
03/26/2009 5:17 AM
post25288
|
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
|
|
|
Mike Gorchak
|
Re: RE: Can't set cursor shape using gf_cursor_set() function
|
Mike Gorchak
03/27/2009 1:32 AM
post25416
|
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.
|
|
|
Derek Leach
|
RE: RE: Can't set cursor shape using gf_cursor_set() function
|
Derek Leach
03/27/2009 5:35 AM
post25424
|
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
|
|
|
Derek Leach
|
Re: RE: RE: Can't set cursor shape using gf_cursor_set() function
|
Derek Leach
03/30/2009 7:27 AM
post25512
|
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
|
|
|
Mike Gorchak
|
Re: RE: RE: Can't set cursor shape using gf_cursor_set() function
|
Mike Gorchak
04/02/2009 2:48 AM
post25809
|
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.
|
|
|
Derek Leach
|
RE: RE: RE: Can't set cursor shape using gf_cursor_set() function
|
Derek Leach
04/02/2009 3:06 AM
post25810
|
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
|
|
|
cemal demir
|
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function
|
cemal demir
04/28/2010 8:32 PM
post53101
|
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,
|
|
|
Derek Leach
|
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function
|
Derek Leach
04/29/2010 8:22 AM
post53138
|
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?
|
|
|
cemal demir
|
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function
|
cemal demir
04/29/2010 12:07 PM
post53198
|
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.
|
|
|
cemal demir
|
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function
|
cemal demir
04/29/2010 12:07 PM
post53200
|
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function
io-display is running!...
|
|
|
Derek Leach
|
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function
|
Derek Leach
04/29/2010 1:07 PM
post53208
|
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.
|
|
|
cemal demir
|
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function
|
cemal demir
04/29/2010 1:26 PM
post53210
|
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function
|
|
|
Derek Leach
|
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function
|
Derek Leach
04/30/2010 8:18 AM
post53282
|
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.
|
|
|
cemal demir
|
Re: RE: RE: RE: Can't set cursor shape using gf_cursor_set() function
|
cemal demir
04/30/2010 6:07 PM
post53361
|
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?
|
|
|
|