04-16-2013 06:27 PM
Hi,
I'm trying to get a working OGL panel inside a tab, but I keep getting errors. According to http://forums.ni.com/t5/LabWindows-CVI/CVI-OpenGL-control-on-child-panel/m-p/98192/highlight/true#M7... it's just how it works, but there are ways around it.I've downloaded example http://sine.ni.com/devzone/cda/epd/p/id/1061 , but its not exactly what I need - it creates a child panel window inside main window.
So, my question is - is there a way to put a OGL panel inside a tab window?
Regards, Benji.
04-20-2013 05:34 AM
Somebody? Anybody?
04-25-2013 02:40 AM
Dear BenjiF!
Sorry for the late reply, I tried to insert the OGL control on a tabpanel in CVI built in OGL example: Ogldemo.
I got the following error:
NON-FATAL RUN-TIME ERROR: "ogldemo.c", line 259, col 5, thread id 0x00002478: Function OGLConvertCtrl: (return value == -1003 [0xfffffc15]). Only a canvas or picture can be converted into an OGL control
If you have a look on the help of OGLConvertCtrl >> Panelhandleparameter, you will see the following:
The panel has to be a parent panel and should not be the child of any other panel. The panel cannot be scrollable or resizable. |
Maybe this restriction is the reason, why is it not working.
3D Graph custom control could be an alternative, if it is suitable for your application. An example for this: https://decibel.ni.com/content/docs/DOC-6452
In the linked topic I found a useable workaround:
"The fact that the OGL control is only available on parent panels is not necessarily a problem with CVI. Instead, it is simply a limitation of the OGL control. Likewise, a limitation of the easy tab control is that it takes in child panels. I would suggest copying the final image to the tab panel (as mentioned by PaoloB), or possible use a separate panel to display your 3D images."
Some material related to OpenGL.
Please go through this KB: http://digital.ni.com/public.nsf/allkb/D369558F34AA3264862565FC007CBB33?OpenDocument
You can find built in examples in the folder:
C:\Users\Public\Documents\National Instruments\CVI"version"\samples\userint\custctrl\cviogl
Best Regards,