VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_bufferobject.c@ 54934

Last change on this file since 54934 was 44388, checked in by vboxsync, 12 years ago

crOpenGL: buffer object impl fix

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
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
13void * SERVER_DISPATCH_APIENTRY
14crServerDispatchMapBufferARB( GLenum target, GLenum access )
15{
16 return NULL;
17}
18
19GLboolean SERVER_DISPATCH_APIENTRY
20crServerDispatchUnmapBufferARB( GLenum target )
21{
22 return GL_FALSE;
23}
24
25void SERVER_DISPATCH_APIENTRY
26crServerDispatchGenBuffersARB(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
37void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteBuffersARB( GLsizei n, const GLuint * buffer )
38{
39 crStateDeleteBuffersARB( n, buffer );
40}
41
42void SERVER_DISPATCH_APIENTRY
43crServerDispatchGetBufferPointervARB(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
51void SERVER_DISPATCH_APIENTRY
52crServerDispatchGetBufferSubDataARB(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
69void SERVER_DISPATCH_APIENTRY
70crServerDispatchBindBufferARB(GLenum target, GLuint buffer)
71{
72 crStateBindBufferARB(target, buffer);
73 cr_server.head_spu->dispatch_table.BindBufferARB(target, crStateGetBufferHWID(buffer));
74}
75
76GLboolean SERVER_DISPATCH_APIENTRY
77crServerDispatchIsBufferARB(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}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette