FFGL - How to get Texture info during creation of parameters

FFGL, OSC, GLSL. If you like abbreviations, this is the forum for you
Post Reply
User avatar
AngeloDV
Is taking Resolume on a second date
Posts: 30
Joined: Sat Oct 22, 2016 08:19
Location: The Netherlands

FFGL - How to get Texture info during creation of parameters

Post by AngeloDV » Thu Jul 11, 2019 03:38

Hi,

Simple question, I am still trying to figure this one out. Is there a way to get the actual texture size in pixels during the creation of the parameters?

An example of this is the Crop effect that retrieves the canvas size during creation.

Also is there a way to display the +/- ui display like the crop, instead of the standard range slider?

Thanks!
Image

User avatar
flyingrub
Met Resolume in a bar the other day
Posts: 6
Joined: Thu Feb 21, 2019 10:24
Location: Intern at Resolume (not bringing coffee)

Re: FFGL - How to get Texture info during creation of parameters

Post by flyingrub » Thu Jul 11, 2019 09:33

InitGL function : https://github.com/resolume/ffgl/blob/m ... nSDK.h#L59

Every plugin should have a variable named currentViewport that contains texture info after InitGL is called by the host. Even if you create your parameter in the constructor and you still don't have this data, you can set your parameter to it after.

If you use the latest FFGL available (2.0) you can create integer parameter thanks to https://github.com/resolume/ffgl/blob/m ... rams.h#L88

Here is an example on how to use it : https://github.com/flyingrub/ffgl/blob/ ... on.cpp#L53.

User avatar
AngeloDV
Is taking Resolume on a second date
Posts: 30
Joined: Sat Oct 22, 2016 08:19
Location: The Netherlands

Re: FFGL - How to get Texture info during creation of parameters

Post by AngeloDV » Thu Jul 11, 2019 13:49

Thanks for the quick reply flyingrub!

I am writing for FFGL2 and changed the param creation into :

Code: Select all

addParam( paramWidth= ParamRange::create( "Width", 0.0f, { 0.0f, (float)currentViewport.width } ) );
But the ints are not set yet at that moment of creation, am I missing something?

Also thanks for the integer type, overlooked that one! ..but, it is not giving me the proper range when I do this:

Code: Select all

addParam( xMove = ParamRange::createInteger("X Move", 0, {0.0f, 300.0f}));
I tried using int values in the range but it always limits me to 0->1. Am I doing something wrong?

Thanks for looking into it!
Image

User avatar
AngeloDV
Is taking Resolume on a second date
Posts: 30
Joined: Sat Oct 22, 2016 08:19
Location: The Netherlands

Re: FFGL - How to get Texture info during creation of parameters

Post by AngeloDV » Thu Jul 11, 2019 17:00

flyingrub wrote:
Thu Jul 11, 2019 09:33
Even if you create your parameter in the constructor and you still don't have this data, you can set your parameter to it after.
How?

P.s. the integer type is working now, had a typo
Image

User avatar
flyingrub
Met Resolume in a bar the other day
Posts: 6
Joined: Thu Feb 21, 2019 10:24
Location: Intern at Resolume (not bringing coffee)

Re: FFGL - How to get Texture info during creation of parameters

Post by flyingrub » Mon Jul 15, 2019 11:43

I thought you wanted to change the value of the parameter, not the range. :?

So, yeah, it is not really possible at the moment, as Arena add the parameter before calling initGL, and we don'thave a way to push parameter range change to the host right now.

Post Reply