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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:18:04+00:00 2026-06-04T04:18:04+00:00

Why are there mismatching types in OpenGL? For example, if I have a vertex

  • 0

Why are there mismatching types in OpenGL?

For example, if I have a vertex buffer object,

GLuint handle = 0;
glGenBuffers(1, &handle_); // this function takes (GLsizei, GLuint*)

Now if I want to know the currently bound buffer

glGetIntegerv( GL_ARRAY_BUFFER_BINDING, reinterpret_cast<GLint *>(&handle ) ); // ouch, type mismatch

Why not have a glGetUnsignedIntegerv or

have glGenBuffers take an GLint * instead.

  • 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-06-04T04:18:06+00:00Added an answer on June 4, 2026 at 4:18 am

    That is because glGetIntegerv function is intended to get any integral type of information back from OpenGL. It includes also GLint type values (negative ones). And also it includes multiple component values like GL_VIEWPORT:

    GLint viewport[4];
    glGetIntegerv(GL_VIEWPORT, viewport);
    

    From one point of view – it is simpler to have just one function for getting values back, instead of hundreds for each specific parameter.
    Form other point of view – of course it’s a bit ugly to cast types.

    But no idea why they didn’t use GLint for buffer id.

    Anyway – you shouldn’t bee calling any glGet… functions. They are slow and often requires waiting on GPU complete previous commands – meaning CPU will wait idle in that time.

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

Sidebar

Related Questions

There have been multiple questions regarding this topic but I have never really settled
There is this strange situation I'm fighting on. I have 3 pages, les call
A VERY nice to have would be if I could edit object-literals in this
There are many questions about this PersistenceException, but I have not seen some, where
There are some stdlib functions that throw errors on invalid input. For example: Prelude>
There are posts that touch on this question, but no one that I can
There will be 500+ threads concurrently uploading an unique object to a bucket all
There is a component that I have been using since IE7 and had never
In a SQL database I have a table, Table1 . This table is related
There was a thread on this in comp.lang.javascript recently where victory was announced but

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.