add: return bitmap->locked;
context: bool glgfx_bitmap_lock(struct glgfx_bitmap* bitmap, bool read, bool write) {  GLenum usage;  GLenum access;    if (bitmap == NULL) {    return false;  }  if (read) {    BUG("No EXT_framebuffer_object yet!\n");  }    if (read && write) {    usage = GL_STREAM_COPY_ARB;    access = READ_WRITE_ARB;  }  else if (!read && write) {    usage = GL_STREAM_DRAW_ARB;    access = WRITE_ONLY_ARB;  }  else {    usage = GL_STATIC_READ_ARB;    access = READ_ONLY_ARB;  }  if (bitmap->pbo == 0) {    glGenBuffers(1, &bitmap->pbo);    check_error();    glBindBuffer(GL_PIXEL_UNPACK_BUFFER_EXT, bitmap->pbo);    check_error();    glBufferData(GL_PIXEL_UNPACK_BUFFER_EXT, bitmap->size, NULL, usage);    check_error();    glBindBuffer(GL_PIXEL_UNPACK_BUFFER_EXT, 0);  }  if (read) {    glBindBuffer(GL_PIXEL_PACK_BUFFER_EXT, bitmap->pbo);    // Read texture data into buffer here    glBindBuffer(GL_PIXEL_PACK_BUFFER_EXT, 0);  }  glBindBuffer(GL_PIXEL_UNPACK_BUFFER_EXT, bitmap->pbo);  bitmap->locked_memory = glMapBuffer(GL_PIXEL_UNPACK_BUFFER_EXT, access);  if (bitmap->locked_memory != NULL) {    bitmap->locked = true;    bitmap->locked_write = write;  }}