Jump to content

  • Log In with Google      Sign In   
  • Create Account


glVertexPointer and glColor4fv


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 amtri   Members   -  Reputation: 175

Like
0Likes
Like

Posted 25 April 2012 - 11:36 AM

Hello,

I am using glVertexPointer to set my point coordinates. The only primitives I have are triangles. I could use glColorPointer, but all triangles - possibly millions - are the same color. So rather than using glColorPointer I would like to use glColor(3,4).

If I use glColor3f, this works just fine on my machine. However, if I use glColor4f and the transparency value is set, the resulting triangles are NOT transparent.

I'm wondering...:

1) Is it legal to enable VertexPointer but NOT ColorPointer? In other words, am I just lucky that the call to glColor3f on my machine worked when the true behavior when pointers are being used is undefined?

2) If this is legal - as I hope it is - is there anything special that needs to be done to make glColor4f work to get transparency? Or is this the result of a probable bug in my code?

The code is rather large and I cannot post it here. So I thought I'd just ask about the rules to make sure I'm using them correctly.

Thanks.

Sponsor:

#2 Brother Bob   Moderators   -  Reputation: 8018

Like
0Likes
Like

Posted 25 April 2012 - 11:56 AM

It is legal to do that. You probably haven't set up and enabled blending for transparency to work though.

#3 amtri   Members   -  Reputation: 175

Like
0Likes
Like

Posted 25 April 2012 - 12:32 PM

Brother Bob,

You are right. I have to glEnable(GL_BLEND).

Thanks!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS