Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: glBufferData and C++ vectors

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2017
    Posts
    10

    glBufferData and C++ vectors

    I didn't find this in internet, but was wondering what is the necessary and sufficient condition for a data format to pass into glBufferData? Obviously, I can't use any class and any random datatype representing points or vectors, however I've seen how different structures and arrays were passed to it and it worked.

    I'm currently trying to write some basic vector and matrix classes in C++ to use it within OpenGL program, and since there are a lot of options, how one can do this, I was interested, what are, kind of, "the best practices", how to do it better?

    Thanks to everyone!
    Last edited by richman.feynard; 07-26-2017 at 02:36 PM.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,404
    Quote Originally Posted by richman.feynard View Post
    what is the necessary and sufficient condition for a data format to pass into glBufferData?
    There are no restrictions on what you can store in a buffer object. But there's not much point in storing data in a buffer object unless it's going to be read by the GPU, which means that it has to be in the format the GPU will be expecting.

    For uniform buffers and shader storage buffers, see the GLSL specification. For other buffer types, see the main OpenGL specification.

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2017
    Posts
    10
    Thank you, that's exactly what I looked for.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •