src/video/ps2gs/SDL_gsvideo.h
author Sam Lantinga <slouken@libsdl.org>
Tue, 15 Dec 2009 08:11:06 +0000
changeset 3565 f43c8f688f77
parent 2859 99210400e8b9
permissions -rw-r--r--
Fixed bug #906

Added better error reporting for OpenGL context creation failing.
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2009 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 #include "SDL_config.h"
    23 
    24 #ifndef _SDL_gsvideo_h
    25 #define _SDL_gsvideo_h
    26 
    27 #include <sys/types.h>
    28 #include <termios.h>
    29 #include <linux/ps2/dev.h>
    30 #include <linux/ps2/gs.h>
    31 
    32 #include "SDL_mouse.h"
    33 #include "SDL_mutex.h"
    34 #include "../SDL_sysvideo.h"
    35 
    36 /* Hidden "this" pointer for the video functions */
    37 #define _THIS	SDL_VideoDevice *this
    38 
    39 
    40 /* Private display data */
    41 struct SDL_PrivateVideoData
    42 {
    43     /* Gotta love that simple PS2 graphics interface. :) */
    44     int console_fd;
    45     int memory_fd;
    46     struct ps2_screeninfo saved_vinfo;
    47 
    48     /* Ye olde linux keyboard code */
    49     int current_vt;
    50     int saved_vt;
    51     int keyboard_fd;
    52     int saved_kbd_mode;
    53     struct termios saved_kbd_termios;
    54 
    55     /* Ye olde linux mouse code */
    56     int mouse_fd;
    57     int cursor_drawn;
    58 
    59     /* The memory mapped DMA area and associated variables */
    60     caddr_t mapped_mem;
    61     int pixels_len;
    62     int mapped_len;
    63     struct ps2_image screen_image;
    64     int screen_image_size;
    65     unsigned long long *head_tags_mem;
    66     unsigned long long *image_tags_mem;
    67     unsigned long long *tex_tags_mem;
    68     unsigned long long *scale_tags_mem;
    69     int dma_pending;
    70 };
    71 /* Old variable names */
    72 #define console_fd		(this->hidden->console_fd)
    73 #define memory_fd		(this->hidden->memory_fd)
    74 #define saved_vinfo		(this->hidden->saved_vinfo)
    75 #define current_vt		(this->hidden->current_vt)
    76 #define saved_vt		(this->hidden->saved_vt)
    77 #define keyboard_fd		(this->hidden->keyboard_fd)
    78 #define saved_kbd_mode		(this->hidden->saved_kbd_mode)
    79 #define saved_kbd_termios	(this->hidden->saved_kbd_termios)
    80 #define mouse_fd		(this->hidden->mouse_fd)
    81 #define cursor_drawn		(this->hidden->cursor_drawn)
    82 #define mapped_mem		(this->hidden->mapped_mem)
    83 #define pixels_len		(this->hidden->pixels_len)
    84 #define mapped_len		(this->hidden->mapped_len)
    85 #define screen_image		(this->hidden->screen_image)
    86 #define screen_image_size	(this->hidden->screen_image_size)
    87 #define head_tags_mem		(this->hidden->head_tags_mem)
    88 #define image_tags_mem		(this->hidden->image_tags_mem)
    89 #define tex_tags_mem		(this->hidden->tex_tags_mem)
    90 #define scale_tags_mem		(this->hidden->scale_tags_mem)
    91 #define dma_pending		(this->hidden->dma_pending)
    92 
    93 /* Shared between the mouse and video code for screen update scaling */
    94 extern int scaleimage_nonblock(int fd,
    95                                unsigned long long *tm,
    96                                unsigned long long *sm);
    97 #endif /* _SDL_gsvideo_h */
    98 /* vi: set ts=4 sw=4 expandtab: */