VirtualBox

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

最後變更 在這個檔案從52095是 44388,由 vboxsync 提交於 12 年 前

crOpenGL: buffer object impl fix

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 2.2 KB
 
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}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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