This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: It works!


I'm taking this to the list so takuma and kesuke may comment it too.

On Fri, 12 Mar 2004, Alexander Gottwald wrote:

> On Thu, 11 Mar 2004, Harold L Hunt II wrote:
> > http://msu.edu/~huntharo/xwin/devel/server/CygwinX-Accelerated-OpenGL-Support-20040311-2030.png
> > (24 KiB)
> > 
> > The only problem with it that I noticed was minor and obvious:
> > 
> > It allocates the OpenGL surface according to the properties of the 
> > current window's parent, not the current window.  So, the glxgears 
> > program shows up in the xterm window instead of the glxgears window. 
> > Also, if you run without multi-window and use twm, the OpenGL surface 
> > will fill the entire root window (seems to be the same problem). 
> > Interesting: if you move the xterm window in multi-window mode, the 
> > surface moves with that window correctly :)

The GL rendering is bound to the devicecontext. The DC moves if you move 
the window. In normal mode the GL rendering uses the whole xserver window
and draws the gears in the lower left corner. Clear sign of wrong DC size.

> 
> I currently use GetActiveWindow() to get a window handle. This surely
> wrong. But attaching to the real window will require some functions 
> which get the hwnd from the pScreenPriv structure

What I need is a function 

struct win_window_metrics 
{
    HWND hwnd;
    RECT rect;
}

void win_get_window_metrics(WindowPtr winptr, win_window_metrics &metrics)
{
  if (multiwindow) {
    metrics->hwnd = window_hwnd;
    metrics->rect.left = 0;
    metrics->rect.top = 0;
    metrics->rect.right = window_width;
    metrics->rect.bottom = window_height;
  } else {
    metrics->hwnd = global_hwnd;
    metrics->rect.left = window_left;
    metrics->rect.top = window_top;
    metrics->rect.right = window_left + window_width;
    metrics->rect.bottom = window_top + window_height;
  }
}

If we already have a HRGN handle i could use that instead of the RECT. 
I have to create a region anyway in GetDCEx(hwnd, hrgn, flags). 

bye
	ago
-- 
 Alexander.Gottwald@s1999.tu-chemnitz.de 
 http://www.gotti.org           ICQ: 126018723


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]