VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_bufferobject.cpp@ 78263

Last change on this file since 78263 was 78263, checked in by vboxsync, 6 years ago

Config.kmk,GuestHost\OpenGL,HostServices\SharedOpenGL: Fix a bunch of compiler warnings and enable them again

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 2.9 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#include "cr_unpack.h"
13
14void * SERVER_DISPATCH_APIENTRY
15crServerDispatchMapBufferARB( GLenum target, GLenum access )
16{
17 RT_NOREF(target, access);
18 return NULL;
19}
20
21GLboolean SERVER_DISPATCH_APIENTRY
22crServerDispatchUnmapBufferARB( GLenum target )
23{
24 RT_NOREF(target);
25 return GL_FALSE;
26}
27
28void SERVER_DISPATCH_APIENTRY
29crServerDispatchGenBuffersARB(GLsizei n, GLuint *buffers)
30{
31 GLuint *local_buffers;
32 (void) buffers;
33
34 if (n <= 0 || n >= INT32_MAX / sizeof(GLuint))
35 {
36 crError("crServerDispatchGenBuffersARB: parameter 'n' is out of range");
37 return;
38 }
39
40 local_buffers = (GLuint *)crCalloc(n * sizeof(*local_buffers));
41
42 if (!local_buffers)
43 {
44 crError("crServerDispatchGenBuffersARB: out of memory");
45 return;
46 }
47
48 crStateGenBuffersARB(n, local_buffers);
49
50 crServerReturnValue( local_buffers, n * sizeof(*local_buffers) );
51 crFree( local_buffers );
52}
53
54void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteBuffersARB( GLsizei n, const GLuint * buffer )
55{
56 if (n <= 0 || n >= INT32_MAX / sizeof(GLuint))
57 {
58 crError("glDeleteBuffersARB: parameter 'n' is out of range");
59 return;
60 }
61
62 crStateDeleteBuffersARB( n, buffer );
63}
64
65void SERVER_DISPATCH_APIENTRY
66crServerDispatchGetBufferPointervARB(GLenum target, GLenum pname, GLvoid **params)
67{
68 crError( "glGetBufferPointervARB isn't *ever* allowed to be on the wire!" );
69 (void) target;
70 (void) pname;
71 (void) params;
72}
73
74void SERVER_DISPATCH_APIENTRY
75crServerDispatchGetBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data)
76{
77 void *b;
78
79 RT_NOREF(data);
80
81 if (size <= 0 || size >= INT32_MAX / 2)
82 {
83 crError("crServerDispatchGetBufferSubDataARB: size is out of range");
84 return;
85 }
86
87 b = crCalloc(size);
88
89 if (b) {
90 cr_server.head_spu->dispatch_table.GetBufferSubDataARB( target, offset, size, b );
91
92 crServerReturnValue( b, size );
93 crFree( b );
94 }
95 else {
96 crError("Out of memory in crServerDispatchGetBufferSubDataARB");
97 }
98}
99
100void SERVER_DISPATCH_APIENTRY
101crServerDispatchBindBufferARB(GLenum target, GLuint buffer)
102{
103 crStateBindBufferARB(target, buffer);
104 cr_server.head_spu->dispatch_table.BindBufferARB(target, crStateGetBufferHWID(buffer));
105}
106
107GLboolean SERVER_DISPATCH_APIENTRY
108crServerDispatchIsBufferARB(GLuint buffer)
109{
110 /* since GenBuffersARB issued to host ogl only on bind + some other ops, the host drivers may not know about them
111 * so use state data*/
112 GLboolean retval = crStateIsBufferARB(buffer);
113 crServerReturnValue( &retval, sizeof(retval) );
114 return retval; /* WILL PROBABLY BE IGNORED */
115}
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