Need some help on OSX setup FFGL

FFGL, OSC, GLSL. If you like abbreviations, this is the forum for you
Post Reply
hive8
Posts: 331
Joined: Sat Jan 22, 2011 22:42
Location: Los Angeles

Need some help on OSX setup FFGL

Post by hive8 »

SO i got a OSX machine here now, to start compiling the plugins for OSX, i have installed the latest OSX Maverick and Xcode.

I downloaded the FFGL 1.5 SDK from the website and extracted it into the documents folder. What do i do now?
Please can someone guide me a little so i can get this up and running. I am a compete newbie on Xcode.

If there is a document that i can read that would be very helpful as well.

Right now i have something like "My Mac 64bit" is not valid for running the scheme FFGL Mirror. Something the can't be build for the SDK. All the help is appreciated.

Something about missing base SDK in the project file explorer
HIVE 8 | Quantum Laser | http://www.hive8.com

hive8
Posts: 331
Joined: Sat Jan 22, 2011 22:42
Location: Los Angeles

Re: Need some help on OSX setup FFGL

Post by hive8 »

Got the FFGL SDK to compile :), you need to change the target for all 5 examples. And create them for 32bit.

Now i have a other question how do i make a project from cpp and h files that i have coded in windows. Any help would be appreciated.
HIVE 8 | Quantum Laser | http://www.hive8.com

Joris
Posts: 5186
Joined: Fri May 22, 2009 11:38

Re: Need some help on OSX setup FFGL

Post by Joris »

Glad you figured out the correct build settings.

Unless you're using some platform specific code, FFGL/OpenGL is cross platform, so you can use the same .cpp and .h files on both platforms.

It's probably easiest to duplicate one of the build targets. Select it in the Targets list and right-click > duplicate. Then you need rename the copy in three places: Target list, Scheme list ( the dropdown in the top left ) and the plist file ( you can find the plist file quickly by going into Build Settings and doing a search for 'plist' ). It's really only necessary to rename the Target, but renaming the other two will help keep you sane when debugging at five in the morning.

Choose File > Add Files to 'FFGL Plugins' and choose your .cpp file. Uncheck Copy files and Uncheck any targets that may be selected.

Select your target again, and in Build Phases > Compile Sources, delete the .cpp file that has the old code, and replace it with your own.

Now you should be ready to compile.

hive8
Posts: 331
Joined: Sat Jan 22, 2011 22:42
Location: Los Angeles

Re: Need some help on OSX setup FFGL

Post by hive8 »

I was able to follow almost every step.

I duplicated and renamed the target. DONE
I renamed the build setting as you suggested, did a search on plist and renamed them to the same name as the target. DONE
The i went to the top left corner under the active shame and selected the copy i made before, i don't see a option to rename it, how would that be done? NOT DONE :(

BTW could i send you a email and you try to compile it quick, if that would be possible, also how would i get in contact with you, could you send a private message with your email address, if possible?
HIVE 8 | Quantum Laser | http://www.hive8.com

Joris
Posts: 5186
Joined: Fri May 22, 2009 11:38

Re: Need some help on OSX setup FFGL

Post by Joris »

Go into the Scheme drop down and choose Manage Schemes. Select the duplicate from the list, and once it's selected, click it again to rename it.

You can reach me at mail@resolume.com for all your FFGL questions.

hive8
Posts: 331
Joined: Sat Jan 22, 2011 22:42
Location: Los Angeles

Re: Need some help on OSX setup FFGL

Post by hive8 »

Almost there, I linked all the libs and they seems to be OK, GLUT and OpenGL that is. Now i get this error on the code which i don't get on windows.

Use of undeclared identifier 'sprintf_s' not sure whats going on

Here is the code:

Code: Select all

char* H8_FFGLHorizontalClone::GetParameterDisplay(DWORD dwIndex)
{
	char s_DisplayValue[15];
	DWORD dwType = m_pPlugin->GetParamType(dwIndex);
	DWORD dwValue = m_pPlugin->GetParameter(dwIndex);

	if ((dwValue != FF_FAIL) && (dwType != FF_FAIL))
	{
		if (dwType == FF_TYPE_TEXT)
		{
			return (char *)dwValue;
		}
		else
		{			
			GLint iValue;
			GLfloat fValue;
			memcpy(&fValue, &dwValue, 4);
			memset(s_DisplayValue, 0, 15);
			fValue = fValue * 10;			
			iValue = fValue;
								
			if(dwIndex == FFPARAM_NUMCLONES)			
			{		    	
			    sprintf_s(s_DisplayValue, "%d", iValue);
			}
			else if(dwIndex == FFPARAM_OFFSET)
			{
			    fValue = fValue/10;
			    fValue = (4 * fValue) -2;
			    sprintf_s(s_DisplayValue, "%1.2f", fValue);
			}			    
			else if(dwIndex == FFPARAM_XDISTANCE || dwIndex == FFPARAM_YDISTANCE)
			{
			    iValue = iValue - 5;
			    sprintf_s(s_DisplayValue, "%d", iValue);
			}			
			else if((dwIndex == FFPARAM_CLONESCALE) || (dwIndex == FFPARAM_FULLSCALE) || (dwIndex == FFPARAM_DISTRIBUTION))
			{			    
			    iValue = iValue*10;
				sprintf_s(s_DisplayValue, "%d%s", iValue, "%");
		    }
			
			return s_DisplayValue;
		}
	}
	return NULL;		
}
Any help would be great, i think thats the last of the compile errors I have.
I am using the Apple LLVM 5.1 compiler, and have no option to select anything else.
HIVE 8 | Quantum Laser | http://www.hive8.com

Joris
Posts: 5186
Joined: Fri May 22, 2009 11:38

Re: Need some help on OSX setup FFGL

Post by Joris »

sprintf_c is only supported on Windows. Just use sprintf instead. If you make sure your returned char[] never exceeds 15 chars, you should be all good.

http://stackoverflow.com/questions/2169 ... y-function

Nice to see you're paying attention to the proper formatting of the param value!

hive8
Posts: 331
Joined: Sat Jan 22, 2011 22:42
Location: Los Angeles

Re: Need some help on OSX setup FFGL

Post by hive8 »

thank you. I also found out some other info between windows and OSX. false is not equal to FALSE, they are case sensitive, kinda strange that it works on windows but doesn't on OSX, you would think the cpp should be the same no matter where.
HIVE 8 | Quantum Laser | http://www.hive8.com

Joris
Posts: 5186
Joined: Fri May 22, 2009 11:38

Re: Need some help on OSX setup FFGL

Post by Joris »

FALSE is not actually part of c++ . It's a macro defined in windows.h: http://stackoverflow.com/questions/5663 ... -and-false

hive8
Posts: 331
Joined: Sat Jan 22, 2011 22:42
Location: Los Angeles

Re: Need some help on OSX setup FFGL

Post by hive8 »

Got it :), You learn more as you go. Next is using the box2D for collision detection, and trigger an event when it happens.
HIVE 8 | Quantum Laser | http://www.hive8.com

Post Reply