how do i debug an FFGL?

FFGL, OSC, GLSL. If you like abbreviations, this is the forum for you
Menno
Team Resolume
Posts: 137
Joined: Tue Mar 12, 2013 13:56

Re: how do i debug an FFGL?

Post by Menno »

Visual Studio does not intercept std::cout or printf, these get sent directly to the console. To print in Visual Studio's Output window you need to use OutputDebugString. If you want consistent behaviour between Visual Studio and xcode you should use the Log function located in FFGLUtilities.h
It works a bit different than printf, there's no more format flags, you can just do this:
Log( "This is a number: ", 3.14f, " we all love pie dont we?" );

User avatar
subpixel
Hasn't felt like this about software in a long time
Posts: 152
Joined: Thu Jun 05, 2014 09:32
Location: Sydney, AU

Re: how do i debug an FFGL?

Post by subpixel »

Daft question: how/where can one view the console output?

Menno
Team Resolume
Posts: 137
Joined: Tue Mar 12, 2013 13:56

Re: how do i debug an FFGL?

Post by Menno »

Resolume targets the windows subsystem and not the console subsystem so it's not created automatically for us by windows. You'll have to dive into the console api: https://docs.microsoft.com/en-us/window ... -reference. Something involving the AllocConsole i think, i'm sure google can help you figure out how to show the console :)

leadedge
Hasn't felt like this about software in a long time
Posts: 104
Joined: Fri Feb 14, 2014 13:58

Re: how do i debug an FFGL?

Post by leadedge »

Code: Select all

FILE* pCout;
AllocConsole();
freopen_s(&pCout, "CONOUT$", "w", stdout);
Then if you close the console you shut down the entire application. To prevent that happening accidentally you can add :

Code: Select all

EnableMenuItem(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);

User avatar
subpixel
Hasn't felt like this about software in a long time
Posts: 152
Joined: Thu Jun 05, 2014 09:32
Location: Sydney, AU

Re: how do i debug an FFGL?

Post by subpixel »

Thanks for the info, both of you!

Post Reply