Blender3D & cursor clamping.

Kristian Høgsberg krh at bitplanet.net
Thu Dec 9 11:36:21 PST 2010


On Sun, Dec 5, 2010 at 8:27 PM, Campbell Barton <ideasman42 at gmail.com> wrote:
> Hi there, I'm interested in porting blender3d to Wayland. Currently we
> use an internal library which is a bit like SDL, talking to X11, Win32
> and Cocoa directly.

Hi Campbell,

That's exciting, let me know what problems you run into, but also bear
in mind that Wayland is still work in progress and even at the
protocol level things may (and will) change.

> Since we use OpenGL directly for all drawing I don't expect the port
> to be all that big a deal.

There's a couple of tricky things about GL in Wayland right now. First
of, it's all EGL and GLES2.  Longer term we'll need an answer for apps
that need full GL, but the problem is that libGL pulls in GLX and all
the X dependencies.  The other thing is that there is no EGLSurface
support in Wayland, you just render to a FBO and push the color buffer
to the Wayland compositor.  We may add an EGLSurface for Wayland at
some pointer, but for now there's a little more bookkeeping to do on
the client side.

> I'm interested in how Wayland deals with input & about mouse coordinates.
>
> Currently Blender can fake off screen mouse coordinates on X11 by
> hiding the cursor warping the position.
> However it would be a lot nicer if the Wayland functions were able to
> do this. (I heard this is possible on the OSX).
>
> Are there any docs on how to grab the mouse cursor, warp the cursor
> and is there anything like raw events which can be used for low level
> interface functions?

There are no docs, but we've discussed similar requirements before:

  http://lists.freedesktop.org/archives/wayland-devel/2010-November/000117.html

The idea is what I call "application pointer" in that email.  The idea
is that the compositor hides the cursor and just sends relative motion
events.  The application is then responsible for updating cursor
position, including pointer acceleration etc, or just not draw a
cursor but spin a cube, rotate the viewport or control a game.  Now
one thing I'd like to do different from X is that this mode isn't
going to be an open ended grab.  The compositor is going to be in
control and will be able to override it and switch to different
applications.  I'm thinking that this input mode is only available
when the application is fullscreen or optionally while a mouse button
is pressed.  Maybe also while the application has keyboard focus.

Kristian


More information about the wayland-devel mailing list