1 | /* Copyright (c) 2001, Stanford University
|
---|
2 | * All rights reserved
|
---|
3 | *
|
---|
4 | * See the file LICENSE.txt for information on redistributing this software.
|
---|
5 | */
|
---|
6 |
|
---|
7 | #include "chromium.h"
|
---|
8 | #include "cr_error.h"
|
---|
9 | #include "cr_mem.h"
|
---|
10 | #include "server_dispatch.h"
|
---|
11 | #include "server.h"
|
---|
12 |
|
---|
13 | void * SERVER_DISPATCH_APIENTRY
|
---|
14 | crServerDispatchMapBufferARB( GLenum target, GLenum access )
|
---|
15 | {
|
---|
16 | return NULL;
|
---|
17 | }
|
---|
18 |
|
---|
19 | GLboolean SERVER_DISPATCH_APIENTRY
|
---|
20 | crServerDispatchUnmapBufferARB( GLenum target )
|
---|
21 | {
|
---|
22 | return GL_FALSE;
|
---|
23 | }
|
---|
24 |
|
---|
25 | void SERVER_DISPATCH_APIENTRY
|
---|
26 | crServerDispatchGenBuffersARB(GLsizei n, GLuint *buffers)
|
---|
27 | {
|
---|
28 | GLuint *local_buffers = (GLuint *) crAlloc( n * sizeof(*local_buffers) );
|
---|
29 | (void) buffers;
|
---|
30 |
|
---|
31 | crStateGenBuffersARB(n, local_buffers);
|
---|
32 |
|
---|
33 | crServerReturnValue( local_buffers, n * sizeof(*local_buffers) );
|
---|
34 | crFree( local_buffers );
|
---|
35 | }
|
---|
36 |
|
---|
37 | void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteBuffersARB( GLsizei n, const GLuint * buffer )
|
---|
38 | {
|
---|
39 | crStateDeleteBuffersARB( n, buffer );
|
---|
40 | }
|
---|
41 |
|
---|
42 | void SERVER_DISPATCH_APIENTRY
|
---|
43 | crServerDispatchGetBufferPointervARB(GLenum target, GLenum pname, GLvoid **params)
|
---|
44 | {
|
---|
45 | crError( "glGetBufferPointervARB isn't *ever* allowed to be on the wire!" );
|
---|
46 | (void) target;
|
---|
47 | (void) pname;
|
---|
48 | (void) params;
|
---|
49 | }
|
---|
50 |
|
---|
51 | void SERVER_DISPATCH_APIENTRY
|
---|
52 | crServerDispatchGetBufferSubDataARB(GLenum target, GLintptrARB offset,
|
---|
53 | GLsizeiptrARB size, void * data)
|
---|
54 | {
|
---|
55 | void *b;
|
---|
56 |
|
---|
57 | b = crAlloc(size);
|
---|
58 | if (b) {
|
---|
59 | cr_server.head_spu->dispatch_table.GetBufferSubDataARB( target, offset, size, b );
|
---|
60 |
|
---|
61 | crServerReturnValue( b, size );
|
---|
62 | crFree( b );
|
---|
63 | }
|
---|
64 | else {
|
---|
65 | crError("Out of memory in crServerDispatchGetBufferSubDataARB");
|
---|
66 | }
|
---|
67 | }
|
---|
68 |
|
---|
69 | void SERVER_DISPATCH_APIENTRY
|
---|
70 | crServerDispatchBindBufferARB(GLenum target, GLuint buffer)
|
---|
71 | {
|
---|
72 | crStateBindBufferARB(target, buffer);
|
---|
73 | cr_server.head_spu->dispatch_table.BindBufferARB(target, crStateGetBufferHWID(buffer));
|
---|
74 | }
|
---|
75 |
|
---|
76 | GLboolean SERVER_DISPATCH_APIENTRY
|
---|
77 | crServerDispatchIsBufferARB(GLuint buffer)
|
---|
78 | {
|
---|
79 | /* since GenBuffersARB issued to host ogl only on bind + some other ops, the host drivers may not know about them
|
---|
80 | * so use state data*/
|
---|
81 | GLboolean retval = crStateIsBufferARB(buffer);
|
---|
82 | crServerReturnValue( &retval, sizeof(retval) );
|
---|
83 | return retval; /* WILL PROBABLY BE IGNORED */
|
---|
84 | }
|
---|