Page 1 of 2

how do i debug an FFGL?

Posted: Sat Apr 27, 2019 14:46
by shimla
i'm kinda new to writing FFGL plugins and xcode / visual studio so bare with me.
when writing stuff in juce i can run the app in debug mode in my IDE which makes debugging very easy. But i don't know how to debug an FFGL that way.
In order to debug my current plugin i've created a 'console' project version where i kinda debug my classes because i can cout them. but that's a bit redundant as i constantly have to switch projects just to debug them in a console.
so yea, what's a good method of debugging your FFGL project

Re: how do i debug an FFGL?

Posted: Sun Apr 28, 2019 10:51
by Joris
In VS, you can choose Debug > Attach to Process and pick Resolume from the list.

Then all your breakpoints will hit when you use the plugin in Resolume.

Xcode has a similar function, but I don’t know what it’s called or what menu it’s in from the top of my head.

Re: how do i debug an FFGL?

Posted: Sat May 11, 2019 08:49
by Jichak
Joris wrote: Sun Apr 28, 2019 10:51 In VS, you can choose Debug > Attach to Process and pick Resolume from the list.

Then all your breakpoints will hit when you use the plugin in Resolume.

Xcode has a similar function, but I don’t know what it’s called or what menu it’s in from the top of my head.
Thanks for this answer.

Re: how do i debug an FFGL?

Posted: Tue May 14, 2019 11:49
by Menno
alternatively: in visual studio you can edit your plugin's property pages to launch arena.

right click the project > properties > Debugging
fill in the command to target the arena executable
fill in the working directory to be arena's executable directory

this way you can f5 your plugin project and it'll launch arena and attach to it automatically

You can also append the path to the composition file you want to open after the Command and then when launching your plugin project it'll make arena automatically open that composition.

Re: how do i debug an FFGL?

Posted: Sat Jul 13, 2019 13:53
by subpixel
Great tip, Menno! I thought there should be some way to do this, but didn't read whatever fine manual exists for Visual Studio.

I have addressed this problem by sourcing some code from the interwebs that launches the debugger from within the plugin.

Next question: how can we get Resolume to start without the splash screen? Trying to debug with that taking over my screen is somewhat annoying!

subpixel

Re: how do i debug an FFGL?

Posted: Tue Jul 16, 2019 10:06
by Menno
You cannot start without splash screen. The splash screen should go away when you click though. Maybe simulate a mouse click yourself?

Code: Select all

enum MouseKey
{
	MK_LEFT,
	MK_RIGHT,

	MK_NumKeys
};
enum KeyDirection
{
	KD_PRESS,
	KD_RELEASE,
};

void InputDispatch::SendKey( MouseKey key, KeyDirection direction )
{
	INPUT inputEvent;
	inputEvent.type = INPUT_MOUSE;
	inputEvent.mi.dx = 0;
	inputEvent.mi.dy = 0;
	inputEvent.mi.mouseData = 0;
	switch( key )
	{
	case MK_LEFT:
		inputEvent.mi.dwFlags = direction == KD_PRESS ? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_LEFTUP;
		break;
	case MK_RIGHT:
		inputEvent.mi.dwFlags = direction == KD_PRESS ? MOUSEEVENTF_RIGHTDOWN : MOUSEEVENTF_RIGHTUP;
		break;
	}
	inputEvent.mi.time = 0;
	inputEvent.mi.dwExtraInfo = GetMessageExtraInfo();
	SendInput( 1, &inputEvent, sizeof( INPUT ) );
}
void InputDispatch::SendKeyClick( MouseKey key )
{
	SendKey( key, KD_PRESS );
	SendKey( key, KD_RELEASE );
}

Re: how do i debug an FFGL?

Posted: Fri Aug 23, 2019 14:50
by Menno
We've made a change in v7.0.2 to enable plugin developers to prevent arena from showing of the splash screen. If you provide --nosplash as command line argument resolume will not show it o7

Re: how do i debug an FFGL?

Posted: Fri Aug 23, 2019 23:46
by AngeloDV
Great, thanks!

Re: how do i debug an FFGL?

Posted: Sun Sep 01, 2019 11:08
by subpixel
Where do the printf()'s go to? I think Ronan suggested to the Output window (in Visual Studio), however it doesn't seem to show any plugin printf()s, eg for shader compilation errors.

Re: how do i debug an FFGL?

Posted: Sun Sep 01, 2019 15:33
by joe5280
I've just run into the same issue today.Got it running inside the debugger but I can't see the output of cout or printf.