VirtualBox

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

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

crOpenGL: more state fixes

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 2.0 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
38crServerDispatchGetBufferPointervARB(GLenum target, GLenum pname, GLvoid **params)
39{
40 crError( "glGetBufferPointervARB isn't *ever* allowed to be on the wire!" );
41 (void) target;
42 (void) pname;
43 (void) params;
44}
45
46void SERVER_DISPATCH_APIENTRY
47crServerDispatchGetBufferSubDataARB(GLenum target, GLintptrARB offset,
48 GLsizeiptrARB size, void * data)
49{
50 void *b;
51
52 b = crAlloc(size);
53 if (b) {
54 cr_server.head_spu->dispatch_table.GetBufferSubDataARB( target, offset, size, b );
55
56 crServerReturnValue( b, size );
57 crFree( b );
58 }
59 else {
60 crError("Out of memory in crServerDispatchGetBufferSubDataARB");
61 }
62}
63
64void SERVER_DISPATCH_APIENTRY
65crServerDispatchBindBufferARB(GLenum target, GLuint buffer)
66{
67 crStateBindBufferARB(target, buffer);
68 cr_server.head_spu->dispatch_table.BindBufferARB(target, crStateGetBufferHWID(buffer));
69}
70
71GLboolean SERVER_DISPATCH_APIENTRY
72crServerDispatchIsBufferARB(GLuint buffer)
73{
74 /* since GenBuffersARB issued to host ogl only on bind + some other ops, the host drivers may not know about them
75 * so use state data*/
76 GLboolean retval = crStateIsBufferARB(buffer);
77 crServerReturnValue( &retval, sizeof(retval) );
78 return retval; /* WILL PROBABLY BE IGNORED */
79}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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