# Part of output not visible when 2D drawing with OpenGL context

**URL:** <https://forum.juce.com/t/part-of-output-not-visible-when-2d-drawing-with-opengl-context/56547>\
**Category:** General JUCE discussion\
**Created:** [June 6, 2023, 10:41am UTC](https://forum.juce.com/t/part-of-output-not-visible-when-2d-drawing-with-opengl-context/56547 "2023-06-06T10:41:12Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![flavi0](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/flavi0/32/749_2.png) [@flavi0](https://forum.juce.com/u/flavi0)\
**Post date:** [June 20, 2023, 10:05am UTC](https://forum.juce.com/t/part-of-output-not-visible-when-2d-drawing-with-opengl-context/56547/5 "2023-06-20T10:05:20Z")

</div>

When I introduce a local scope to make sure the `gFBO` Graphics object’s lifetime ends before I draw the image, I get an invalid operation error from OpenGL.

```auto
GL_INVALID_OPERATION error generated. Target buffer must be bound and not overlapped with mapping range.

```

I updated the working example to include the different cases that I tried, see `GLComponent.cc:79` for the enum that switches between the drawing modes. Directly rendering to screen works, drawing into the Image with OpenGLImageType in two different ways behaves as described above (i.e. seeing the whole output only when using a transparency layer), drawing the image after the Graphics object lifetime ends leads to `GL_INVALID_OPERATION`.

---

_[View the full topic](https://forum.juce.com/t/part-of-output-not-visible-when-2d-drawing-with-opengl-context/56547)._
