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

  • Home
  • SEARCH
  • 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 7175095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:12:33+00:00 2026-05-28T16:12:33+00:00

i am used to code in ASM and had the need to switch to

  • 0

i am used to code in ASM and had the need to switch to C++ for some OpenGL project. Anyway i got the following procedure:

glGenBuffers(Size, PointerToBuff);

According to what i understand the handles according to the Size argument (Number of buffers) will be stored on PointerToBuff. So i wanted to use an structure to save the 2 handles i will get in case i use:

glGenBuffers(2, *PointerToBuff);

So i create an struct:

struct VertexHandlers
{
    GLuint cubevertex;
    GLuint trianglevertex;
}VBHandlers;

And use the proc as this:

glGenBuffers(2, &VBHandlers);

The error i get its:

error C2664: 'void (GLsizei,GLuint *)' : cannot convert parameter 2 from 'main::VertexHandlers *' to 'GLuint *'
2>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>C:\Documents and Settings\Owner\My Documents\Downloads\OpenGL-tutorial_v0003\playground\playground.cpp(181): error C2664: 'void (GLsizei,GLuint *)' : cannot convert parameter 1 from 'main::VertexHandlers *' to 'GLsizei'
2>          There is no context in which this conversion is possible

I am not used to “Typecast” barely know something, but when regarding pointers i tought (&) operator will take addr of the local variable created. Hope i get some help, thanks.

  • 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-28T16:12:34+00:00Added an answer on May 28, 2026 at 4:12 pm

    glGenBuffers() expects an array of GLuints, not a pointer to an object that happens to have two GLuints in a row. That’s why the compiler complains about it. Yes, they both may have the same memory representation on your machine, but it may not be the case on another.

    If you want to store the results of glGenBuffers() into a structure, you can do something like this:

    GLuint buffers[2];
    glGenBuffers(2, buffers);
    VBHandlers.cubevertex = buffers[0];
    VBHandlers.trianglevertex = buffers[1];
    

    This is the safest, portable way to do it, assuming glGenBuffers doesn’t fail.

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

Sidebar

Related Questions

I used to compile my asm code with TASM (on winXP) but I had
I used following code, but it displays only 2 digit of ISO country name.
So I've used code examples from all over the net and got my app
I'm trying to inject some ASM code into a Win32 program with C++. Is
I think most coders have used code like the following : ArrayList<String> myStringList =
I've seen (and used) code to have a link spawn a javascript action many
I have used code like this: http://msdn.microsoft.com/en-us/library/dw70f090.aspx to access database before when working in
Info - for better formatting, I used code-formatting throughout the whole posting. Hi, I
This code used to return my local ip address as 192.xxx.x.xxx but now it
This code used to work but doesnt any more. i used a breakpoint, and

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.