Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6240319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:32:51+00:00 2026-05-24T11:32:51+00:00

In all the examples I’ve seen, these lines are used before drawing meshes: glEnableClientState(GL10.GL_VERTEX_ARRAY);

  • 0

In all the examples I’ve seen, these lines are used before drawing meshes:
glEnableClientState(GL10.GL_VERTEX_ARRAY);
glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);

and sometimes glEnableClientState(GL10.GL_NORMAL_ARRAY);

And then these are always disabled again at the end of the draw call for each mesh.

I don’t really understand what they actually do, and why you would want to disable them. I know that I probably need to turn them on if I’m drawing triangles from an array, using textures, and using lighting. But I don’t know when I actually need to turn them off.

I presume it would be more efficient not to disable and re-enable these for each mesh in your scene if you don’t have to. Can you just leave them on all the time? In what circumstances do you need to disable them?

I haven’t been able to find any explanation of the actual meaning of these client states, so I don’t know where I can safely leave them on or off in my code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:32:52+00:00Added an answer on May 24, 2026 at 11:32 am

    Can you just leave them on all the time?

    Yes, if you want to, and if all your primitives uses all the arrays you’re enabling.

    In what circumstances do you need to disable them?

    In order to not destroy or mess up the next drawings.

    For example, consider you have a primitive that uses normals, you’ll simply enable it by a call to glEnableClientState(GL_NORMAL_ARRAY) and telling OpenGL where your normal data is through glNormalPointer(). If you don’t disable GL_NORMAL_ARRAY your next coming primitive will use the same normal array as your previous primitive. This may have consequences if your next coming primitive doesn’t use normals.

    Therefore, it’s considered as a good practice to restore the OpenGL state when a primitive’s drawing is done. That being said, you can leave them enabled if all your primitives uses all the arrays you enable, exactly like I leave GL_TEXTURE_2D enabled during the entire time the application is running. That’s because I know I’ll use textures frequently, and then there’s no reason for enable/disable it in every object’s draw call; this will only decrease the application’s performance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All the examples I have seen where the PropertyPlaceHolderConfigurer is used seem to be
In all examples of a Java client/server, I've seen BufferedReader used for receiving data,
All the examples I've seen of sock.listen(5) in the python documentation suggest I should
All the examples I've seen regarding a RESTful architecture have dealt with a single
In all examples online that I have seen, when rendering meta-balls (level sets of
I'm trying to understand the equals() method better. All examples I've seen do something
Why do constants in all examples I've seen always start with k? And should
I have found that in all examples (include rails documentation) that I have seen
All examples of svn branching I have seen so far look like this svn
All examples i've seen were doing a query first and then send to client

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.