18th November 2015, 08:41 AM | #1 |
Junior Member
Member
Join Date: Aug 2013
Location: London UK
Posts: 22
|
Render callbacks
I have created a render callback for each object in my scene (using plugin in C/C++). The callback is called 8 times for each AC3D object (if 4 views are displayed) or twice per object if 1 view is on display. The callback argument 'is_primary_render' eliminates half of these callbacks.
I only want to get the callback once per redraw, so I would like either: to identify the window which is causing the callback OR have a type of callback which occurs before all views are updated. I think there would be many uses for the first option - perhaps 'is_primary_render' could be an integer to identify the ACView being redrawn (or 0 for updates that are not window related). |
24th November 2015, 05:44 AM | #2 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,565
|
Re: Render callbacks
The existing callback can't be changed (I know the X-Plane plugin uses that).
It sounds like you probably want a callback that is called in a redraw_all(). What is it you are trying to accomplish? (i.e. if you are sending additional OpenGL commands, that could be complicated) |
25th November 2015, 08:12 AM | #3 |
Junior Member
Member
Join Date: Aug 2013
Location: London UK
Posts: 22
|
Re: Render callbacks
I have extra user-data on each object, and this needs to be interpreted once per redraw of the scene (all 4 windows will show same appearance).
If the update reported its window then I could detect the first redrawn window. However if only one view is on screen I only get 2 callback events and the window which updates the user-data might not be used (so I wont get the update). Geoff |
26th November 2015, 06:12 AM | #4 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,565
|
Re: Render callbacks
You could try reading the opengl context to identify the current window/view. Under Windows, you should be able to use wglGetCurrentContext.
|
Tags |
ac_plugin, callback, plugin |
|
|