Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

PureGDK / Working render cycle callback?

Author
Message
Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 13th Aug 2011 23:23
Mistrel, I'm wondering if you could perhaps add a way to have a callback function inside the render loop of PureGDK(between the d3dDevice->BeginScene() and d3dDevice->EndScene() )?

I've tried using the Matrix1Utils functions for this, but they don't seem to work at all. The reason I'm asking is because I would like to utilize CEGUI(link) and it requires that it be drawn last in a DirectX9 rendering sequence.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 14th Aug 2011 00:08
Have you not tried the normal Winapi callback messages?

I've an idea of what you're after and maybe using a flag might help. It's something I'm looking at but it's gibberish to me at the moment with DX.

Warning! May contain Nuts!
Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 14th Aug 2011 00:40 Edited at: 14th Aug 2011 01:11
The problem is more that PureGDK's render loop is closed off within the DBPro engine's 'sync' function. I can't find a WinAPI/DirectX function that would set a callback to be called right before DirectX stops rendering to the backbuffer.

If I can find a way to get Matrix1Utils to work(just found the video that explains how to use plugins), the M1U_PostCameraCallBack() would be ideal.

EDIT: Just checked, the correct DLL is being loaded(Matrix1Util_26.dll) and other commands do work properly.

EDIT2: Solved, with no undue amount of head smacking on my part. It seems that calling CEGUI's renderGUI() function after the dbSync() works just as well as injecting it directly into the render cycle. While a render callback would be nice, I no longer really need it.

Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 14th Aug 2011 01:54 Edited at: 14th Aug 2011 01:55
I was poking around a bit and it would seem that IanM is calling a check "IsValidFunctionPtr" in all of the callbacks to verify if it's a valid DBP function pointer. And since we would be using a callback which is not, this is causing it to fail.

I'll ask if he would be willing to change this behavior.

Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 14th Aug 2011 02:57
Dar13, see here for how to get the callbacks working with PureGDK:

http://forum.thegamecreators.com/?m=forum_view&t=85209&b=18&msg=2243237#m2243237

None of the functions for Util 20 are wrapped but it is a dependency for Util 26 so it should exist in memory. Just use GetModuleHandle/GetProcAddress and call this function to register your pointer and you should be good to go.

Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 14th Aug 2011 11:15
Quote: "It seems that calling CEGUI's renderGUI() function after the dbSync() works "


On my machine, CEGUI works if I call renderGUI() before or after dbSync, it seems the order doesn't matter much. At present I have only a very simple test window but I hope there won't be any problem with more complicated GUIs either.
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 14th Aug 2011 17:05
I'm bookmarking this link because I'll be looking at this pretty soon.

Warning! May contain Nuts!

Login to post a reply

Server time is: 2024-03-28 22:00:21
Your offset time is: 2024-03-28 22:00:21