| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // GL version of VertexStruct. | 98 // GL version of VertexStruct. |
| 99 class VertexStructGL : public VertexStruct { | 99 class VertexStructGL : public VertexStruct { |
| 100 public: | 100 public: |
| 101 explicit VertexStructGL(unsigned int count) | 101 explicit VertexStructGL(unsigned int count) |
| 102 : VertexStruct(count), | 102 : VertexStruct(count), |
| 103 dirty_(true) {} | 103 dirty_(true) {} |
| 104 virtual ~VertexStructGL() {} | 104 virtual ~VertexStructGL() {} |
| 105 | 105 |
| 106 // Adds an input to the vertex struct. | 106 // Adds an input to the vertex struct. |
| 107 void SetInput(unsigned int input_index, | 107 void SetInput(unsigned int input_index, |
| 108 ResourceID vertex_buffer_id, | 108 ResourceId vertex_buffer_id, |
| 109 unsigned int offset, | 109 unsigned int offset, |
| 110 unsigned int stride, | 110 unsigned int stride, |
| 111 vertex_struct::Type type, | 111 vertex_struct::Type type, |
| 112 vertex_struct::Semantic semantic, | 112 vertex_struct::Semantic semantic, |
| 113 unsigned int semantic_index); | 113 unsigned int semantic_index); |
| 114 | 114 |
| 115 // Sets the input streams to GL. | 115 // Sets the input streams to GL. |
| 116 unsigned int SetStreams(GAPIGL *gapi); | 116 unsigned int SetStreams(GAPIGL *gapi); |
| 117 | 117 |
| 118 private: | 118 private: |
| 119 static const unsigned int kMaxAttribs = 16; | 119 static const unsigned int kMaxAttribs = 16; |
| 120 | 120 |
| 121 // This struct describes the parameters that are passed to | 121 // This struct describes the parameters that are passed to |
| 122 // glVertexAttribPointer. | 122 // glVertexAttribPointer. |
| 123 struct AttribDesc { | 123 struct AttribDesc { |
| 124 ResourceID vertex_buffer_id; | 124 ResourceId vertex_buffer_id; |
| 125 GLint size; | 125 GLint size; |
| 126 GLenum type; | 126 GLenum type; |
| 127 GLboolean normalized; | 127 GLboolean normalized; |
| 128 GLsizei stride; | 128 GLsizei stride; |
| 129 ptrdiff_t offset; | 129 ptrdiff_t offset; |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 // Compiles the vertex declaration into the attribute array. | 132 // Compiles the vertex declaration into the attribute array. |
| 133 void Compile(); | 133 void Compile(); |
| 134 | 134 |
| 135 bool dirty_; | 135 bool dirty_; |
| 136 AttribDesc attribs_[kMaxAttribs]; | 136 AttribDesc attribs_[kMaxAttribs]; |
| 137 DISALLOW_COPY_AND_ASSIGN(VertexStructGL); | 137 DISALLOW_COPY_AND_ASSIGN(VertexStructGL); |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 | 140 |
| 141 } // namespace command_buffer | 141 } // namespace command_buffer |
| 142 } // namespace o3d | 142 } // namespace o3d |
| 143 | 143 |
| 144 #endif // O3D_COMMAND_BUFFER_SERVICE_CROSS_GL_GEOMETRY_GL_H_ | 144 #endif // O3D_COMMAND_BUFFER_SERVICE_CROSS_GL_GEOMETRY_GL_H_ |
| OLD | NEW |