iOS/buildlibs/armv7/allegro-4.4.2/addons/allegrogl/src/win.c
/* Describes the pixel format and assigns it a score */
Describes the pixel format and assigns it a score
Describes the pixel format and assigns it a score
int describe_pixel_format_old(HDC dc, int fmt, int desktop_depth,
                               format_t *formats, int *num_formats,
                               struct allegro_gl_display_info *pdinfo) {
	struct allegro_gl_display_info dinfo;
	PIXELFORMATDESCRIPTOR pfd;
	int score = -1;
	int result = DescribePixelFormat(dc, fmt, sizeof(pfd), &pfd);
	if (pdinfo) {
		dinfo = *pdinfo;
	}
	if (!result) {
		log_win32_warning("describe_pixel_format_old",
		                  "DescribePixelFormat() failed!", GetLastError());
		return -1;
	}
	result = !decode_pixel_format(&pfd, dc, fmt, &dinfo, desktop_depth);
	if (result) {
		print_pixel_format(&dinfo);
		score = __allegro_gl_score_config(fmt, &dinfo);
	}
	if (score < 0) {
		return -1; 
	}
	if (formats && num_formats) {
		formats[*num_formats].score  = score;
		formats[*num_formats].format = fmt;
		(*num_formats)++;
	}
	if (pdinfo) {
		*pdinfo = dinfo;
	}
	return 0;
}
int describe_pixel_format_old ( HDC dc , int fmt , int desktop_depth , format_t * formats , int * num_formats , struct allegro_gl_display_info * pdinfo ) { struct allegro_gl_display_info dinfo ; PIXELFORMATDESCRIPTOR pfd ; int score = -1 ; int result = DescribePixelFormat ( dc , fmt , sizeof ( pfd ) , & pfd ) ; if ( pdinfo ) { dinfo = * pdinfo ; } if ( ! result ) { log_win32_warning ( " " , " " , GetLastError ( ) ) ; return -1 ; } result = ! decode_pixel_format ( & pfd , dc , fmt , & dinfo , desktop_depth ) ; if ( result ) { print_pixel_format ( & dinfo ) ; score = __allegro_gl_score_config ( fmt , & dinfo ) ; } if ( score < 0 ) { return -1 ; } if ( formats && num_formats ) { formats [ * num_formats ] . score = score ; formats [ * num_formats ] . format = fmt ; ( * num_formats ) ++ ; } if ( pdinfo ) { * pdinfo = dinfo ; } return 0 ; }
Describes the pixel format and assigns it a score
Describes the pixel format and assigns it a score
/* Remember old settings */ /* Reject non-compliant pixel formats */