19682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/*
29682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    SDL - Simple DirectMedia Layer
39682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Copyright (C) 1997-2012 Sam Lantinga
49682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Copyright (C) 2001  Hsieh-Fu Tsai
59682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
69682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    This library is free software; you can redistribute it and/or
79682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    modify it under the terms of the GNU Library General Public
89682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    License as published by the Free Software Foundation; either
99682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    version 2 of the License, or (at your option) any later version.
109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    This library is distributed in the hope that it will be useful,
129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    but WITHOUT ANY WARRANTY; without even the implied warranty of
139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Library General Public License for more details.
159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    You should have received a copy of the GNU Library General Public
179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    License along with this library; if not, write to the Free
189682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
199682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
209682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Sam Lantinga
219682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    slouken@libsdl.org
229682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
239682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Hsieh-Fu Tsai
249682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    clare@setabox.com
259682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall*/
269682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "SDL_config.h"
279682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
289682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#ifndef _SDL_nxvideo_h
299682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define _SDL_nxvideo_h
309682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
319682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <microwin/nano-X.h>
329682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
339682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "../SDL_sysvideo.h"
349682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
359682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#ifdef ENABLE_NANOX_DEBUG
369682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define Dprintf printf
379682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#else
389682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define Dprintf(ignore...)
399682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif
409682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
419682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall// Hidden "this" pointer for the video functions
429682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define _THIS   SDL_VideoDevice * this
439682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
449682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall// Private display data
459682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Halltypedef struct NX_SDL_VISUAL {
469682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int    bpp ;
479682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Uint32 red_mask ;
489682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Uint32 green_mask ;
499682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Uint32 blue_mask ;
509682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} nx_sdl_visual_t ;
519682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
529682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallstruct SDL_PrivateVideoData {
539682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    GR_WINDOW_ID    SDL_Window ;
549682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    GR_WINDOW_ID    FSwindow ;
559682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    // Flag: true if we have been passed a window
569682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    char            * SDL_windowid ;
579682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    GR_GC_ID        GC ;
589682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    unsigned char   * Image ;
599682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    unsigned char   * Image_buff ;	/* for GrArea*/
609682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    unsigned char   * Clientfb;		/* for DirectFB*/
619682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    nx_sdl_visual_t SDL_Visual ;
629682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    // The current list of available video modes
639682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    SDL_Rect        ** modelist ;
649682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int             currently_fullscreen ;
659682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    // for fullscreen
669682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int             OffsetX, OffsetY ;
679682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    // for GammaRamp
689682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Uint16          * GammaRamp_R, * GammaRamp_G, * GammaRamp_B ;
699682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    // for GrArea, r_mask, g_mask, b_mask
709682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int             pixel_type ;
719682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#ifdef ENABLE_NANOX_DIRECT_FB
729682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    GR_WINDOW_FB_INFO fbinfo;
739682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif
749682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} ;
759682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
769682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_Window           (this -> hidden -> SDL_Window)
779682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define FSwindow             (this -> hidden -> FSwindow)
789682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_windowid         (this -> hidden -> SDL_windowid)
799682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_GC               (this -> hidden -> GC)
809682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_Image            (this -> hidden -> Image)
819682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define Image_buff           (this -> hidden -> Image_buff)
829682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define Clientfb             (this -> hidden -> Clientfb)
839682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_Visual           (this -> hidden -> SDL_Visual)
849682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_modelist         (this -> hidden -> modelist)
859682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define currently_fullscreen (this -> hidden -> currently_fullscreen)
869682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define OffsetX              (this -> hidden -> OffsetX)
879682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define OffsetY              (this -> hidden -> OffsetY)
889682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define GammaRamp_R          (this -> hidden -> GammaRamp_R)
899682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define GammaRamp_G          (this -> hidden -> GammaRamp_G)
909682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define GammaRamp_B          (this -> hidden -> GammaRamp_B)
919682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define pixel_type           (this -> hidden -> pixel_type)
929682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define fbinfo               (this -> hidden -> fbinfo)
939682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
949682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define CI_SIZE 256   // color index size
959682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
969682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif  // _SDL_nxvideo_h
97