-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathglGetBufferSubDataARB.c
More file actions
41 lines (29 loc) · 855 Bytes
/
glGetBufferSubDataARB.c
File metadata and controls
41 lines (29 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <string.h>
#include "pspgl_internal.h"
#include "pspgl_buffers.h"
void glGetBufferSubDataARB(GLenum target, GLintptrARB offset,
GLsizeiptrARB size, GLvoid *data)
{
struct pspgl_bufferobj *buf, **bufp;
void *p;
GLenum error;
bufp = __pspgl_bufferobj_for_target(target);
if (bufp == NULL)
return;
buf = *bufp;
error = GL_INVALID_OPERATION;
if (buf == NULL || buf->data == NULL || buf->mapped)
goto out_error;
error = GL_INVALID_VALUE;
if (size < 0 || offset+size > buf->data->size)
goto out_error;
p = __pspgl_buffer_map(buf->data, GL_READ_ONLY);
memcpy(data, p+offset, size);
__pspgl_buffer_unmap(buf->data, GL_READ_ONLY);
return;
out_error:
GLERROR(error);
}
void glGetBufferSubData(GLenum target, GLintptrARB offset,
GLsizeiptrARB size, GLvoid *data)
__attribute__((alias("glGetBufferSubDataARB")));