rem: if ((buffer = glgfx_bitmap_lock(bitmap, false, true)) != NULL) {
add: if ((buffer = glgfx_bitmap_lock(bitmap, false, true, glgfx_tag_end)) != NULL) {
context: bool blit(struct glgfx_bitmap* bitmap, int width, int height) {  uint16_t* buffer;    struct glgfx_context* ctx = glgfx_context_create(glgfx_monitors[0]);  // Fill texture with data  if ((buffer = glgfx_bitmap_lock(bitmap, false, true)) != NULL) {    int x, y;    for (y = 0; y < height; y += 1) {      for (x = 0; x < width; x += 1) {	buffer[x+y*width] = glgfx_pixel_create_r5g6b5(y*31/height, 0, x*31/width);      }    }    if (glgfx_bitmap_unlock(bitmap, 0, 0, width, height)) {      printf("updated\n");    }  }  // Clear the PBO buffer  if ((buffer = glgfx_bitmap_lock(bitmap, true, false)) != NULL) {    bzero(buffer, width*height*2);    glgfx_bitmap_unlock(bitmap, 0, 0, width, height);  }  // Read texture, modify 100x100 pixels of it and upload 200x200 pixels  if ((buffer = glgfx_bitmap_lock(bitmap, true, true)) != NULL) {    int x, y;    for (y = 0; y < 100; y += 1) {      for (x = 0; x < 100; x += 1) {	buffer[x+y*width] = glgfx_pixel_create_r5g6b5((100-y)*31/100, 0, x*31/100);      }    }    if (glgfx_bitmap_unlock(bitmap, 0, 0, 200, 200)) {      printf("updated 2\n");    }  }  int i;  for (i = 0; i < 100000; ++i) {    glgfx_bitmap_blit(bitmap,		      glgfx_bitmap_blit_x,       0,		      glgfx_bitmap_blit_y,       0,		      glgfx_bitmap_blit_width,   100,		      glgfx_bitmap_blit_height,  100,		      glgfx_bitmap_blit_dst_x,   100+i/1000*10,		      glgfx_bitmap_blit_dst_y,   100+i/1000,		      glgfx_bitmap_blit_minterm, 0x30, // inverted source		      glgfx_tag_end);  }  sleep(3);  printf("going home\n");  glgfx_context_destroy(ctx);  //  while(true);  return true;}