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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 const RGBA &color, | 173 const RGBA &color, |
174 float depth, | 174 float depth, |
175 unsigned int stencil) = 0; | 175 unsigned int stencil) = 0; |
176 | 176 |
177 // Creates a vertex buffer. | 177 // Creates a vertex buffer. |
178 // Parameters: | 178 // Parameters: |
179 // id: the resource ID for the new vertex buffer. | 179 // id: the resource ID for the new vertex buffer. |
180 // size: the size of the vertex buffer, in bytes. | 180 // size: the size of the vertex buffer, in bytes. |
181 // flags: the vertex buffer flags, as a combination of vertex_buffer::Flags | 181 // flags: the vertex buffer flags, as a combination of vertex_buffer::Flags |
182 // Returns: | 182 // Returns: |
183 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 183 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
184 // passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 184 // passed, BufferSyncInterface::kParseNoError otherwise. |
185 virtual ParseError CreateVertexBuffer(ResourceID id, | 185 virtual ParseError CreateVertexBuffer(ResourceID id, |
186 unsigned int size, | 186 unsigned int size, |
187 unsigned int flags) = 0; | 187 unsigned int flags) = 0; |
188 | 188 |
189 // Destroys a vertex buffer. | 189 // Destroys a vertex buffer. |
190 // Parameters: | 190 // Parameters: |
191 // id: the resource ID of the vertex buffer. | 191 // id: the resource ID of the vertex buffer. |
192 // Returns: | 192 // Returns: |
193 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if an invalid vertex buffer | 193 // BufferSyncInterface::kParseInvalidArguments if an invalid vertex buffer |
194 // ID was passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 194 // ID was passed, BufferSyncInterface::kParseNoError otherwise. |
195 virtual ParseError DestroyVertexBuffer(ResourceID id) = 0; | 195 virtual ParseError DestroyVertexBuffer(ResourceID id) = 0; |
196 | 196 |
197 // Sets data into a vertex buffer. | 197 // Sets data into a vertex buffer. |
198 // Parameters: | 198 // Parameters: |
199 // id: the resource ID of the vertex buffer. | 199 // id: the resource ID of the vertex buffer. |
200 // offset: the offset into the vertex buffer where to place the data. | 200 // offset: the offset into the vertex buffer where to place the data. |
201 // size: the size of the data. | 201 // size: the size of the data. |
202 // data: the source data. | 202 // data: the source data. |
203 // Returns: | 203 // Returns: |
204 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments were | 204 // BufferSyncInterface::kParseInvalidArguments if invalid arguments were |
205 // passed: invalid resource ID, or offset or size out of range. | 205 // passed: invalid resource ID, or offset or size out of range. |
206 // BufferSyncInterface::PARSE_NO_ERROR otherwise. | 206 // BufferSyncInterface::kParseNoError otherwise. |
207 virtual ParseError SetVertexBufferData(ResourceID id, | 207 virtual ParseError SetVertexBufferData(ResourceID id, |
208 unsigned int offset, | 208 unsigned int offset, |
209 unsigned int size, | 209 unsigned int size, |
210 const void *data) = 0; | 210 const void *data) = 0; |
211 | 211 |
212 // Gets data from a vertex buffer. | 212 // Gets data from a vertex buffer. |
213 // Parameters: | 213 // Parameters: |
214 // id: the resource ID of the vertex buffer. | 214 // id: the resource ID of the vertex buffer. |
215 // offset: the offset into the vertex buffer where to get the data. | 215 // offset: the offset into the vertex buffer where to get the data. |
216 // size: the size of the data. | 216 // size: the size of the data. |
217 // data: the destination buffer. | 217 // data: the destination buffer. |
218 // Returns: | 218 // Returns: |
219 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments were | 219 // BufferSyncInterface::kParseInvalidArguments if invalid arguments were |
220 // passed: invalid resource ID, or offset or size out of range. | 220 // passed: invalid resource ID, or offset or size out of range. |
221 // BufferSyncInterface::PARSE_NO_ERROR otherwise. | 221 // BufferSyncInterface::kParseNoError otherwise. |
222 virtual ParseError GetVertexBufferData(ResourceID id, | 222 virtual ParseError GetVertexBufferData(ResourceID id, |
223 unsigned int offset, | 223 unsigned int offset, |
224 unsigned int size, | 224 unsigned int size, |
225 void *data) = 0; | 225 void *data) = 0; |
226 | 226 |
227 // Creates an index buffer. | 227 // Creates an index buffer. |
228 // Parameters: | 228 // Parameters: |
229 // id: the resource ID for the new index buffer. | 229 // id: the resource ID for the new index buffer. |
230 // size: the size of the index buffer, in bytes. | 230 // size: the size of the index buffer, in bytes. |
231 // flags: the index buffer flags, as a combination of index_buffer::Flags. | 231 // flags: the index buffer flags, as a combination of index_buffer::Flags. |
232 // Note that indices are 16 bits unless the index_buffer::INDEX_32BIT | 232 // Note that indices are 16 bits unless the index_buffer::INDEX_32BIT |
233 // flag is specified. | 233 // flag is specified. |
234 // Returns: | 234 // Returns: |
235 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 235 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
236 // passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 236 // passed, BufferSyncInterface::kParseNoError otherwise. |
237 virtual ParseError CreateIndexBuffer(ResourceID id, | 237 virtual ParseError CreateIndexBuffer(ResourceID id, |
238 unsigned int size, | 238 unsigned int size, |
239 unsigned int flags) = 0; | 239 unsigned int flags) = 0; |
240 | 240 |
241 // Destroys an index buffer. | 241 // Destroys an index buffer. |
242 // Parameters: | 242 // Parameters: |
243 // id: the resource ID of the index buffer. | 243 // id: the resource ID of the index buffer. |
244 // Returns: | 244 // Returns: |
245 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if an invalid index buffer | 245 // BufferSyncInterface::kParseInvalidArguments if an invalid index buffer |
246 // ID was passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 246 // ID was passed, BufferSyncInterface::kParseNoError otherwise. |
247 virtual ParseError DestroyIndexBuffer(ResourceID id) = 0; | 247 virtual ParseError DestroyIndexBuffer(ResourceID id) = 0; |
248 | 248 |
249 // Sets data into an index buffer. | 249 // Sets data into an index buffer. |
250 // Parameters: | 250 // Parameters: |
251 // id: the resource ID of the index buffer. | 251 // id: the resource ID of the index buffer. |
252 // offset: the offset into the index buffer where to place the data. | 252 // offset: the offset into the index buffer where to place the data. |
253 // size: the size of the data. | 253 // size: the size of the data. |
254 // data: the source data. | 254 // data: the source data. |
255 // Returns: | 255 // Returns: |
256 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments were | 256 // BufferSyncInterface::kParseInvalidArguments if invalid arguments were |
257 // passed: invalid resource ID, or offset or size out of range. | 257 // passed: invalid resource ID, or offset or size out of range. |
258 // BufferSyncInterface::PARSE_NO_ERROR otherwise. | 258 // BufferSyncInterface::kParseNoError otherwise. |
259 virtual ParseError SetIndexBufferData(ResourceID id, | 259 virtual ParseError SetIndexBufferData(ResourceID id, |
260 unsigned int offset, | 260 unsigned int offset, |
261 unsigned int size, | 261 unsigned int size, |
262 const void *data) = 0; | 262 const void *data) = 0; |
263 | 263 |
264 // Gets data from an index buffer. | 264 // Gets data from an index buffer. |
265 // Parameters: | 265 // Parameters: |
266 // id: the resource ID of the index buffer. | 266 // id: the resource ID of the index buffer. |
267 // offset: the offset into the index buffer where to get the data. | 267 // offset: the offset into the index buffer where to get the data. |
268 // size: the size of the data. | 268 // size: the size of the data. |
269 // data: the destination buffer. | 269 // data: the destination buffer. |
270 // Returns: | 270 // Returns: |
271 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments were | 271 // BufferSyncInterface::kParseInvalidArguments if invalid arguments were |
272 // passed: invalid resource ID, or offset or size out of range. | 272 // passed: invalid resource ID, or offset or size out of range. |
273 // BufferSyncInterface::PARSE_NO_ERROR otherwise. | 273 // BufferSyncInterface::kParseNoError otherwise. |
274 virtual ParseError GetIndexBufferData(ResourceID id, | 274 virtual ParseError GetIndexBufferData(ResourceID id, |
275 unsigned int offset, | 275 unsigned int offset, |
276 unsigned int size, | 276 unsigned int size, |
277 void *data) = 0; | 277 void *data) = 0; |
278 | 278 |
279 // Creates a vertex struct. A vertex struct describes the input vertex | 279 // Creates a vertex struct. A vertex struct describes the input vertex |
280 // attribute streams. | 280 // attribute streams. |
281 // Parameters: | 281 // Parameters: |
282 // id: the resource ID of the vertex struct. | 282 // id: the resource ID of the vertex struct. |
283 // input_count: the number of input vertex attributes. | 283 // input_count: the number of input vertex attributes. |
284 // returns: | 284 // returns: |
285 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 285 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
286 // passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 286 // passed, BufferSyncInterface::kParseNoError otherwise. |
287 virtual ParseError CreateVertexStruct(ResourceID id, | 287 virtual ParseError CreateVertexStruct(ResourceID id, |
288 unsigned int input_count) = 0; | 288 unsigned int input_count) = 0; |
289 | 289 |
290 // Destroys a vertex struct. | 290 // Destroys a vertex struct. |
291 // Parameters: | 291 // Parameters: |
292 // id: the resource ID of the vertex struct. | 292 // id: the resource ID of the vertex struct. |
293 // Returns: | 293 // Returns: |
294 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if an invalid vertex struct | 294 // BufferSyncInterface::kParseInvalidArguments if an invalid vertex struct |
295 // ID was passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 295 // ID was passed, BufferSyncInterface::kParseNoError otherwise. |
296 virtual ParseError DestroyVertexStruct(ResourceID id) = 0; | 296 virtual ParseError DestroyVertexStruct(ResourceID id) = 0; |
297 | 297 |
298 // Sets an input into a vertex struct. | 298 // Sets an input into a vertex struct. |
299 // Parameters: | 299 // Parameters: |
300 // vertex_struct_id: the resource ID of the vertex struct. | 300 // vertex_struct_id: the resource ID of the vertex struct. |
301 // input_index: the index of the input being set. | 301 // input_index: the index of the input being set. |
302 // vertex_buffer_id: the resource ID of the vertex buffer containing the | 302 // vertex_buffer_id: the resource ID of the vertex buffer containing the |
303 // data. | 303 // data. |
304 // offset: the offset into the vertex buffer of the input data, in bytes. | 304 // offset: the offset into the vertex buffer of the input data, in bytes. |
305 // stride: the stride of the input data, in bytes. | 305 // stride: the stride of the input data, in bytes. |
306 // type: the type of the input data. | 306 // type: the type of the input data. |
307 // semantic: the semantic of the input. | 307 // semantic: the semantic of the input. |
308 // semantic_index: the semantic index of the input. | 308 // semantic_index: the semantic index of the input. |
309 // Returns: | 309 // Returns: |
310 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 310 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
311 // passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 311 // passed, BufferSyncInterface::kParseNoError otherwise. |
312 virtual ParseError SetVertexInput(ResourceID vertex_struct_id, | 312 virtual ParseError SetVertexInput(ResourceID vertex_struct_id, |
313 unsigned int input_index, | 313 unsigned int input_index, |
314 ResourceID vertex_buffer_id, | 314 ResourceID vertex_buffer_id, |
315 unsigned int offset, | 315 unsigned int offset, |
316 unsigned int stride, | 316 unsigned int stride, |
317 vertex_struct::Type type, | 317 vertex_struct::Type type, |
318 vertex_struct::Semantic semantic, | 318 vertex_struct::Semantic semantic, |
319 unsigned int semantic_index) = 0; | 319 unsigned int semantic_index) = 0; |
320 | 320 |
321 // Sets the current vertex struct for drawing. | 321 // Sets the current vertex struct for drawing. |
322 // Parameters: | 322 // Parameters: |
323 // id: the resource ID of the vertex struct. | 323 // id: the resource ID of the vertex struct. |
324 // Returns: | 324 // Returns: |
325 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 325 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
326 // passed (invalid vertex struct), BufferSyncInterface::PARSE_NO_ERROR | 326 // passed (invalid vertex struct), BufferSyncInterface::kParseNoError |
327 // otherwise. | 327 // otherwise. |
328 virtual ParseError SetVertexStruct(ResourceID id) = 0; | 328 virtual ParseError SetVertexStruct(ResourceID id) = 0; |
329 | 329 |
330 // Draws primitives, using the current vertex struct and the current effect. | 330 // Draws primitives, using the current vertex struct and the current effect. |
331 // Parameters: | 331 // Parameters: |
332 // primitive_type: the type of primitive to draw. | 332 // primitive_type: the type of primitive to draw. |
333 // first: the index of the first vertex. | 333 // first: the index of the first vertex. |
334 // count: the number of primitives to draw. | 334 // count: the number of primitives to draw. |
335 // Returns: | 335 // Returns: |
336 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 336 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
337 // passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 337 // passed, BufferSyncInterface::kParseNoError otherwise. |
338 virtual ParseError Draw(PrimitiveType primitive_type, | 338 virtual ParseError Draw(PrimitiveType primitive_type, |
339 unsigned int first, | 339 unsigned int first, |
340 unsigned int count) = 0; | 340 unsigned int count) = 0; |
341 | 341 |
342 // Draws primitives, using the current vertex struct and the current effect, | 342 // Draws primitives, using the current vertex struct and the current effect, |
343 // as well as an index buffer. | 343 // as well as an index buffer. |
344 // Parameters: | 344 // Parameters: |
345 // primitive_type: the type of primitive to draw. | 345 // primitive_type: the type of primitive to draw. |
346 // index_buffer_id: the resource ID of the index buffer. | 346 // index_buffer_id: the resource ID of the index buffer. |
347 // first: the index into the index buffer of the first index to draw. | 347 // first: the index into the index buffer of the first index to draw. |
348 // count: the number of primitives to draw. | 348 // count: the number of primitives to draw. |
349 // min_index: the lowest index being drawn. | 349 // min_index: the lowest index being drawn. |
350 // max_index: the highest index being drawn. | 350 // max_index: the highest index being drawn. |
351 // Returns: | 351 // Returns: |
352 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 352 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
353 // passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 353 // passed, BufferSyncInterface::kParseNoError otherwise. |
354 virtual ParseError DrawIndexed(PrimitiveType primitive_type, | 354 virtual ParseError DrawIndexed(PrimitiveType primitive_type, |
355 ResourceID index_buffer_id, | 355 ResourceID index_buffer_id, |
356 unsigned int first, | 356 unsigned int first, |
357 unsigned int count, | 357 unsigned int count, |
358 unsigned int min_index, | 358 unsigned int min_index, |
359 unsigned int max_index) = 0; | 359 unsigned int max_index) = 0; |
360 | 360 |
361 // Creates an effect, from source code. | 361 // Creates an effect, from source code. |
362 // Parameters: | 362 // Parameters: |
363 // id: the resource ID of the effect. | 363 // id: the resource ID of the effect. |
364 // size: the size of data. | 364 // size: the size of data. |
365 // data: the source code for the effect. | 365 // data: the source code for the effect. |
366 // Returns: | 366 // Returns: |
367 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 367 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
368 // passed or the effect failed to compile, | 368 // passed or the effect failed to compile, |
369 // BufferSyncInterface::PARSE_NO_ERROR otherwise. | 369 // BufferSyncInterface::kParseNoError otherwise. |
370 virtual ParseError CreateEffect(ResourceID id, | 370 virtual ParseError CreateEffect(ResourceID id, |
371 unsigned int size, | 371 unsigned int size, |
372 const void *data) = 0; | 372 const void *data) = 0; |
373 | 373 |
374 // Destroys an effect. | 374 // Destroys an effect. |
375 // Parameters: | 375 // Parameters: |
376 // id: the resource ID of the effect. | 376 // id: the resource ID of the effect. |
377 // Returns: | 377 // Returns: |
378 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if an invalid effect ID | 378 // BufferSyncInterface::kParseInvalidArguments if an invalid effect ID |
379 // was passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 379 // was passed, BufferSyncInterface::kParseNoError otherwise. |
380 virtual ParseError DestroyEffect(ResourceID id) = 0; | 380 virtual ParseError DestroyEffect(ResourceID id) = 0; |
381 | 381 |
382 // Sets the active effect for drawing. | 382 // Sets the active effect for drawing. |
383 // Parameters: | 383 // Parameters: |
384 // id: the resource ID of the effect. | 384 // id: the resource ID of the effect. |
385 // Returns: | 385 // Returns: |
386 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 386 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
387 // passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 387 // passed, BufferSyncInterface::kParseNoError otherwise. |
388 virtual ParseError SetEffect(ResourceID id) = 0; | 388 virtual ParseError SetEffect(ResourceID id) = 0; |
389 | 389 |
390 // Gets the number of parameters in an effect, returning it in a memory | 390 // Gets the number of parameters in an effect, returning it in a memory |
391 // buffer as a Uint32. | 391 // buffer as a Uint32. |
392 // Parameters: | 392 // Parameters: |
393 // id: the resource ID of the effect. | 393 // id: the resource ID of the effect. |
394 // size: the size of the data buffer. Must be at least 4 (the size of the | 394 // size: the size of the data buffer. Must be at least 4 (the size of the |
395 // Uint32). | 395 // Uint32). |
396 // data: the buffer receiving the data. | 396 // data: the buffer receiving the data. |
397 // Returns: | 397 // Returns: |
398 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 398 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
399 // passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 399 // passed, BufferSyncInterface::kParseNoError otherwise. |
400 virtual ParseError GetParamCount(ResourceID id, | 400 virtual ParseError GetParamCount(ResourceID id, |
401 unsigned int size, | 401 unsigned int size, |
402 void *data) = 0; | 402 void *data) = 0; |
403 | 403 |
404 // Creates an effect parameter by index. | 404 // Creates an effect parameter by index. |
405 // Parameters: | 405 // Parameters: |
406 // param_id: the resource ID of the parameter being created. | 406 // param_id: the resource ID of the parameter being created. |
407 // effect_id: the resource ID of the effect containing the parameter. | 407 // effect_id: the resource ID of the effect containing the parameter. |
408 // data_type: the data type for the parameter. Must match the data type in | 408 // data_type: the data type for the parameter. Must match the data type in |
409 // the effect source. | 409 // the effect source. |
410 // index: the index of the parameter. | 410 // index: the index of the parameter. |
411 // Returns: | 411 // Returns: |
412 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 412 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
413 // passed, such as invalid effect ID, unmatching data type or invalid | 413 // passed, such as invalid effect ID, unmatching data type or invalid |
414 // index, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 414 // index, BufferSyncInterface::kParseNoError otherwise. |
415 virtual ParseError CreateParam(ResourceID param_id, | 415 virtual ParseError CreateParam(ResourceID param_id, |
416 ResourceID effect_id, | 416 ResourceID effect_id, |
417 unsigned int index) = 0; | 417 unsigned int index) = 0; |
418 | 418 |
419 // Creates an effect parameter by name. | 419 // Creates an effect parameter by name. |
420 // Parameters: | 420 // Parameters: |
421 // param_id: the resource ID of the parameter being created. | 421 // param_id: the resource ID of the parameter being created. |
422 // effect_id: the resource ID of the effect containing the parameter. | 422 // effect_id: the resource ID of the effect containing the parameter. |
423 // data_type: the data type for the parameter. Must match the data type in | 423 // data_type: the data type for the parameter. Must match the data type in |
424 // the effect source. | 424 // the effect source. |
425 // size: the size of the parameter name. | 425 // size: the size of the parameter name. |
426 // name: the parameter name, as an array of char. Doesn't have to be | 426 // name: the parameter name, as an array of char. Doesn't have to be |
427 // nul-terminated (though nul will terminate the string). | 427 // nul-terminated (though nul will terminate the string). |
428 // Returns: | 428 // Returns: |
429 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 429 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
430 // passed, such as invalid effect ID, unmatching data type or no parameter | 430 // passed, such as invalid effect ID, unmatching data type or no parameter |
431 // was found with this name, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 431 // was found with this name, BufferSyncInterface::kParseNoError otherwise. |
432 virtual ParseError CreateParamByName(ResourceID param_id, | 432 virtual ParseError CreateParamByName(ResourceID param_id, |
433 ResourceID effect_id, | 433 ResourceID effect_id, |
434 unsigned int size, | 434 unsigned int size, |
435 const void *name) = 0; | 435 const void *name) = 0; |
436 | 436 |
437 // Destroys an effect parameter. | 437 // Destroys an effect parameter. |
438 // Parameters: | 438 // Parameters: |
439 // id: the resource ID of the parameter. | 439 // id: the resource ID of the parameter. |
440 // Returns: | 440 // Returns: |
441 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if an invalid parameter ID | 441 // BufferSyncInterface::kParseInvalidArguments if an invalid parameter ID |
442 // was passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 442 // was passed, BufferSyncInterface::kParseNoError otherwise. |
443 virtual ParseError DestroyParam(ResourceID id) = 0; | 443 virtual ParseError DestroyParam(ResourceID id) = 0; |
444 | 444 |
445 // Sets the effect parameter data. | 445 // Sets the effect parameter data. |
446 // Parameters: | 446 // Parameters: |
447 // id: the resource ID of the parameter. | 447 // id: the resource ID of the parameter. |
448 // size: the size of the data. Must be at least the size of the parameter | 448 // size: the size of the data. Must be at least the size of the parameter |
449 // as described by its type. | 449 // as described by its type. |
450 // data: the parameter data. | 450 // data: the parameter data. |
451 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 451 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
452 // passed, such as invalid parameter ID, or unmatching data size, | 452 // passed, such as invalid parameter ID, or unmatching data size, |
453 // BufferSyncInterface::PARSE_NO_ERROR otherwise. | 453 // BufferSyncInterface::kParseNoError otherwise. |
454 virtual ParseError SetParamData(ResourceID id, | 454 virtual ParseError SetParamData(ResourceID id, |
455 unsigned int size, | 455 unsigned int size, |
456 const void *data) = 0; | 456 const void *data) = 0; |
457 | 457 |
458 // Gets the parameter description, storing it into a memory buffer. The | 458 // Gets the parameter description, storing it into a memory buffer. The |
459 // parameter is described by a effect_param::Desc structure. The size must be | 459 // parameter is described by a effect_param::Desc structure. The size must be |
460 // at least the size of that structure. The name and semantic fields are only | 460 // at least the size of that structure. The name and semantic fields are only |
461 // filled if the character strings fit into the memory buffer. In any case, | 461 // filled if the character strings fit into the memory buffer. In any case, |
462 // the size field (in the effect_param::Desc) is filled with the size needed | 462 // the size field (in the effect_param::Desc) is filled with the size needed |
463 // to fill in the structure, the name and the semantic (if any). Thus to get | 463 // to fill in the structure, the name and the semantic (if any). Thus to get |
464 // the complete information, GetParamDesc can be called twice, once to get | 464 // the complete information, GetParamDesc can be called twice, once to get |
465 // the size, and, after allocating a big enough buffer, again to fill in the | 465 // the size, and, after allocating a big enough buffer, again to fill in the |
466 // complete information including the text strings. | 466 // complete information including the text strings. |
467 // Parameters: | 467 // Parameters: |
468 // id: the resource ID of the parameter. | 468 // id: the resource ID of the parameter. |
469 // size: the size of the memory buffer that wil receive the parameter | 469 // size: the size of the memory buffer that wil receive the parameter |
470 // description. Must be at least sizeof(effect_param::Desc). | 470 // description. Must be at least sizeof(effect_param::Desc). |
471 // data: the memory buffer. | 471 // data: the memory buffer. |
472 // Returns: | 472 // Returns: |
473 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 473 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
474 // passed, such as invalid parameter ID, or unsufficient data size, | 474 // passed, such as invalid parameter ID, or unsufficient data size, |
475 // BufferSyncInterface::PARSE_NO_ERROR otherwise. Note that | 475 // BufferSyncInterface::kParseNoError otherwise. Note that |
476 // BufferSyncInterface::PARSE_NO_ERROR will be returned if the structure | 476 // BufferSyncInterface::kParseNoError will be returned if the structure |
477 // itself fits, not necessarily the names. To make sure all the information | 477 // itself fits, not necessarily the names. To make sure all the information |
478 // is available, the caller should compare the returned size member of the | 478 // is available, the caller should compare the returned size member of the |
479 // effect_param::Desc structure to the size parameter passed in. | 479 // effect_param::Desc structure to the size parameter passed in. |
480 virtual ParseError GetParamDesc(ResourceID id, | 480 virtual ParseError GetParamDesc(ResourceID id, |
481 unsigned int size, | 481 unsigned int size, |
482 void *data) = 0; | 482 void *data) = 0; |
483 | 483 |
484 // Gets the number of input streams for an effect, returning it in a memory | 484 // Gets the number of input streams for an effect, returning it in a memory |
485 // buffer as a Uint32. | 485 // buffer as a Uint32. |
486 // Parameters: | 486 // Parameters: |
487 // id: the resource ID of the effect. | 487 // id: the resource ID of the effect. |
488 // size: the size of the data buffer. Must be at least 4 (the size of the | 488 // size: the size of the data buffer. Must be at least 4 (the size of the |
489 // Uint32). | 489 // Uint32). |
490 // data: the buffer receiving the data. | 490 // data: the buffer receiving the data. |
491 // Returns: | 491 // Returns: |
492 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 492 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
493 // passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 493 // passed, BufferSyncInterface::kParseNoError otherwise. |
494 virtual ParseError GetStreamCount(ResourceID id, | 494 virtual ParseError GetStreamCount(ResourceID id, |
495 unsigned int size, | 495 unsigned int size, |
496 void *data) = 0; | 496 void *data) = 0; |
497 | 497 |
498 // Gets the stream semantics, storing them in the data buffer. The stream | 498 // Gets the stream semantics, storing them in the data buffer. The stream |
499 // is described by an effect_stream::Desc structure which contains a | 499 // is described by an effect_stream::Desc structure which contains a |
500 // semantic type and a semantic index. | 500 // semantic type and a semantic index. |
501 // Parameters: | 501 // Parameters: |
502 // id: the resource ID of the effect. | 502 // id: the resource ID of the effect. |
503 // index: which stream semantic to get | 503 // index: which stream semantic to get |
504 // size: the size of the data buffer. Must be at least 8 (the size of two | 504 // size: the size of the data buffer. Must be at least 8 (the size of two |
505 // Uint32). | 505 // Uint32). |
506 // data: the buffer receiving the data. | 506 // data: the buffer receiving the data. |
507 virtual ParseError GetStreamDesc(ResourceID id, | 507 virtual ParseError GetStreamDesc(ResourceID id, |
508 unsigned int index, | 508 unsigned int index, |
509 unsigned int size, | 509 unsigned int size, |
510 void *data) = 0; | 510 void *data) = 0; |
511 | 511 |
512 // Creates a 2D texture resource. | 512 // Creates a 2D texture resource. |
513 // Parameters: | 513 // Parameters: |
514 // id: the resource ID of the texture. | 514 // id: the resource ID of the texture. |
515 // width: the texture width. Must be positive. | 515 // width: the texture width. Must be positive. |
516 // height: the texture height. Must be positive. | 516 // height: the texture height. Must be positive. |
517 // levels: the number of mipmap levels in the texture, or 0 to use the | 517 // levels: the number of mipmap levels in the texture, or 0 to use the |
518 // maximum. | 518 // maximum. |
519 // format: the format of the texels in the texture. | 519 // format: the format of the texels in the texture. |
520 // flags: the texture flags, as a combination of texture::Flags. | 520 // flags: the texture flags, as a combination of texture::Flags. |
521 // enable_render_surfaces: bool for whether to enable render surfaces | 521 // enable_render_surfaces: bool for whether to enable render surfaces |
522 // Returns: | 522 // Returns: |
523 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 523 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
524 // passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 524 // passed, BufferSyncInterface::kParseNoError otherwise. |
525 virtual ParseError CreateTexture2D(ResourceID id, | 525 virtual ParseError CreateTexture2D(ResourceID id, |
526 unsigned int width, | 526 unsigned int width, |
527 unsigned int height, | 527 unsigned int height, |
528 unsigned int levels, | 528 unsigned int levels, |
529 texture::Format format, | 529 texture::Format format, |
530 unsigned int flags, | 530 unsigned int flags, |
531 bool enable_render_surfaces) = 0; | 531 bool enable_render_surfaces) = 0; |
532 | 532 |
533 // Creates a 3D texture resource. | 533 // Creates a 3D texture resource. |
534 // Parameters: | 534 // Parameters: |
535 // id: the resource ID of the texture. | 535 // id: the resource ID of the texture. |
536 // width: the texture width. Must be positive. | 536 // width: the texture width. Must be positive. |
537 // height: the texture height. Must be positive. | 537 // height: the texture height. Must be positive. |
538 // depth: the texture depth. Must be positive. | 538 // depth: the texture depth. Must be positive. |
539 // levels: the number of mipmap levels in the texture, or 0 to use the | 539 // levels: the number of mipmap levels in the texture, or 0 to use the |
540 // maximum. | 540 // maximum. |
541 // format: the format of the pixels in the texture. | 541 // format: the format of the pixels in the texture. |
542 // flags: the texture flags, as a combination of texture::Flags. | 542 // flags: the texture flags, as a combination of texture::Flags. |
543 // enable_render_surfaces: bool for whether to enable render surfaces | 543 // enable_render_surfaces: bool for whether to enable render surfaces |
544 // Returns: | 544 // Returns: |
545 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 545 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
546 // passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 546 // passed, BufferSyncInterface::kParseNoError otherwise. |
547 virtual ParseError CreateTexture3D(ResourceID id, | 547 virtual ParseError CreateTexture3D(ResourceID id, |
548 unsigned int width, | 548 unsigned int width, |
549 unsigned int height, | 549 unsigned int height, |
550 unsigned int depth, | 550 unsigned int depth, |
551 unsigned int levels, | 551 unsigned int levels, |
552 texture::Format format, | 552 texture::Format format, |
553 unsigned int flags, | 553 unsigned int flags, |
554 bool enable_render_surfaces) = 0; | 554 bool enable_render_surfaces) = 0; |
555 | 555 |
556 // Creates a cube map texture resource. | 556 // Creates a cube map texture resource. |
557 // Parameters: | 557 // Parameters: |
558 // id: the resource ID of the texture. | 558 // id: the resource ID of the texture. |
559 // side: the texture side length. Must be positive. | 559 // side: the texture side length. Must be positive. |
560 // levels: the number of mipmap levels in the texture, or 0 to use the | 560 // levels: the number of mipmap levels in the texture, or 0 to use the |
561 // maximum. | 561 // maximum. |
562 // format: the format of the pixels in the texture. | 562 // format: the format of the pixels in the texture. |
563 // flags: the texture flags, as a combination of texture::Flags. | 563 // flags: the texture flags, as a combination of texture::Flags. |
564 // enable_render_surfaces: bool for whether to enable render surfaces | 564 // enable_render_surfaces: bool for whether to enable render surfaces |
565 // Returns: | 565 // Returns: |
566 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 566 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
567 // passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 567 // passed, BufferSyncInterface::kParseNoError otherwise. |
568 virtual ParseError CreateTextureCube(ResourceID id, | 568 virtual ParseError CreateTextureCube(ResourceID id, |
569 unsigned int side, | 569 unsigned int side, |
570 unsigned int levels, | 570 unsigned int levels, |
571 texture::Format format, | 571 texture::Format format, |
572 unsigned int flags, | 572 unsigned int flags, |
573 bool enable_render_surfaces) = 0; | 573 bool enable_render_surfaces) = 0; |
574 | 574 |
575 // Sets texel data into a texture resource. This is a common function for | 575 // Sets texel data into a texture resource. This is a common function for |
576 // each of the texture types, but some restrictions exist based on the | 576 // each of the texture types, but some restrictions exist based on the |
577 // texture type. The specified rectangle or volume of data, defined by x, y, | 577 // texture type. The specified rectangle or volume of data, defined by x, y, |
(...skipping 14 matching lines...) Expand all Loading... |
592 // level: the mipmap level to put the data into. | 592 // level: the mipmap level to put the data into. |
593 // face: which face of the cube to put the data into. Is ignored for | 593 // face: which face of the cube to put the data into. Is ignored for |
594 // non-cube map textures. | 594 // non-cube map textures. |
595 // row_pitch: the number of bytes between two consecutive rows of blocks, | 595 // row_pitch: the number of bytes between two consecutive rows of blocks, |
596 // in the source data. | 596 // in the source data. |
597 // slice_pitch: the number of bytes between two consecutive slices of | 597 // slice_pitch: the number of bytes between two consecutive slices of |
598 // blocks, in the source data. Is ignored for non-3D textures. | 598 // blocks, in the source data. Is ignored for non-3D textures. |
599 // size: the size of the data. | 599 // size: the size of the data. |
600 // data: the texel data. | 600 // data: the texel data. |
601 // Returns: | 601 // Returns: |
602 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 602 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
603 // passed, for example invalid size, or out-of-bounds rectangle/volume, | 603 // passed, for example invalid size, or out-of-bounds rectangle/volume, |
604 // BufferSyncInterface::PARSE_NO_ERROR otherwise. | 604 // BufferSyncInterface::kParseNoError otherwise. |
605 virtual ParseError SetTextureData(ResourceID id, | 605 virtual ParseError SetTextureData(ResourceID id, |
606 unsigned int x, | 606 unsigned int x, |
607 unsigned int y, | 607 unsigned int y, |
608 unsigned int z, | 608 unsigned int z, |
609 unsigned int width, | 609 unsigned int width, |
610 unsigned int height, | 610 unsigned int height, |
611 unsigned int depth, | 611 unsigned int depth, |
612 unsigned int level, | 612 unsigned int level, |
613 texture::Face face, | 613 texture::Face face, |
614 unsigned int pitch, | 614 unsigned int pitch, |
(...skipping 21 matching lines...) Expand all Loading... |
636 // level: the mipmap level to put the data into. | 636 // level: the mipmap level to put the data into. |
637 // face: which face of the cube to put the data into. Is ignored for | 637 // face: which face of the cube to put the data into. Is ignored for |
638 // non-cube map textures. | 638 // non-cube map textures. |
639 // row_pitch: the number of bytes between two consecutive rows of blocks, | 639 // row_pitch: the number of bytes between two consecutive rows of blocks, |
640 // in the destination buffer. | 640 // in the destination buffer. |
641 // slice_pitch: the number of bytes between two consecutive slices of | 641 // slice_pitch: the number of bytes between two consecutive slices of |
642 // blocks, in the destination buffer. Is ignored for non-3D textures. | 642 // blocks, in the destination buffer. Is ignored for non-3D textures. |
643 // size: the size of the data. | 643 // size: the size of the data. |
644 // data: the destination buffer. | 644 // data: the destination buffer. |
645 // Returns: | 645 // Returns: |
646 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 646 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
647 // passed, for example invalid size, or out-of-bounds rectangle/volume, | 647 // passed, for example invalid size, or out-of-bounds rectangle/volume, |
648 // BufferSyncInterface::PARSE_NO_ERROR otherwise. | 648 // BufferSyncInterface::kParseNoError otherwise. |
649 virtual ParseError GetTextureData(ResourceID id, | 649 virtual ParseError GetTextureData(ResourceID id, |
650 unsigned int x, | 650 unsigned int x, |
651 unsigned int y, | 651 unsigned int y, |
652 unsigned int z, | 652 unsigned int z, |
653 unsigned int width, | 653 unsigned int width, |
654 unsigned int height, | 654 unsigned int height, |
655 unsigned int depth, | 655 unsigned int depth, |
656 unsigned int level, | 656 unsigned int level, |
657 texture::Face face, | 657 texture::Face face, |
658 unsigned int pitch, | 658 unsigned int pitch, |
659 unsigned int slice_pitch, | 659 unsigned int slice_pitch, |
660 unsigned int size, | 660 unsigned int size, |
661 void *data) = 0; | 661 void *data) = 0; |
662 | 662 |
663 // Destroys a texture resource. | 663 // Destroys a texture resource. |
664 // Parameters: | 664 // Parameters: |
665 // id: the resource ID of the texture. | 665 // id: the resource ID of the texture. |
666 // Returns: | 666 // Returns: |
667 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if an invalid texture | 667 // BufferSyncInterface::kParseInvalidArguments if an invalid texture |
668 // resource ID was passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 668 // resource ID was passed, BufferSyncInterface::kParseNoError otherwise. |
669 virtual ParseError DestroyTexture(ResourceID id) = 0; | 669 virtual ParseError DestroyTexture(ResourceID id) = 0; |
670 | 670 |
671 // Creates a sampler resource. | 671 // Creates a sampler resource. |
672 // Parameters: | 672 // Parameters: |
673 // id: the resource ID of the sampler. | 673 // id: the resource ID of the sampler. |
674 // Returns: | 674 // Returns: |
675 // BufferSyncInterface::PARSE_NO_ERROR. | 675 // BufferSyncInterface::kParseNoError. |
676 virtual ParseError CreateSampler(ResourceID id) = 0; | 676 virtual ParseError CreateSampler(ResourceID id) = 0; |
677 | 677 |
678 // Destroys a sampler resource. | 678 // Destroys a sampler resource. |
679 // Parameters: | 679 // Parameters: |
680 // id: the resource ID of the sampler. | 680 // id: the resource ID of the sampler. |
681 // Returns: | 681 // Returns: |
682 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if an invalid sampler | 682 // BufferSyncInterface::kParseInvalidArguments if an invalid sampler |
683 // resource ID was passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 683 // resource ID was passed, BufferSyncInterface::kParseNoError otherwise. |
684 virtual ParseError DestroySampler(ResourceID id) = 0; | 684 virtual ParseError DestroySampler(ResourceID id) = 0; |
685 | 685 |
686 // Sets the states in a sampler resource. | 686 // Sets the states in a sampler resource. |
687 // Parameters: | 687 // Parameters: |
688 // id: the resource ID of the sampler. | 688 // id: the resource ID of the sampler. |
689 // addressing_u: the addressing mode for the U coordinate. | 689 // addressing_u: the addressing mode for the U coordinate. |
690 // addressing_v: the addressing mode for the V coordinate. | 690 // addressing_v: the addressing mode for the V coordinate. |
691 // addressing_w: the addressing mode for the W coordinate. | 691 // addressing_w: the addressing mode for the W coordinate. |
692 // mag_filter: the filtering mode when magnifying textures. | 692 // mag_filter: the filtering mode when magnifying textures. |
693 // min_filter: the filtering mode when minifying textures. | 693 // min_filter: the filtering mode when minifying textures. |
694 // mip_filter: the filtering mode for mip-map interpolation textures. | 694 // mip_filter: the filtering mode for mip-map interpolation textures. |
695 // max_anisotropy: the maximum anisotropy. | 695 // max_anisotropy: the maximum anisotropy. |
696 // Returns: | 696 // Returns: |
697 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if an invalid sampler | 697 // BufferSyncInterface::kParseInvalidArguments if an invalid sampler |
698 // resource ID was passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 698 // resource ID was passed, BufferSyncInterface::kParseNoError otherwise. |
699 virtual ParseError SetSamplerStates(ResourceID id, | 699 virtual ParseError SetSamplerStates(ResourceID id, |
700 sampler::AddressingMode addressing_u, | 700 sampler::AddressingMode addressing_u, |
701 sampler::AddressingMode addressing_v, | 701 sampler::AddressingMode addressing_v, |
702 sampler::AddressingMode addressing_w, | 702 sampler::AddressingMode addressing_w, |
703 sampler::FilteringMode mag_filter, | 703 sampler::FilteringMode mag_filter, |
704 sampler::FilteringMode min_filter, | 704 sampler::FilteringMode min_filter, |
705 sampler::FilteringMode mip_filter, | 705 sampler::FilteringMode mip_filter, |
706 unsigned int max_anisotropy) = 0; | 706 unsigned int max_anisotropy) = 0; |
707 | 707 |
708 // Sets the color of border pixels. | 708 // Sets the color of border pixels. |
709 // Parameters: | 709 // Parameters: |
710 // id: the resource ID of the sampler. | 710 // id: the resource ID of the sampler. |
711 // color: the border color. | 711 // color: the border color. |
712 // Returns: | 712 // Returns: |
713 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if an invalid sampler | 713 // BufferSyncInterface::kParseInvalidArguments if an invalid sampler |
714 // resource ID was passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 714 // resource ID was passed, BufferSyncInterface::kParseNoError otherwise. |
715 virtual ParseError SetSamplerBorderColor(ResourceID id, | 715 virtual ParseError SetSamplerBorderColor(ResourceID id, |
716 const RGBA &color) = 0; | 716 const RGBA &color) = 0; |
717 | 717 |
718 // Sets the texture resource used by a sampler resource. | 718 // Sets the texture resource used by a sampler resource. |
719 // Parameters: | 719 // Parameters: |
720 // id: the resource ID of the sampler. | 720 // id: the resource ID of the sampler. |
721 // texture_id: the resource id of the texture. | 721 // texture_id: the resource id of the texture. |
722 // Returns: | 722 // Returns: |
723 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if an invalid sampler | 723 // BufferSyncInterface::kParseInvalidArguments if an invalid sampler |
724 // resource ID was passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 724 // resource ID was passed, BufferSyncInterface::kParseNoError otherwise. |
725 virtual ParseError SetSamplerTexture(ResourceID id, | 725 virtual ParseError SetSamplerTexture(ResourceID id, |
726 ResourceID texture_id) = 0; | 726 ResourceID texture_id) = 0; |
727 | 727 |
728 // Sets the viewport, and depth range. | 728 // Sets the viewport, and depth range. |
729 // Parameters: | 729 // Parameters: |
730 // x, y: upper left corner of the viewport. | 730 // x, y: upper left corner of the viewport. |
731 // width, height: dimensions of the viewport. | 731 // width, height: dimensions of the viewport. |
732 // z_min, z_max: depth range. | 732 // z_min, z_max: depth range. |
733 virtual void SetViewport(unsigned int x, | 733 virtual void SetViewport(unsigned int x, |
734 unsigned int y, | 734 unsigned int y, |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 // Sets the blending color. | 853 // Sets the blending color. |
854 virtual void SetBlendingColor(const RGBA &color) = 0; | 854 virtual void SetBlendingColor(const RGBA &color) = 0; |
855 | 855 |
856 // Creates a render surface resource. | 856 // Creates a render surface resource. |
857 // Parameters: | 857 // Parameters: |
858 // id: the resource ID of the render surface. | 858 // id: the resource ID of the render surface. |
859 // width: the texture width. Must be positive. | 859 // width: the texture width. Must be positive. |
860 // height: the texture height. Must be positive. | 860 // height: the texture height. Must be positive. |
861 // texture_id: the resource id of the texture. | 861 // texture_id: the resource id of the texture. |
862 // Returns: | 862 // Returns: |
863 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 863 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
864 // passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 864 // passed, BufferSyncInterface::kParseNoError otherwise. |
865 virtual ParseError CreateRenderSurface(ResourceID id, | 865 virtual ParseError CreateRenderSurface(ResourceID id, |
866 unsigned int width, | 866 unsigned int width, |
867 unsigned int height, | 867 unsigned int height, |
868 unsigned int mip_level, | 868 unsigned int mip_level, |
869 unsigned int side, | 869 unsigned int side, |
870 ResourceID texture_id) = 0; | 870 ResourceID texture_id) = 0; |
871 | 871 |
872 // Destroys a render surface resource. | 872 // Destroys a render surface resource. |
873 // Parameters: | 873 // Parameters: |
874 // id: the resource ID of the render surface. | 874 // id: the resource ID of the render surface. |
875 // Returns: | 875 // Returns: |
876 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if an invalid render | 876 // BufferSyncInterface::kParseInvalidArguments if an invalid render |
877 // surface | 877 // surface |
878 // resource ID was passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 878 // resource ID was passed, BufferSyncInterface::kParseNoError otherwise. |
879 virtual ParseError DestroyRenderSurface(ResourceID id) = 0; | 879 virtual ParseError DestroyRenderSurface(ResourceID id) = 0; |
880 | 880 |
881 // Creates a depth stencil surface resource. | 881 // Creates a depth stencil surface resource. |
882 // Parameters: | 882 // Parameters: |
883 // id: the resource ID of the depth stencil surface. | 883 // id: the resource ID of the depth stencil surface. |
884 // width: the texture width. Must be positive. | 884 // width: the texture width. Must be positive. |
885 // height: the texture height. Must be positive. | 885 // height: the texture height. Must be positive. |
886 // Returns: | 886 // Returns: |
887 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 887 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
888 // passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 888 // passed, BufferSyncInterface::kParseNoError otherwise. |
889 virtual ParseError CreateDepthSurface(ResourceID id, | 889 virtual ParseError CreateDepthSurface(ResourceID id, |
890 unsigned int width, | 890 unsigned int width, |
891 unsigned int height) = 0; | 891 unsigned int height) = 0; |
892 | 892 |
893 // Destroys a depth stencil surface resource. | 893 // Destroys a depth stencil surface resource. |
894 // Parameters: | 894 // Parameters: |
895 // id: the resource ID of the depth stencil surface. | 895 // id: the resource ID of the depth stencil surface. |
896 // Returns: | 896 // Returns: |
897 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if an invalid render | 897 // BufferSyncInterface::kParseInvalidArguments if an invalid render |
898 // surface | 898 // surface |
899 // resource ID was passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 899 // resource ID was passed, BufferSyncInterface::kParseNoError otherwise. |
900 virtual ParseError DestroyDepthSurface(ResourceID id) = 0; | 900 virtual ParseError DestroyDepthSurface(ResourceID id) = 0; |
901 | 901 |
902 // Switches the render surface and depth stencil surface to those | 902 // Switches the render surface and depth stencil surface to those |
903 // corresponding to the passed in IDs. | 903 // corresponding to the passed in IDs. |
904 // Parameters: | 904 // Parameters: |
905 // render_surface_id: the resource ID of the render surface. | 905 // render_surface_id: the resource ID of the render surface. |
906 // depth_stencil_id: the resource ID of the render depth stencil surface. | 906 // depth_stencil_id: the resource ID of the render depth stencil surface. |
907 // Returns: | 907 // Returns: |
908 // BufferSyncInterface::PARSE_INVALID_ARGUMENTS if invalid arguments are | 908 // BufferSyncInterface::kParseInvalidArguments if invalid arguments are |
909 // passed, BufferSyncInterface::PARSE_NO_ERROR otherwise. | 909 // passed, BufferSyncInterface::kParseNoError otherwise. |
910 virtual ParseError SetRenderSurface(ResourceID render_surface_id, | 910 virtual ParseError SetRenderSurface(ResourceID render_surface_id, |
911 ResourceID depth_stencil_id) = 0; | 911 ResourceID depth_stencil_id) = 0; |
912 | 912 |
913 // Switch the render surface and depth stencil surface back to the main | 913 // Switch the render surface and depth stencil surface back to the main |
914 // surfaces stored in the render | 914 // surfaces stored in the render |
915 virtual void SetBackSurfaces() = 0; | 915 virtual void SetBackSurfaces() = 0; |
916 }; | 916 }; |
917 | 917 |
918 } // namespace command_buffer | 918 } // namespace command_buffer |
919 } // namespace o3d | 919 } // namespace o3d |
920 | 920 |
921 #endif // O3D_COMMAND_BUFFER_COMMON_CROSS_GAPI_INTERFACE_H_ | 921 #endif // O3D_COMMAND_BUFFER_COMMON_CROSS_GAPI_INTERFACE_H_ |
OLD | NEW |