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