Friday, December 21, 2007

DSO Example

In the exampleDSO.tar.gz you'll get the files:
exampleDSO/
exampleDSO/GNUmakefile
exampleDSO/exampleDSO.cpp

untar it, cd to exampleDSO, type
make and run the DSO. (Don't forget to have dgl-config and dtk-config in
your $PATH.)

You can then run it using the command:
> export DGL_DSO_FILES=desktopGroup
:exampleDSO
> dosg-fly --examine cow.osg

The DSO doesn't do much except print out the size of the first graphics
window, but does show you how to get the the Producer::RenderSurface
corresponding to the window, which might be handy. Eventually you'll want
to get all render surfaces for all windows, but we can deal with that later.

Here's an example of using a different DSO to get different behavior, and
might be handy for testing with multiple windows:
> export DGL_DSO_FILES=desktopGroup:hyperDisplay:exampleDSO
> dosg-fly --examine cow.osg

This DSO doesn't have every single callback used- it's not clear what
callbacks you need, and what you want the DSO to do. Let's get this one
working first, then later when the DSO's functionality is defined, I can
help you add more callbacks if they're needed.

If you need to add a DSO to the DIVERSE package itself, send it to me and
I'll test it and install it in DIVERSE for you. I think this would be saner
than you trying to mess with the DIVERSE package itself.

Wednesday, December 12, 2007

CCallBackHelix DTK Issue

We would like to have some information on how keyboard and mouse are controlled in the "CCallbackHelix" example.

When a mouse button is pressed, information on this button is displayed in the terminal
This is achieved by the pointer "button" from the line:

dtkInButton* button = (dtkInButton*) DGL::getApp()->get("buttons", DTKINBUTTON_TYPE);

We would like that mouse control is no more done this way but rather through Qt. We are currently writing a small application in Qt and when a mouse button is pressed on the Qt Window, mouse information is displayed on the terminal. We'll then try to implement this on the "CCallbackHelix" example.

We expect to have the following if we succeed:
- A window created with Qt in which we will display the Helix
- Mouse and keyboard events will be controlled in Qt

Questions
- Is the Producer API used to control the mouse in the "CCallbackHelix" example or is it through DTK?

------------------------------------------------------------------------------------------------------------------------------------
John replied:

When DIVERSE was first written, it ran only on X11 based systems such as
Linux and IRIX. DTK created some classes which use X11 to read the
keyboard, mouse and mouse buttons. When DGL was written by Andrew, he
decided to use Producer to handle the keyboard, mouse and buttons (and also
windows). He felt this would be the easiest way to support non-X11
platforms.

Except for bug fixes, DTK is basically a "frozen" project. The original DTK
developer is no longer around, so we pretty much use DTK as is. New
functionality is written in DGL.

Andrew came up with a way in DGL to feed data to DTK using Producer, so the
old X11 DTK code would still work. For example, the DTK trackballNav DSO
works with DGL's Producer code stuffing the mouse and buttons, but is
unchanged since it was originally written to use DTK's X11 code.

This is done in the DMKCallback class in the files
diverse/dgl/libs/dgl/DProducer
InputCallback.cpp and
diverse/dgl/include/dgl/DProducerInputCallback.h.

Other little DGL-only utility classes exist too: DGLKeyboard, DGLMouse,
DGLMouseButton. DTK doesn't use them, but they do use Producer.

Take a look in the DGLWindow class, and look for "DMKCallback". You'll see
it get set up in the postRealize() callback, and called every frame in the
updateKM() callback.