Search
lxdream.org :: lxdream/src/drivers/video_gtk.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/video_gtk.c
changeset 103:9b9cfc5855e0
prev94:8d80d9c7cc7d
next106:9048bac046c3
author nkeynes
date Mon Mar 13 12:39:07 2006 +0000 (13 years ago)
permissions -rw-r--r--
last change More rendering work in progress. Almost there now...
file annotate diff log raw
1.1 --- a/src/drivers/video_gtk.c Sun Feb 05 04:05:27 2006 +0000
1.2 +++ b/src/drivers/video_gtk.c Mon Mar 13 12:39:07 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: video_gtk.c,v 1.1 2006-02-05 04:05:27 nkeynes Exp $
1.6 + * $Id: video_gtk.c,v 1.2 2006-03-13 12:39:07 nkeynes Exp $
1.7 *
1.8 * The PC side of the video support (responsible for actually displaying /
1.9 * rendering frames)
1.10 @@ -35,9 +35,14 @@
1.11 gboolean video_gtk_display_frame( video_buffer_t frame );
1.12 gboolean video_gtk_blank( uint32_t rgb );
1.13
1.14 -struct video_driver video_gtk_driver = { "Gtk", video_gtk_set_output_format,
1.15 +struct video_driver video_gtk_driver = { "Gtk",
1.16 + NULL,
1.17 + NULL,
1.18 + video_gtk_set_output_format,
1.19 + NULL,
1.20 video_gtk_display_frame,
1.21 - video_gtk_blank };
1.22 + video_gtk_blank,
1.23 + NULL };
1.24
1.25 gboolean video_gtk_set_output_format( uint32_t width, uint32_t height,
1.26 int colour_format )
1.27 @@ -90,10 +95,10 @@
1.28 char *dest = video_img->mem;
1.29
1.30 switch( frame->colour_format ) {
1.31 - case COLFMT_RGB15:
1.32 + case COLFMT_ARGB1555:
1.33 for( y=0; y < frame->vres; y++ ) {
1.34 uint16_t *p = (uint16_t *)src;
1.35 - for( x=0; x < frame->vres; x++ ) {
1.36 + for( x=0; x < frame->hres; x++ ) {
1.37 uint16_t pixel = *p++;
1.38 *dest++ = (pixel & 0x1F) << 3;
1.39 *dest++ = (pixel & 0x3E0) >> 2;
1.40 @@ -103,10 +108,10 @@
1.41 src += frame->rowstride;
1.42 }
1.43 break;
1.44 - case COLFMT_RGB16:
1.45 + case COLFMT_RGB565:
1.46 for( y=0; y < frame->vres; y++ ) {
1.47 uint16_t *p = (uint16_t *)src;
1.48 - for( x=0; x < frame->vres; x++ ) {
1.49 + for( x=0; x < frame->hres; x++ ) {
1.50 uint16_t pixel = *p++;
1.51 *dest++ = (pixel & 0x1F) << 3;
1.52 *dest++ = (pixel & 0x7E0) >> 3;
1.53 @@ -116,7 +121,19 @@
1.54 src += frame->rowstride;
1.55 }
1.56 break;
1.57 - case COLFMT_RGB32:
1.58 + case COLFMT_RGB888:
1.59 + for( y=0; y< frame->vres; y++ ) {
1.60 + char *p = src;
1.61 + for( x=0; x < frame->hres; x++ ) {
1.62 + *dest++ = *p++;
1.63 + *dest++ = *p++;
1.64 + *dest++ = *p++;
1.65 + *dest++ = 0;
1.66 + }
1.67 + src += frame->rowstride;
1.68 + }
1.69 + break;
1.70 + case COLFMT_ARGB8888:
1.71 bytes_per_line = frame->hres << 2;
1.72 if( bytes_per_line == frame->rowstride ) {
1.73 /* A little bit faster */
.