Skip to content

size of GLsizeiptr #25

@bluenote10

Description

@bluenote10

I'm currently struggling to get any output from vertex buffer based rendering and I'm trying to find what could be the issue. A possible problem could be the call to glDrawArrays, which takes the somewhat unusual GLsizeiptr as parameter (some background on GLsizeiptr). One thing that confuses me is the size of GLsizeiptr, which is defined as int32 in the bindings. However, in the official <GL/glext.h> header, the definition is typedef ptrdiff_t GLsizeiptr;. Running the following quick check

{.emit: """
#include <stdio.h>
#include <stdlib.h>

void c_call()
{
  printf("Size of ptrdiff_t: %d\n", sizeof(ptrdiff_t));
}
proc c_call() {.importc, nodecl.}
c_call()
"""}

# Size of ptrdiff_t: 8

shows on my 64 bit system (Ubuntu 14.04) that the size of ptrdiff_t and thus GLsizeiptr should be 8.

I have modified the bindings to force int64 for GLsizeiptr, but unfortunately this has not fixed my general issue. I'm also surprised that using an int32 did not crash in the first place. Therefore I currently don't know which is correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions