| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // D3D9 version of VertexStruct. | 92 // D3D9 version of VertexStruct. |
| 93 class VertexStructD3D9 : public VertexStruct { | 93 class VertexStructD3D9 : public VertexStruct { |
| 94 public: | 94 public: |
| 95 explicit VertexStructD3D9(unsigned int count) | 95 explicit VertexStructD3D9(unsigned int count) |
| 96 : VertexStruct(count), | 96 : VertexStruct(count), |
| 97 dirty_(true), | 97 dirty_(true), |
| 98 d3d_vertex_decl_(NULL) {} | 98 d3d_vertex_decl_(NULL) {} |
| 99 virtual ~VertexStructD3D9(); | 99 virtual ~VertexStructD3D9(); |
| 100 // Adds an input to the vertex struct. | 100 // Adds an input to the vertex struct. |
| 101 void SetInput(unsigned int input_index, | 101 void SetInput(unsigned int input_index, |
| 102 ResourceID vertex_buffer_id, | 102 ResourceId vertex_buffer_id, |
| 103 unsigned int offset, | 103 unsigned int offset, |
| 104 unsigned int stride, | 104 unsigned int stride, |
| 105 vertex_struct::Type type, | 105 vertex_struct::Type type, |
| 106 vertex_struct::Semantic semantic, | 106 vertex_struct::Semantic semantic, |
| 107 unsigned int semantic_index); | 107 unsigned int semantic_index); |
| 108 // Sets the input streams to D3D. | 108 // Sets the input streams to D3D. |
| 109 unsigned int SetStreams(GAPID3D9 *gapi); | 109 unsigned int SetStreams(GAPID3D9 *gapi); |
| 110 private: | 110 private: |
| 111 // Destroys the vertex declaration and stream map. | 111 // Destroys the vertex declaration and stream map. |
| 112 void Destroy(); | 112 void Destroy(); |
| 113 // Compiles the vertex declaration and stream map. | 113 // Compiles the vertex declaration and stream map. |
| 114 void Compile(IDirect3DDevice9 *d3d_device); | 114 void Compile(IDirect3DDevice9 *d3d_device); |
| 115 | 115 |
| 116 bool dirty_; | 116 bool dirty_; |
| 117 typedef std::pair<ResourceID, unsigned int> StreamPair; | 117 typedef std::pair<ResourceId, unsigned int> StreamPair; |
| 118 std::vector<StreamPair> streams_; | 118 std::vector<StreamPair> streams_; |
| 119 IDirect3DVertexDeclaration9 *d3d_vertex_decl_; | 119 IDirect3DVertexDeclaration9 *d3d_vertex_decl_; |
| 120 DISALLOW_COPY_AND_ASSIGN(VertexStructD3D9); | 120 DISALLOW_COPY_AND_ASSIGN(VertexStructD3D9); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace command_buffer | 123 } // namespace command_buffer |
| 124 } // namespace o3d | 124 } // namespace o3d |
| 125 | 125 |
| 126 #endif // O3D_COMMAND_BUFFER_SERVICE_WIN_D3D9_GEOMETRY_D3D9_H_ | 126 #endif // O3D_COMMAND_BUFFER_SERVICE_WIN_D3D9_GEOMETRY_D3D9_H_ |
| OLD | NEW |