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 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 void RendererGL::SetViewportInPixels(int left, | 1183 void RendererGL::SetViewportInPixels(int left, |
1184 int top, | 1184 int top, |
1185 int width, | 1185 int width, |
1186 int height, | 1186 int height, |
1187 float min_z, | 1187 float min_z, |
1188 float max_z) { | 1188 float max_z) { |
1189 MakeCurrentLazy(); | 1189 MakeCurrentLazy(); |
1190 int vieport_top = | 1190 int vieport_top = |
1191 RenderSurfaceActive() ? top : display_height() - top - height; | 1191 RenderSurfaceActive() ? top : display_height() - top - height; |
1192 ::glViewport(left, vieport_top, width, height); | 1192 ::glViewport(left, vieport_top, width, height); |
1193 UpdateHelperConstant(width, height); | 1193 UpdateHelperConstant(static_cast<float>(width), static_cast<float>(height)); |
1194 | 1194 |
1195 // If it's the full client area turn off scissor test for speed. | 1195 // If it's the full client area turn off scissor test for speed. |
1196 if (left == 0 && | 1196 if (left == 0 && |
1197 top == 0 && | 1197 top == 0 && |
1198 width == display_width() && | 1198 width == display_width() && |
1199 height == display_height()) { | 1199 height == display_height()) { |
1200 ::glDisable(GL_SCISSOR_TEST); | 1200 ::glDisable(GL_SCISSOR_TEST); |
1201 } else { | 1201 } else { |
1202 ::glScissor(left, vieport_top, width, height); | 1202 ::glScissor(left, vieport_top, width, height); |
1203 ::glEnable(GL_SCISSOR_TEST); | 1203 ::glEnable(GL_SCISSOR_TEST); |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1498 return swizzle_table; | 1498 return swizzle_table; |
1499 } | 1499 } |
1500 | 1500 |
1501 // This is a factory function for creating Renderer objects. Since | 1501 // This is a factory function for creating Renderer objects. Since |
1502 // we're implementing GL, we only ever return a GL renderer. | 1502 // we're implementing GL, we only ever return a GL renderer. |
1503 Renderer* Renderer::CreateDefaultRenderer(ServiceLocator* service_locator) { | 1503 Renderer* Renderer::CreateDefaultRenderer(ServiceLocator* service_locator) { |
1504 return RendererGL::CreateDefault(service_locator); | 1504 return RendererGL::CreateDefault(service_locator); |
1505 } | 1505 } |
1506 | 1506 |
1507 } // namespace o3d | 1507 } // namespace o3d |
OLD | NEW |