1.1 --- a/src/drivers/video_gl.c Mon Jul 14 07:44:42 2008 +0000
1.2 +++ b/src/drivers/video_gl.c Tue Oct 14 08:44:37 2008 +0000
1.4 gl_texture_window( buffer->width, buffer->height, buffer->buf_id, buffer->inverted );
1.8 + * Convert window coordinates to dreamcast device coords (640x480) using the
1.9 + * same viewable area as gl_texture_window.
1.10 + * If the coordinates are outside the viewable area, the result is -1,-1.
1.12 +void gl_window_to_system_coords( int *x, int *y )
1.14 + int x1=0,y1=0,x2=video_width,y2=video_height;
1.16 + int ah = video_width * 0.75;
1.18 + if( ah > video_height ) {
1.19 + int w = (video_height/0.75);
1.20 + x1 = (video_width - w)/2;
1.22 + } else if( ah < video_height ) {
1.23 + y1 = (video_height - ah)/2;
1.26 + if( *x < x1 || *x >= x2 || *y < y1 || *y >= y2 ) {
1.30 + *x = (*x - x1) * DISPLAY_WIDTH / (x2-x1);
1.31 + *y = (*y - y1) * DISPLAY_HEIGHT / (y2-y1);
1.35 void gl_texture_window( int width, int height, int tex_id, gboolean inverted )