Search
lxdream.org :: lxdream/src/video.c
lxdream 0.9.1
released Jun 29
Download Now
filename src/video.c
changeset 31:495e480360d7
prev1:eea311cfd33e
next65:9f124c245fc6
author nkeynes
date Sun Dec 25 08:24:11 2005 +0000 (14 years ago)
permissions -rw-r--r--
last change Finish adding header blocks to all files
file annotate diff log raw
nkeynes@31
     1
/**
nkeynes@31
     2
 * $Id: video.c,v 1.2 2005-12-25 08:24:07 nkeynes Exp $
nkeynes@31
     3
 *
nkeynes@31
     4
 * The PC side of the video support (responsible for actually displaying / 
nkeynes@31
     5
 * rendering frames)
nkeynes@31
     6
 *
nkeynes@31
     7
 * Copyright (c) 2005 Nathan Keynes.
nkeynes@31
     8
 *
nkeynes@31
     9
 * This program is free software; you can redistribute it and/or modify
nkeynes@31
    10
 * it under the terms of the GNU General Public License as published by
nkeynes@31
    11
 * the Free Software Foundation; either version 2 of the License, or
nkeynes@31
    12
 * (at your option) any later version.
nkeynes@31
    13
 *
nkeynes@31
    14
 * This program is distributed in the hope that it will be useful,
nkeynes@31
    15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
nkeynes@31
    16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
nkeynes@31
    17
 * GNU General Public License for more details.
nkeynes@31
    18
 */
nkeynes@31
    19
nkeynes@1
    20
#include <gnome.h>
nkeynes@1
    21
nkeynes@1
    22
GdkImage *img;
nkeynes@1
    23
GtkWindow *video_win;
nkeynes@1
    24
GtkWidget *video_area;
nkeynes@1
    25
char *video_data;
nkeynes@1
    26
nkeynes@1
    27
void video_open( void )
nkeynes@1
    28
{
nkeynes@1
    29
    img = gdk_image_new( GDK_IMAGE_FASTEST, gdk_visual_get_system(),
nkeynes@1
    30
                         640, 480 );
nkeynes@1
    31
    video_win = GTK_WINDOW(gtk_window_new( GTK_WINDOW_TOPLEVEL ));
nkeynes@1
    32
    video_area = gtk_image_new_from_image(img, NULL);
nkeynes@1
    33
    gtk_widget_show( video_area );
nkeynes@1
    34
    gtk_container_add( GTK_CONTAINER(video_win), video_area );
nkeynes@1
    35
    video_data = img->mem;
nkeynes@1
    36
    
nkeynes@1
    37
    gtk_window_set_title( video_win, "DreamOn! - Emulation Window" );
nkeynes@1
    38
    gtk_window_set_policy( video_win, FALSE, FALSE, FALSE );
nkeynes@1
    39
    gtk_window_set_default_size( video_win, 640, 480 );
nkeynes@1
    40
    
nkeynes@1
    41
    gtk_widget_show( GTK_WIDGET(video_win) );
nkeynes@1
    42
}
nkeynes@1
    43
nkeynes@1
    44
void video_update_frame( void )
nkeynes@1
    45
{
nkeynes@1
    46
    gtk_widget_queue_draw( video_area );
nkeynes@1
    47
}
nkeynes@1
    48
nkeynes@1
    49
void video_update_size( int hres, int vres, int colmode )
nkeynes@1
    50
{
nkeynes@1
    51
    /* do something intelligent */
nkeynes@1
    52
}
.