X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=ycbcr_input.cpp;h=2a67ea7158f483cee4a8f25c7bc233df6beab83f;hp=e089e512d5b7961f88159a3db23e9aa89259943e;hb=ecab6f3b08bc0a995dd96542758031f1ba2c6a27;hpb=9cf78e3b5a801b7841133011f74fc7962861705d diff --git a/ycbcr_input.cpp b/ycbcr_input.cpp index e089e51..2a67ea7 100644 --- a/ycbcr_input.cpp +++ b/ycbcr_input.cpp @@ -87,25 +87,22 @@ YCbCrInput::YCbCrInput(const ImageFormat &image_format, YCbCrInput::~YCbCrInput() { - if (texture_num[0] != 0) { - glDeleteTextures(3, texture_num); - check_error(); + for (unsigned channel = 0; channel < 3; ++channel) { + if (texture_num[channel] != 0) { + resource_pool->release_2d_texture(texture_num[channel]); + } } } void YCbCrInput::finalize() { // Create the textures themselves. - glGenTextures(3, texture_num); - check_error(); - for (unsigned channel = 0; channel < 3; ++channel) { + texture_num[channel] = resource_pool->create_2d_texture(GL_LUMINANCE8, widths[channel], heights[channel]); glBindTexture(GL_TEXTURE_2D, texture_num[channel]); check_error(); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); check_error(); - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE8, widths[channel], heights[channel], 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, NULL); - check_error(); } needs_update = true;