2 * $Id: video.c,v 1.3 2006-01-03 12:21:45 nkeynes Exp $
4 * The PC side of the video support (responsible for actually displaying /
7 * Copyright (c) 2005 Nathan Keynes.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
25 GtkWidget *video_area;
27 uint32_t video_width = 640;
28 uint32_t video_height = 480;
29 uint32_t video_frame_count = 0;
31 void video_open( void )
33 img = gdk_image_new( GDK_IMAGE_FASTEST, gdk_visual_get_system(),
35 video_win = GTK_WINDOW(gtk_window_new( GTK_WINDOW_TOPLEVEL ));
36 video_area = gtk_image_new_from_image(img, NULL);
37 gtk_widget_show( video_area );
38 gtk_container_add( GTK_CONTAINER(video_win), video_area );
39 video_data = img->mem;
41 gtk_window_set_title( video_win, "DreamOn! - Emulation Window" );
42 gtk_window_set_policy( video_win, FALSE, FALSE, FALSE );
43 gtk_window_set_default_size( video_win, 640, 480 );
45 gtk_widget_show( GTK_WIDGET(video_win) );
49 * Fill the entire frame with the specified colour (00RRGGBB)
51 void video_fill( uint32_t colour )
55 for( i=0; i<video_width*video_height; i++ ) {
56 *p++ = (colour>>16) & 0xFF;
57 *p++ = (colour>>8) & 0xFF;
58 *p++ = (colour) & 0xFF;
62 void video_update_frame( void )
65 gtk_widget_queue_draw( video_area );
68 void video_update_size( int hres, int vres, int colmode )
70 /* do something intelligent */
.