how do i debug an FFGL?

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

Re: how do i debug an FFGL?

Post by Menno » Mon Sep 02, 2019 15:32

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: 142
Joined: Thu Jun 05, 2014 09:32
Location: Melbourne, AU

Re: how do i debug an FFGL?

Post by subpixel » Tue Sep 03, 2019 08:17

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

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

Re: how do i debug an FFGL?

Post by Menno » Tue Sep 03, 2019 09:27

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: 102
Joined: Fri Feb 14, 2014 13:58

Re: how do i debug an FFGL?

Post by leadedge » Wed Sep 04, 2019 01:53

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: 142
Joined: Thu Jun 05, 2014 09:32
Location: Melbourne, AU

Re: how do i debug an FFGL?

Post by subpixel » Thu Oct 10, 2019 01:40

Thanks for the info, both of you!

Post Reply