| 106 | } |
| 107 | |
| 108 | void MandelbrotWidget::initializeGL() |
| 109 | { |
| 110 | // setup opengl |
| 111 | glDisable(GL_LIGHTING); |
| 112 | |
| 113 | // create the OpenGL/OpenCL shared context |
| 114 | context_ = compute::opengl_create_shared_context(); |
| 115 | |
| 116 | // get gpu device |
| 117 | compute::device gpu = context_.get_device(); |
| 118 | std::cout << "device: " << gpu.name() << std::endl; |
| 119 | |
| 120 | // setup command queue |
| 121 | queue_ = compute::command_queue(context_, gpu); |
| 122 | |
| 123 | // build mandelbrot program |
| 124 | program_ = compute::program::create_with_source(source, context_); |
| 125 | program_.build(); |
| 126 | } |
| 127 | |
| 128 | void MandelbrotWidget::resizeGL(int width, int height) |
| 129 | { |
nothing calls this directly
no test coverage detected