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 23 matching lines...) Expand all Loading... |
34 | 34 |
35 #ifndef O3D_COMMAND_BUFFER_SERVICE_CROSS_GL_SAMPLER_GL_H_ | 35 #ifndef O3D_COMMAND_BUFFER_SERVICE_CROSS_GL_SAMPLER_GL_H_ |
36 #define O3D_COMMAND_BUFFER_SERVICE_CROSS_GL_SAMPLER_GL_H_ | 36 #define O3D_COMMAND_BUFFER_SERVICE_CROSS_GL_SAMPLER_GL_H_ |
37 | 37 |
38 #include "command_buffer/common/cross/gapi_interface.h" | 38 #include "command_buffer/common/cross/gapi_interface.h" |
39 #include "command_buffer/service/cross/gl/gl_utils.h" | 39 #include "command_buffer/service/cross/gl/gl_utils.h" |
40 #include "command_buffer/service/cross/resource.h" | 40 #include "command_buffer/service/cross/resource.h" |
41 | 41 |
42 namespace o3d { | 42 namespace o3d { |
43 namespace command_buffer { | 43 namespace command_buffer { |
| 44 namespace o3d { |
44 | 45 |
45 class GAPIGL; | 46 class GAPIGL; |
46 | 47 |
47 // GL version of Sampler. | 48 // GL version of Sampler. |
48 class SamplerGL : public Sampler { | 49 class SamplerGL : public Sampler { |
49 public: | 50 public: |
50 SamplerGL(); | 51 SamplerGL(); |
51 | 52 |
52 // Applies sampler states to GL. | 53 // Applies sampler states to GL. |
53 bool ApplyStates(GAPIGL *gapi); | 54 bool ApplyStates(GAPIGL *gapi); |
54 | 55 |
55 // Sets sampler states. | 56 // Sets sampler states. |
56 void SetStates(sampler::AddressingMode addressing_u, | 57 void SetStates(sampler::AddressingMode addressing_u, |
57 sampler::AddressingMode addressing_v, | 58 sampler::AddressingMode addressing_v, |
58 sampler::AddressingMode addressing_w, | 59 sampler::AddressingMode addressing_w, |
59 sampler::FilteringMode mag_filter, | 60 sampler::FilteringMode mag_filter, |
60 sampler::FilteringMode min_filter, | 61 sampler::FilteringMode min_filter, |
61 sampler::FilteringMode mip_filter, | 62 sampler::FilteringMode mip_filter, |
62 unsigned int max_anisotropy); | 63 unsigned int max_anisotropy); |
63 | 64 |
64 // Sets the border color states. | 65 // Sets the border color states. |
65 void SetBorderColor(const RGBA &color); | 66 void SetBorderColor(const o3d::RGBA &color); |
66 | 67 |
67 // Sets the texture. | 68 // Sets the texture. |
68 void SetTexture(ResourceId texture) { texture_id_ = texture; } | 69 void SetTexture(ResourceId texture) { texture_id_ = texture; } |
69 | 70 |
70 GLuint gl_texture() const { return gl_texture_; } | 71 GLuint gl_texture() const { return gl_texture_; } |
71 | 72 |
72 private: | 73 private: |
73 GLenum gl_wrap_s_; | 74 GLenum gl_wrap_s_; |
74 GLenum gl_wrap_t_; | 75 GLenum gl_wrap_t_; |
75 GLenum gl_wrap_r_; | 76 GLenum gl_wrap_r_; |
76 GLenum gl_mag_filter_; | 77 GLenum gl_mag_filter_; |
77 GLenum gl_min_filter_; | 78 GLenum gl_min_filter_; |
78 GLuint gl_max_anisotropy_; | 79 GLuint gl_max_anisotropy_; |
79 GLfloat gl_border_color_[4]; | 80 GLfloat gl_border_color_[4]; |
80 GLuint gl_texture_; | 81 GLuint gl_texture_; |
81 ResourceId texture_id_; | 82 ResourceId texture_id_; |
82 }; | 83 }; |
83 | 84 |
| 85 } // namespace o3d |
84 } // namespace command_buffer | 86 } // namespace command_buffer |
85 } // namespace o3d | 87 } // namespace o3d |
86 | 88 |
87 #endif // O3D_COMMAND_BUFFER_SERVICE_CROSS_GL_SAMPLER_GL_H_ | 89 #endif // O3D_COMMAND_BUFFER_SERVICE_CROSS_GL_SAMPLER_GL_H_ |
OLD | NEW |