It is technically allowed to use GL_RGBA as internal format,
but then it is undefined whether you get 4-bit, 8-bit, 10-bit
or something else. Set it explicitly. (Since we give in a NULL
pointer, we can give whatever external format we want; just
hardcode it to GL_RGBA.)
}
glBindTexture( GL_TEXTURE_2D, tex );
}
glBindTexture( GL_TEXTURE_2D, tex );
- glTexImage2D( GL_TEXTURE_2D, 0, internal_format, width, height, 0, internal_format, GL_UNSIGNED_BYTE, NULL );
+ glTexImage2D( GL_TEXTURE_2D, 0, internal_format, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
{
glsl_fbo fbo = get_fbo( width, height );
if (!fbo) return 1;
{
glsl_fbo fbo = get_fbo( width, height );
if (!fbo) return 1;
- glsl_texture texture = get_texture( width, height, GL_RGBA );
+ glsl_texture texture = get_texture( width, height, GL_RGBA8 );
if (!texture) {
release_fbo( fbo );
return 1;
if (!texture) {
release_fbo( fbo );
return 1;
{
glsl_fbo fbo = get_fbo( width, height );
if (!fbo) return 1;
{
glsl_fbo fbo = get_fbo( width, height );
if (!fbo) return 1;
- glsl_texture texture = get_texture( width, height, GL_RGBA );
+ glsl_texture texture = get_texture( width, height, GL_RGBA8 );
if (!texture) {
release_fbo( fbo );
return 1;
if (!texture) {
release_fbo( fbo );
return 1;