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 71395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:52:52+00:00 2026-05-10T19:52:52+00:00

I have an array that contains a list of vertices which I copy to

  • 0

I have an array that contains a list of vertices which I copy to the GPU using a vertex buffer object. However the vertex coordinates on their own are meaningless as I also have an integer array that contains a list of indices into the vertex array.

In this scenario is it possible to create another buffer object to store the indices and then in the render function bind both the vertex array and indices array for drawing:

//vertex coordinates glBindBuffer(GL_ARRAY_BUFFER, bufferId1);          //index coordinates glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferId2);   glVertexPointer(3, GL_FLOAT, 0, 0); //Not sure if this should be Unsigned BYTE or Unsigned SHORT glDrawElements(GL_POINTS, 6, GL_UNSIGNED_BYTE, 0);   

I have read the api and the following confused me:
‘While a non-zero buffer object is bound to the GL_ELEMENT_ARRAY_BUFFER target, the indices parameter of glDrawElements that is traditionally interpreted as a pointer to client-side memory is instead interpreted as an offset within the buffer object measured in basic machine units.’

I am pretty new to graphics programming so apologize if any of this does not make sense.

  • 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. 2026-05-10T19:52:52+00:00Added an answer on May 10, 2026 at 7:52 pm

    Yes, this is possible. The official tutorial should help you along. They recommend against using unsigned byte, stick with 16 or 32 bit indexes for speed.

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

Sidebar

Related Questions

I have an array that contains @sign in the object. I can't access that
I have a Array list which contains Objects of Restaurants ArrayList<Restaurants> array_sort = new
I have a byte array that contains list of unicode strings. Each string is
I have a text file that contains a list of regexp's which I regularly
I have an object that contains a list of other objects. Say it's as
I have an array-list that contains some UserID. I need a query like this:
I have a datamodel that contains a Project, which contains a list of Suggestions,
I have an array list that contains Quote objects. I want to be able
I have an array called dbRecipes which contains a list of recipes divided into
I have been trying to serialize a list that contains arrays and lists. I

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.