! \class ImageGL * \brief general image interface for GL interop. * We abstract the 2D and 3D GL images into a single instance here * that wraps all GL sourced images on the grounds that setup information * was performed by OpenCL anyway. */
| 4422 | * was performed by OpenCL anyway. |
| 4423 | */ |
| 4424 | class ImageGL : public Image |
| 4425 | { |
| 4426 | public: |
| 4427 | ImageGL( |
| 4428 | const Context& context, |
| 4429 | cl_mem_flags flags, |
| 4430 | cl_GLenum target, |
| 4431 | cl_GLint miplevel, |
| 4432 | cl_GLuint texobj, |
| 4433 | cl_int * err = NULL) |
| 4434 | { |
| 4435 | cl_int error; |
| 4436 | object_ = ::clCreateFromGLTexture( |
| 4437 | context(), |
| 4438 | flags, |
| 4439 | target, |
| 4440 | miplevel, |
| 4441 | texobj, |
| 4442 | &error); |
| 4443 | |
| 4444 | detail::errHandler(error, __CREATE_GL_TEXTURE_ERR); |
| 4445 | if (err != NULL) { |
| 4446 | *err = error; |
| 4447 | } |
| 4448 | } |
| 4449 | |
| 4450 | ImageGL() : Image() { } |
| 4451 | |
| 4452 | __CL_EXPLICIT_CONSTRUCTORS ImageGL(const cl_mem& image) : Image(image) { } |
| 4453 | |
| 4454 | ImageGL& operator = (const cl_mem& rhs) |
| 4455 | { |
| 4456 | Image::operator=(rhs); |
| 4457 | return *this; |
| 4458 | } |
| 4459 | |
| 4460 | /*! \brief Copy constructor to forward copy to the superclass correctly. |
| 4461 | * Required for MSVC. |
| 4462 | */ |
| 4463 | ImageGL(const ImageGL& img) : Image(img) {} |
| 4464 | |
| 4465 | /*! \brief Copy assignment to forward copy to the superclass correctly. |
| 4466 | * Required for MSVC. |
| 4467 | */ |
| 4468 | ImageGL& operator = (const ImageGL &img) |
| 4469 | { |
| 4470 | Image::operator=(img); |
| 4471 | return *this; |
| 4472 | } |
| 4473 | |
| 4474 | #if defined(CL_HPP_RVALUE_REFERENCES_SUPPORTED) |
| 4475 | /*! \brief Move constructor to forward move to the superclass correctly. |
| 4476 | * Required for MSVC. |
| 4477 | */ |
| 4478 | ImageGL(ImageGL&& img) CL_HPP_NOEXCEPT : Image(std::move(img)) {} |
| 4479 | |
| 4480 | /*! \brief Move assignment to forward move to the superclass correctly. |
| 4481 | * Required for MSVC. |
nothing calls this directly
no outgoing calls
no test coverage detected