Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualtanzanite7

Posted 02 April 2012 - 07:32 PM

There are two "ways" to get stuff out:
1) out type instName; // one var - where type is any type (float, vector, matrix ... and even structs)
2) out blockName { ... } instName; // multiple vars (aka. interface block)

Separating the declaration of the struct type and its instantiations should not matter with non-broken compilers.

edit: I doubt there is any real difference between using a struct in in/out or an interface block as far as interface is concerned (if you leave "out" out of the struct declaration then you can use it for non-interface business too - that is not an option for interface blocks obviously).

PS. your use of separate floats for red, green, blue is a bit alarming: one should prefer vectors to avoid extra work for rasterizer.

#1tanzanite7

Posted 02 April 2012 - 07:25 PM

There are two "ways" to get stuff out:
1) out type instName; // one var - where type is any type (float, vector, matrix ... and even structs)
2) out blockName { ... } instName; // multiple vars (aka. interface block)

Separating the declaration of the struct type and its instantiations should not matter with non-broken compilers.

PS. your use of separate floats for red, green, blue is a bit alarming: one should prefer vectors to avoid extra work for rasterizer.

PARTNERS