1. Is the only way to execute OpenGl commands (glColor3f) by setting a call back function when setting the window to V3d_View?
V3d_View::SetWindow(hWnd,&function);
2. If you want to control the drawing (to the window), is the best way to create a frame buffer object and render that yourself?
Thank you for your advice, it would be great to have answers to these because it would open opportunities such as transparent UI, custom rendering.
Author
Discussion
5 archived replies
Posts are displayed in their archived order.
01Commenter-1
>> 1. Is the only way to execute OpenGl commands (glColor3f) by setting
>> a call back function when setting the window to V3d_View?
>> V3d_View::SetWindow(hWnd,&function);
There are two ways to perform low-level rendering within current TKV3d:
- (Already mentioned) callback function at window level (the callback called several times for different stages).
- UserDraw functionality (see VUserDrawObj in src/ViewerTest/ViewerTest_OpenGlCommands.cxx as example), which allows custom rendering of custom interactive objects.
The design might become much more clear in next release - it will be possible to create own objects without redundant callback functions.
>> 2. If you want to control the drawing (to the window),
>> is the best way to create a frame buffer object and render that yourself?
The FBO is a good way to customize rendering (post-processing) at the final stage before displaying content on the screen.
It is unclean to me how actually FBO is expected to be used in your case.
02Author
Thank you for you reply Kvg.
In my case it can be used with Qt to add support for transparent UI
(Re-implementing drawBackground function, and render the FBO in there).
03Commenter-2
Author,
I'm curious if you've managed to get this up and running in Qt.
Is it possible to glance over your code perhaps?
thanks,
-jelle
04Commenter-3
Hi Author,
If you have a solution to drawing the view in a framebuffer and then painting that to a Qt Widget in contrast to the current direct draw method, please share.
I have been trying to draw a QTreeWidget above a View and when I set the QTreeWidget as translucent It Flickers and produces Artefacts as well as a weird redrawing of the rubberband rectangle, doesn't seem to like it. Your solution of drawing it to a Framebuffer would solve this and open up many more image based manipulations that can be made in Qt, like a Blurred effect on Modal Dialogs, fancy HUD's or producing thumbnails of the current view when user stores a viewport.
Best,
Alex
05Author
Hello Jelle and Alex,
I don't have a working solution as I have been very busy the past months, but I think the following links is the solution.