gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About OpenGL and NSView


From: Xavier Glattard
Subject: Re: About OpenGL and NSView
Date: Mon, 02 Mar 2009 18:24:52 +0100
User-agent: Thunderbird 2.0.0.16 (X11/20080707)



Fred Kiefer a écrit :
Xavier Glattard wrote:
I would like to post some changes about OpenGL support.
(in gui and x11-back, soon in win32-back)

Great.

I need to add a flag in NSView (in the _rFlags bit field). I think it
would not break anything but i may miss something.

Any advice ? Thanks!

There is plenty of space in that field left. Soem time ago I wanted to
move all the other boolean flags of NSView into that field too, but
didn't dare to do this as it might break subclasses. But a new entry
wont cause trouble.

What will that new bit be used for?

I found out that the backing store of the OpenGLView is marked as dirty then flushed after each drawing loop. This is useless because openGL does not draw anything on the backing store. So I created a 'ignore_backing' flag that says the NSView does not need to trigger a flush. This flag is set by GLContext when it is attached to a view.
I get a 30% speed improvement! (same speed than non retained backing store)
Moreover i think this change will fix the bug I submitted some days ago about flickering win32 opengl window. I'm about to check this.

Fred: I've just updated my tree with your last changes some days ago.
Revision 27944 seems to break NSOpenGLView position: the view is moves
left and up -ward.
IMHO settting the background color (Rev 27945) is useless because the GL
context MUST clear the background (on my system).

I only set the background colour to avoid random patterns being
displayed before the OpenGL rendering starts. It made a difference for me.

I understand. I suppose my computer is too fast... (???)

As for the change 27944, most likely the removal of that strange
coordinate conversion makes the difference for you. With the current
code things look correct for me with and without GNUstep drawing the
windows decoration. (This being on Linux, not Windows) I have attached
two screen shots of Gears to show the result.

If things look different for you, we need to find out what may cause the
difference. Are you using any GNUstep additions or themes?

If you look carefully your screenshots you can see that the GL view is shifted upward and to the right. It looks slightly different on my system because I use WMaker. I think the shift comes from the width of the window decorations : bottom and left borders. These are small on your system. The bottom border width is larger with WMaker.

I dont understand where these come from. It looks like the window decorations widths are always used to convert coordinates, even if the backend does not handle them. There is no problem with NSViews because they are relative to the contentView. But the OpenGL subwindow is relative to the XWindow!

If you draw the background of the GL view (with NSRectFill) you can see that only the sub-window is shifted, not the NSView.










reply via email to

[Prev in Thread] Current Thread [Next in Thread]