Search
lxdream.org :: lxdream/src/video.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/video.c
changeset 65:9f124c245fc6
prev31:495e480360d7
author nkeynes
date Tue Jan 10 13:58:35 2006 +0000 (18 years ago)
permissions -rw-r--r--
last change Force redisasm when switching cpus
Handle emits when gui hasn't been created yet (dump to stderr)
file annotate diff log raw
1.1 --- a/src/video.c Sun Dec 25 08:24:11 2005 +0000
1.2 +++ b/src/video.c Tue Jan 10 13:58:35 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: video.c,v 1.2 2005-12-25 08:24:07 nkeynes Exp $
1.6 + * $Id: video.c,v 1.3 2006-01-03 12:21:45 nkeynes Exp $
1.7 *
1.8 * The PC side of the video support (responsible for actually displaying /
1.9 * rendering frames)
1.10 @@ -18,11 +18,15 @@
1.11 */
1.12
1.13 #include <gnome.h>
1.14 +#include <stdint.h>
1.15
1.16 GdkImage *img;
1.17 GtkWindow *video_win;
1.18 GtkWidget *video_area;
1.19 char *video_data;
1.20 +uint32_t video_width = 640;
1.21 +uint32_t video_height = 480;
1.22 +uint32_t video_frame_count = 0;
1.23
1.24 void video_open( void )
1.25 {
1.26 @@ -41,8 +45,23 @@
1.27 gtk_widget_show( GTK_WIDGET(video_win) );
1.28 }
1.29
1.30 +/**
1.31 + * Fill the entire frame with the specified colour (00RRGGBB)
1.32 + */
1.33 +void video_fill( uint32_t colour )
1.34 +{
1.35 + char *p = video_data;
1.36 + int i;
1.37 + for( i=0; i<video_width*video_height; i++ ) {
1.38 + *p++ = (colour>>16) & 0xFF;
1.39 + *p++ = (colour>>8) & 0xFF;
1.40 + *p++ = (colour) & 0xFF;
1.41 + }
1.42 +}
1.43 +
1.44 void video_update_frame( void )
1.45 {
1.46 + video_frame_count++;
1.47 gtk_widget_queue_draw( video_area );
1.48 }
1.49
.