0

What is meant by:

GLuint bindingPoint = 1, buffer, blockIndex; 

I found this in one tutorial which I need, and I have never seen such a variable initialization before.

Does this line mean

GLuint bindingPoint = 1; GLuint bindingPoint = buffer; GLuint bindingPoint = blockIndex; 

?

1

1 Answer 1

7

The line GLuint bindingPoint = 1, buffer, blockIndex; is equivalent to the following three:

GLuint bindingPoint = 1; GLuint buffer; GLuint blockIndex; 

Both versions define the variables bindingPoint, buffer, blockIndex. With bindingPoint initialized to 1.

Sign up to request clarification or add additional context in comments.

2 Comments

The other option (which would only be legal if buffer and blockIndex had been declared already) would be GLuint bindingPoint = (1, buffer, blockIndex); which would mean "evaluate 1 and throw the result away, evaluate buffer and throw the result away, evaluate blockIndex and use it to initialize a new variable bindingPoint of type `GLuint.
To be clear: that is not an alternative reading of the original statement. The statement unambigiously means what StoryTeller has written. It is what a similar looking statement would mean.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.