OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 namespace { | 50 namespace { |
51 | 51 |
52 GLenum BufferAccessModeToGLenum(Buffer::AccessMode access_mode) { | 52 GLenum BufferAccessModeToGLenum(Buffer::AccessMode access_mode) { |
53 switch (access_mode) { | 53 switch (access_mode) { |
54 case Buffer::READ_ONLY: | 54 case Buffer::READ_ONLY: |
55 return GL_READ_ONLY_ARB; | 55 return GL_READ_ONLY_ARB; |
56 case Buffer::WRITE_ONLY: | 56 case Buffer::WRITE_ONLY: |
57 return GL_WRITE_ONLY_ARB; | 57 return GL_WRITE_ONLY_ARB; |
58 case Buffer::READ_WRITE: | 58 case Buffer::READ_WRITE: |
59 return GL_READ_WRITE_ARB; | 59 return GL_READ_WRITE_ARB; |
| 60 case Buffer::NONE: |
| 61 break; |
60 } | 62 } |
61 DCHECK(false); | 63 DCHECK(false); |
62 return GL_READ_WRITE_ARB; | 64 return GL_READ_WRITE_ARB; |
63 } | 65 } |
64 | 66 |
65 } // anonymous namespace | 67 } // anonymous namespace |
66 | 68 |
67 // Vertex Buffers -------------------------------------------------------------- | 69 // Vertex Buffers -------------------------------------------------------------- |
68 | 70 |
69 // Initializes the O3D VertexBuffer object but does not allocate an | 71 // Initializes the O3D VertexBuffer object but does not allocate an |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 } else { | 245 } else { |
244 O3D_ERROR( | 246 O3D_ERROR( |
245 service_locator()) << "Unable to unlock a GL Element Array Buffer"; | 247 service_locator()) << "Unable to unlock a GL Element Array Buffer"; |
246 } | 248 } |
247 return false; | 249 return false; |
248 } | 250 } |
249 CHECK_GL_ERROR(); | 251 CHECK_GL_ERROR(); |
250 return true; | 252 return true; |
251 } | 253 } |
252 } // namespace o3d | 254 } // namespace o3d |
OLD | NEW |