Browse Source

Fix screenshots on gles1

> format must be either GL_RGBA or the value of GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES.
pull/2/head
Alexey 4 years ago committed by Alibek Omarov
parent
commit
221a9bab54
  1. 4
      ref_gl/gl_backend.c

4
ref_gl/gl_backend.c

@ -465,13 +465,13 @@ qboolean VID_ScreenShot( const char *filename, int shot_type ) @@ -465,13 +465,13 @@ qboolean VID_ScreenShot( const char *filename, int shot_type )
r_shot->width = (gpGlobals->width + 3) & ~3;
r_shot->height = (gpGlobals->height + 3) & ~3;
r_shot->flags = IMAGE_HAS_COLOR;
r_shot->type = PF_RGB_24;
r_shot->type = PF_RGBA_32;
r_shot->size = r_shot->width * r_shot->height * gEngfuncs.Image_GetPFDesc( r_shot->type )->bpp;
r_shot->palette = NULL;
r_shot->buffer = Mem_Malloc( r_temppool, r_shot->size );
// get screen frame
pglReadPixels( 0, 0, r_shot->width, r_shot->height, GL_RGB, GL_UNSIGNED_BYTE, r_shot->buffer );
pglReadPixels( 0, 0, r_shot->width, r_shot->height, GL_RGBA, GL_UNSIGNED_BYTE, r_shot->buffer );
switch( shot_type )
{

Loading…
Cancel
Save