void invalidate_pixel_data();
+ // Note: Sets pitch to width, so even if your pitch is unchanged,
+ // you will need to re-set it after this call.
+ void set_width(unsigned width)
+ {
+ this->pitch = this->width = width;
+ invalidate_pixel_data();
+ }
+
+ void set_height(unsigned height)
+ {
+ this->height = height;
+ invalidate_pixel_data();
+ }
+
void set_pitch(unsigned pitch) {
this->pitch = pitch;
invalidate_pixel_data();
#elif defined(WIN32)
return (void *)wglGetCurrentContext();
#else
- void *ret = (void *)glXGetCurrentContext();
+ void *ret = (void *)eglGetCurrentContext();
if (ret != NULL) {
return ret;
}
- return (void *)eglGetCurrentContext();
+ return (void *)glXGetCurrentContext();
#endif
}
// changes, even within git versions. There is no specific version
// documentation outside the regular changelogs, though.
-#define MOVIT_VERSION 11
+#define MOVIT_VERSION 12
#endif // !defined(_MOVIT_VERSION_H)
pbos[0] = pbos[1] = pbos[2] = 0;
texture_num[0] = texture_num[1] = texture_num[2] = 0;
- assert(width % ycbcr_format.chroma_subsampling_x == 0);
- pitch[0] = widths[0] = width;
- pitch[1] = widths[1] = width / ycbcr_format.chroma_subsampling_x;
- pitch[2] = widths[2] = width / ycbcr_format.chroma_subsampling_x;
-
- assert(height % ycbcr_format.chroma_subsampling_y == 0);
- heights[0] = height;
- heights[1] = height / ycbcr_format.chroma_subsampling_y;
- heights[2] = height / ycbcr_format.chroma_subsampling_y;
+ set_width(width);
+ set_height(height);
pixel_data[0] = pixel_data[1] = pixel_data[2] = NULL;
owns_texture[0] = owns_texture[1] = owns_texture[2] = false;
void invalidate_pixel_data();
- void set_pitch(unsigned channel, unsigned pitch) {
+ // Note: Sets pitch to width, so even if your pitch is unchanged,
+ // you will need to re-set it after this call.
+ void set_width(unsigned width)
+ {
+ this->width = width;
+
+ assert(width % ycbcr_format.chroma_subsampling_x == 0);
+ pitch[0] = widths[0] = width;
+ pitch[1] = widths[1] = width / ycbcr_format.chroma_subsampling_x;
+ pitch[2] = widths[2] = width / ycbcr_format.chroma_subsampling_x;
+ invalidate_pixel_data();
+ }
+
+ void set_height(unsigned height)
+ {
+ this->height = height;
+
+ assert(height % ycbcr_format.chroma_subsampling_y == 0);
+ heights[0] = height;
+ heights[1] = height / ycbcr_format.chroma_subsampling_y;
+ heights[2] = height / ycbcr_format.chroma_subsampling_y;
+ invalidate_pixel_data();
+ }
+
+ void set_pitch(unsigned channel, unsigned pitch)
+ {
assert(channel >= 0 && channel < num_channels);
this->pitch[channel] = pitch;
invalidate_pixel_data();