Opened 17 years ago

Last modified 17 years ago

#1032 closed bug

BGLView::DirectConnected() badly implemented — at Version 8

Reported by: korli Owned by: jackburton
Priority: high Milestone: R1
Component: Kits/OpenGL Kit Version: R1/pre-alpha1
Keywords: Cc: phoudoin, jackburton, ekdahl
Blocked By: Blocking:
Platform: All

Description (last modified by phoudoin)

BGLView::DirectConnected() is badly implemented. Several screen savers crash in it.

MesaSoftwareRenderer::DirectConnected() is not implemented yet. It could be needed to implement it to fix this bug.

Change History (8)

comment:1 by korli, 17 years ago

Cc: phoudoin added

comment:2 by korli, 17 years ago

Cc: jackburton added

comment:3 by ekdahl, 17 years ago

Cc: ekdahl added

in reply to:  description comment:4 by ekdahl, 17 years ago

Replying to korli:

BGLView::DirectConnected() seems badly implemented. Several screen savers crash in it.

What screen savers crash in it?

comment:5 by korli, 17 years ago

Quoting phoudoin:

"Well, the idea behind BGLView::DirectConnected is to use the input direct_info data, to keep up-to-date a private copy of such direct_info but always clipped on the GLView frame on screen (or even better, the visible part of it), not its whole BDirectWindow's parent screen frame one. The renderer will use this private copy as he wants (single buffer rendition, fast page swapping for hardware renderers), but he should not have worry about doing the clipping himself.

Clipping GLView's children view(s) could be a bonus, but I'm not sure it's even supported under R5 nor very common case..."

comment:6 by jackburton, 17 years ago

I could try to implement it, as I have a somewhat deep knowledge of how BDirectWindow works, but I would need a test app.

comment:7 by korli, 17 years ago

I had a look at GLTeapot and it uses a BDirectWindow. Maybe modifying it to have a full screen test version could help. At the moment, BGLView/MesaSoftwareRenderer always uses BView::DrawBitmap() to draw the view content. I suppose BGLView/MesaSoftwareRenderer should instead check whether the parent window is a BDirectWindow, and act differently in this case (using direct_info). I'm no expert here. Having several test cases would surely help.

in reply to:  7 comment:8 by phoudoin, 17 years ago

Description: modified (diff)
Owner: changed from korli to jackburton
Priority: normalhigh

I guess one could quickly transform Mesa's beos "sample" program to use BDirectWindow instead of plain BWindow and make the GLView not a little bit inner the window area for clipping testbed. Would make a basic test app. I'll try to commit such app as soon as possible, if RealLife (tm) give me a break.

Regarding direct window support, the renderer's EnableDirectMode() method will be first called by BGLView when direct mode is turn on or off. When on, renderer's DirectConnected() method will be called each time the direct access configuration changes, aka in the same cases than BDirectWindow::DirectConnect() method. The single difference is about view vs window. We need to clip the direct mode info to the GLView area before forward the info to the renderer. We should not touch directly ouside view visible region. This clipping task should be done whatever the renderer is, in BGLView::DirectConnected() method, *before* passing (clipped) info to the renderer. The commented out code there today doesn't do such clipping but just copying the info. Rudolf's nvidia 3D driver hack to avoid drawing over menu bar is a workaround which happens to be enough for GLTeapot because beside the menu bar the OpenGL view take full window surface. It's not enough.

The next task, indeed, is to add to our current MesaSoftwareRenderer support for direct rendering, most probably dvia a dedicated direct drawing thread. But it could/should be the subject of a seperate "MesaSoftwareRenderer don't support direct mode" ticket IMHO.

Note: See TracTickets for help on using tickets.