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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 void DirtyEffect(); | 420 void DirtyEffect(); |
421 private: | 421 private: |
422 bool InitPlatformSpecific(); | 422 bool InitPlatformSpecific(); |
423 bool InitCommon(); | 423 bool InitCommon(); |
424 // Validates the current vertex struct to GL, setting the vertex attributes. | 424 // Validates the current vertex struct to GL, setting the vertex attributes. |
425 bool ValidateStreams(); | 425 bool ValidateStreams(); |
426 // Validates the current effect to GL. This sets the vertex and fragment | 426 // Validates the current effect to GL. This sets the vertex and fragment |
427 // programs, and updates parameters if needed. | 427 // programs, and updates parameters if needed. |
428 bool ValidateEffect(); | 428 bool ValidateEffect(); |
429 | 429 |
| 430 CGcontext cg_context_; |
| 431 |
430 #if defined(OS_LINUX) | 432 #if defined(OS_LINUX) |
431 XWindowWrapper *window_; | 433 XWindowWrapper *window_; |
432 #elif defined(OS_WIN) | 434 #elif defined(OS_WIN) |
433 // Handle to the GL device. | 435 // Handle to the GL device. |
434 HWND hwnd_; | 436 HWND hwnd_; |
435 HDC device_context_; | 437 HDC device_context_; |
436 HGLRC gl_context_; | 438 HGLRC gl_context_; |
437 #endif | 439 #endif |
438 | 440 |
439 CGcontext cg_context_; | |
440 | |
441 bool anti_aliased_; | 441 bool anti_aliased_; |
442 ResourceId current_vertex_struct_; | 442 ResourceId current_vertex_struct_; |
443 bool validate_streams_; | 443 bool validate_streams_; |
444 unsigned int max_vertices_; | 444 unsigned int max_vertices_; |
445 ResourceId current_effect_id_; | 445 ResourceId current_effect_id_; |
446 bool validate_effect_; | 446 bool validate_effect_; |
447 EffectGL *current_effect_; | 447 EffectGL *current_effect_; |
448 ResourceId current_surface_id_; | 448 ResourceId current_surface_id_; |
449 ResourceId current_depth_surface_id_; | 449 ResourceId current_depth_surface_id_; |
450 GLuint render_surface_framebuffer_; | 450 GLuint render_surface_framebuffer_; |
451 | 451 |
452 ResourceMap<VertexBufferGL> vertex_buffers_; | 452 ResourceMap<VertexBufferGL> vertex_buffers_; |
453 ResourceMap<IndexBufferGL> index_buffers_; | 453 ResourceMap<IndexBufferGL> index_buffers_; |
454 ResourceMap<VertexStructGL> vertex_structs_; | 454 ResourceMap<VertexStructGL> vertex_structs_; |
455 ResourceMap<EffectGL> effects_; | 455 ResourceMap<EffectGL> effects_; |
456 ResourceMap<EffectParamGL> effect_params_; | 456 ResourceMap<EffectParamGL> effect_params_; |
457 ResourceMap<TextureGL> textures_; | 457 ResourceMap<TextureGL> textures_; |
458 ResourceMap<SamplerGL> samplers_; | 458 ResourceMap<SamplerGL> samplers_; |
459 ResourceMap<RenderSurfaceGL> render_surfaces_; | 459 ResourceMap<RenderSurfaceGL> render_surfaces_; |
460 ResourceMap<RenderDepthStencilSurfaceGL> depth_surfaces_; | 460 ResourceMap<RenderDepthStencilSurfaceGL> depth_surfaces_; |
461 }; | 461 }; |
462 | 462 |
463 } // namespace o3d | 463 } // namespace o3d |
464 } // namespace command_buffer | 464 } // namespace command_buffer |
465 } // namespace o3d | 465 } // namespace o3d |
466 | 466 |
467 #endif // O3D_COMMAND_BUFFER_SERVICE_CROSS_GL_GAPI_GL_H_ | 467 #endif // O3D_COMMAND_BUFFER_SERVICE_CROSS_GL_GAPI_GL_H_ |
OLD | NEW |