| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file implements a standalone executable demo of using GLES2 over | 5 // This file implements a standalone executable demo of using GLES2 over |
| 6 // command buffers. This code is temporary as the setup that happens | 6 // command buffers. This code is temporary as the setup that happens |
| 7 // here is in a state of flux. Eventually there will be several versions of | 7 // here is in a state of flux. Eventually there will be several versions of |
| 8 // setup, one for trusted code, one for pepper, one for NaCl, and maybe others. | 8 // setup, one for trusted code, one for pepper, one for NaCl, and maybe others. |
| 9 | 9 |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 size_t transfer_buffer_size = 512 * 1024; | 71 size_t transfer_buffer_size = 512 * 1024; |
| 72 int32 transfer_buffer_id = | 72 int32 transfer_buffer_id = |
| 73 command_buffer->CreateTransferBuffer(transfer_buffer_size); | 73 command_buffer->CreateTransferBuffer(transfer_buffer_size); |
| 74 Buffer transfer_buffer = | 74 Buffer transfer_buffer = |
| 75 command_buffer->GetTransferBuffer(transfer_buffer_id); | 75 command_buffer->GetTransferBuffer(transfer_buffer_id); |
| 76 if (!transfer_buffer.ptr) | 76 if (!transfer_buffer.ptr) |
| 77 return false; | 77 return false; |
| 78 | 78 |
| 79 | 79 |
| 80 gles2::g_gl_impl = new GLES2Implementation(helper, | 80 gles2::Initialize(); |
| 81 transfer_buffer.size, | 81 gles2::SetGLContext(new GLES2Implementation(helper, |
| 82 transfer_buffer.ptr, | 82 transfer_buffer.size, |
| 83 transfer_buffer_id); | 83 transfer_buffer.ptr, |
| 84 transfer_buffer_id)); |
| 84 | 85 |
| 85 return command_buffer.release() != NULL; | 86 return command_buffer.release() != NULL; |
| 86 } | 87 } |
| 87 | 88 |
| 88 #if defined(OS_WIN) | 89 #if defined(OS_WIN) |
| 89 LRESULT CALLBACK WindowProc( | 90 LRESULT CALLBACK WindowProc( |
| 90 HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param) { | 91 HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param) { |
| 91 switch (msg) { | 92 switch (msg) { |
| 92 case WM_CLOSE: | 93 case WM_CLOSE: |
| 93 DestroyWindow(hwnd); | 94 DestroyWindow(hwnd); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 204 } |
| 204 | 205 |
| 205 demo->Setup(hwnd, kCommandBufferSize); | 206 demo->Setup(hwnd, kCommandBufferSize); |
| 206 | 207 |
| 207 ProcessMessages(hwnd); | 208 ProcessMessages(hwnd); |
| 208 | 209 |
| 209 return EXIT_SUCCESS; | 210 return EXIT_SUCCESS; |
| 210 } | 211 } |
| 211 | 212 |
| 212 | 213 |
| OLD | NEW |