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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 52 } |
53 | 53 |
54 bool GLES2Demo::Setup(void* hwnd, int32 size) { | 54 bool GLES2Demo::Setup(void* hwnd, int32 size) { |
55 scoped_ptr<CommandBufferService> command_buffer(new CommandBufferService); | 55 scoped_ptr<CommandBufferService> command_buffer(new CommandBufferService); |
56 if (!command_buffer->Initialize(size)) | 56 if (!command_buffer->Initialize(size)) |
57 return NULL; | 57 return NULL; |
58 | 58 |
59 GPUProcessor* gpu_processor = new GPUProcessor(command_buffer.get(), NULL); | 59 GPUProcessor* gpu_processor = new GPUProcessor(command_buffer.get(), NULL); |
60 if (!gpu_processor->Initialize(reinterpret_cast<HWND>(hwnd), | 60 if (!gpu_processor->Initialize(reinterpret_cast<HWND>(hwnd), |
61 gfx::Size(), | 61 gfx::Size(), |
| 62 gpu::gles2::DisallowedExtensions(), |
62 NULL, | 63 NULL, |
63 std::vector<int32>(), | 64 std::vector<int32>(), |
64 NULL, | 65 NULL, |
65 0)) { | 66 0)) { |
66 return NULL; | 67 return NULL; |
67 } | 68 } |
68 | 69 |
69 command_buffer->SetPutOffsetChangeCallback( | 70 command_buffer->SetPutOffsetChangeCallback( |
70 NewCallback(gpu_processor, &GPUProcessor::ProcessCommands)); | 71 NewCallback(gpu_processor, &GPUProcessor::ProcessCommands)); |
71 | 72 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 ::fprintf(stdout, "Could not setup window.\n"); | 221 ::fprintf(stdout, "Could not setup window.\n"); |
221 return EXIT_FAILURE; | 222 return EXIT_FAILURE; |
222 } | 223 } |
223 | 224 |
224 demo->Setup(hwnd, kCommandBufferSize); | 225 demo->Setup(hwnd, kCommandBufferSize); |
225 | 226 |
226 ProcessMessages(hwnd); | 227 ProcessMessages(hwnd); |
227 | 228 |
228 return EXIT_SUCCESS; | 229 return EXIT_SUCCESS; |
229 } | 230 } |
OLD | NEW |