Ejemplo n.º 1
0
GPUTexture *wm_draw_region_texture(ARegion *ar, int view)
{
  if (!ar->draw_buffer) {
    return NULL;
  }

  if (ar->draw_buffer->viewport[view]) {
    return GPU_viewport_color_texture(ar->draw_buffer->viewport[view]);
  }
  else {
    return GPU_offscreen_color_texture(ar->draw_buffer->offscreen[view]);
  }
}
Ejemplo n.º 2
0
static void wm_draw_offscreen_texture_parameters(GPUOffScreen *offscreen)
{
  /* Setup offscreen color texture for drawing. */
  GPUTexture *texture = GPU_offscreen_color_texture(offscreen);

  /* We don't support multisample textures here. */
  BLI_assert(GPU_texture_target(texture) == GL_TEXTURE_2D);

  glBindTexture(GL_TEXTURE_2D, GPU_texture_opengl_bindcode(texture));

  /* No mipmaps or filtering. */
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
  /* GL_TEXTURE_BASE_LEVEL = 0 by default */
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

  glBindTexture(GL_TEXTURE_2D, 0);
}
Ejemplo n.º 3
0
static PyObject *bpygpu_offscreen_color_texture_get(BPyGPUOffScreen *self, void *UNUSED(type))
{
  BPY_GPU_OFFSCREEN_CHECK_OBJ(self);
  GPUTexture *texture = GPU_offscreen_color_texture(self->ofs);
  return PyLong_FromLong(GPU_texture_opengl_bindcode(texture));
}
Ejemplo n.º 4
0
static PyObject *pygpu_offscreen_color_texture_get(BPy_GPUOffScreen *self, void *UNUSED(type))
{
    BPY_GPU_OFFSCREEN_CHECK_OBJ(self);
    return PyLong_FromLong(GPU_offscreen_color_texture(self->ofs));
}