src/video/nanox/SDL_nxvideo.h
author Ryan C. Gordon <icculus@icculus.org>
Fri, 06 Jan 2006 13:20:10 +0000
changeset 1234 73676c1f56ee
parent 769 b8d311d90021
child 1361 19418e4422cb
permissions -rw-r--r--
For sanity's sake, removed the '&' when passing copy_row array to asm.
slouken@30
     1
/*
slouken@30
     2
    SDL - Simple DirectMedia Layer
slouken@769
     3
    Copyright (C) 1997-2004 Sam Lantinga
slouken@30
     4
    Copyright (C) 2001  Hsieh-Fu Tsai
slouken@30
     5
slouken@30
     6
    This library is free software; you can redistribute it and/or
slouken@30
     7
    modify it under the terms of the GNU Library General Public
slouken@30
     8
    License as published by the Free Software Foundation; either
slouken@30
     9
    version 2 of the License, or (at your option) any later version.
slouken@30
    10
slouken@30
    11
    This library is distributed in the hope that it will be useful,
slouken@30
    12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@30
    13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@30
    14
    Library General Public License for more details.
slouken@30
    15
slouken@30
    16
    You should have received a copy of the GNU Library General Public
slouken@30
    17
    License along with this library; if not, write to the Free
slouken@30
    18
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
slouken@30
    19
slouken@30
    20
    Sam Lantinga
slouken@252
    21
    slouken@libsdl.org
slouken@30
    22
    
slouken@30
    23
    Hsieh-Fu Tsai
slouken@30
    24
    clare@setabox.com
slouken@30
    25
*/
slouken@30
    26
slouken@30
    27
#ifndef _SDL_nxvideo_h
slouken@30
    28
#define _SDL_nxvideo_h
slouken@30
    29
slouken@30
    30
#include <microwin/nano-X.h>
slouken@30
    31
slouken@30
    32
#include "SDL_sysvideo.h"
slouken@30
    33
slouken@30
    34
#ifdef ENABLE_NANOX_DEBUG
slouken@30
    35
#define Dprintf printf
slouken@30
    36
#else
slouken@30
    37
#define Dprintf(ignore...)
slouken@30
    38
#endif
slouken@30
    39
slouken@30
    40
// Hidden "this" pointer for the video functions
slouken@30
    41
#define _THIS   SDL_VideoDevice * this
slouken@30
    42
slouken@30
    43
// Private display data
slouken@30
    44
typedef struct NX_SDL_VISUAL {
slouken@30
    45
    int    bpp ;
slouken@30
    46
    Uint32 red_mask ;
slouken@30
    47
    Uint32 green_mask ;
slouken@30
    48
    Uint32 blue_mask ;
slouken@30
    49
} nx_sdl_visual_t ;
slouken@30
    50
slouken@30
    51
struct SDL_PrivateVideoData {
slouken@30
    52
    GR_WINDOW_ID    SDL_Window ;
slouken@30
    53
    GR_WINDOW_ID    FSwindow ;
slouken@30
    54
    // Flag: true if we have been passed a window
slouken@30
    55
    char            * SDL_windowid ;
slouken@30
    56
    GR_GC_ID        GC ;
slouken@30
    57
    unsigned char   * Image ;
slouken@471
    58
    unsigned char   * Image_buff ;	/* for GrArea*/
slouken@471
    59
    unsigned char   * Clientfb;		/* for DirectFB*/
slouken@30
    60
    nx_sdl_visual_t SDL_Visual ;
slouken@30
    61
    // The current list of available video modes
slouken@30
    62
    SDL_Rect        ** modelist ;
slouken@30
    63
    int             currently_fullscreen ;
slouken@30
    64
    // for fullscreen
slouken@30
    65
    int             OffsetX, OffsetY ;
slouken@30
    66
    // for GammaRamp
slouken@30
    67
    Uint16          * GammaRamp_R, * GammaRamp_G, * GammaRamp_B ;
slouken@30
    68
    // for GrArea, r_mask, g_mask, b_mask
slouken@30
    69
    int             pixel_type ;
slouken@471
    70
#ifdef ENABLE_NANOX_DIRECT_FB
slouken@471
    71
    GR_WINDOW_FB_INFO fbinfo;
slouken@471
    72
#endif
slouken@30
    73
} ;
slouken@30
    74
slouken@30
    75
#define SDL_Window           (this -> hidden -> SDL_Window)
slouken@30
    76
#define FSwindow             (this -> hidden -> FSwindow)
slouken@30
    77
#define SDL_windowid         (this -> hidden -> SDL_windowid)
slouken@30
    78
#define SDL_GC               (this -> hidden -> GC)
slouken@30
    79
#define SDL_Image            (this -> hidden -> Image)
slouken@30
    80
#define Image_buff           (this -> hidden -> Image_buff)
slouken@471
    81
#define Clientfb             (this -> hidden -> Clientfb)
slouken@30
    82
#define SDL_Visual           (this -> hidden -> SDL_Visual)
slouken@30
    83
#define SDL_modelist         (this -> hidden -> modelist)
slouken@30
    84
#define currently_fullscreen (this -> hidden -> currently_fullscreen)
slouken@30
    85
#define OffsetX              (this -> hidden -> OffsetX)
slouken@30
    86
#define OffsetY              (this -> hidden -> OffsetY)
slouken@30
    87
#define GammaRamp_R          (this -> hidden -> GammaRamp_R)
slouken@30
    88
#define GammaRamp_G          (this -> hidden -> GammaRamp_G)
slouken@30
    89
#define GammaRamp_B          (this -> hidden -> GammaRamp_B)
slouken@30
    90
#define pixel_type           (this -> hidden -> pixel_type)
slouken@471
    91
#define fbinfo               (this -> hidden -> fbinfo)
slouken@30
    92
slouken@30
    93
#define CI_SIZE 256   // color index size
slouken@30
    94
slouken@30
    95
#endif  // _SDL_nxvideo_h