Go Back   AC3D Forums > Resources > AC3D Plugins and Other Resources
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 18th November 2015, 08:41 AM   #1
Geoffm
Junior Member
Member
 
Geoffm's Avatar
 
Join Date: Aug 2013
Location: London UK
Posts: 22
Default 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).
Geoffm is offline   Reply With Quote
Old 24th November 2015, 05:44 AM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default 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)
Andy is offline   Reply With Quote
Old 25th November 2015, 08:12 AM   #3
Geoffm
Junior Member
Member
 
Geoffm's Avatar
 
Join Date: Aug 2013
Location: London UK
Posts: 22
Default 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
Geoffm is offline   Reply With Quote
Old 26th November 2015, 06:12 AM   #4
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default 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.
Andy is offline   Reply With Quote
Reply

Tags
ac_plugin, callback, plugin

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 05:23 AM.


AC3D Forum
(C) Inivis Limited 2020