Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

SAL.H

Go to the documentation of this file.
00001 /****************************************************************************************/
00002 /*  sal.h                                                                               */
00003 /*                                                                                      */
00004 /*  Description:  GDI dib handling code                                                 */
00005 /*                                                                                      */
00006 /*                Code fragments contributed by John Miles                              */
00007 /*                                                                                      */
00008 /*  The contents of this file are subject to the Genesis3D Public License               */
00009 /*  Version 1.01 (the "License"); you may not use this file except in                   */
00010 /*  compliance with the License. You may obtain a copy of the License at                */
00011 /*  http://www.genesis3d.com                                                            */
00012 /*                                                                                      */
00013 /*  Software distributed under the License is distributed on an "AS IS"                 */
00014 /*  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See                */
00015 /*  the License for the specific language governing rights and limitations              */
00016 /*  under the License.                                                                  */
00017 /*                                                                                      */
00018 /*  The Original Code is Genesis3D, released March 25, 1999.                            */
00019 /*  Genesis3D Version 1.1 released November 15, 1999                                 */
00020 /*  Copyright (C) 1999 WildTangent, Inc. All Rights Reserved           */
00021 /*                                                                                      */
00022 /****************************************************************************************/
00023 
00024 #ifndef SAL_VERSION
00025 
00026 #define SAL_VERSION      "1.00"
00027 #define SAL_VERSION_DATE "23-May-96"
00028 
00029 #endif
00030 
00031 #ifndef SAL_H
00032 #define SAL_H
00033 
00034 #ifdef WIN32
00035   #define IS_WIN32 1
00036 #endif
00037 
00038 #ifdef _WIN32
00039   #define IS_WIN32 1
00040 #endif
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00046 //
00047 // If compiling SAL library, use __declspec(dllexport) for both 
00048 // declarations and definitions
00049 //
00050 // If compiling SAL application, use __declspec(dllimport) for
00051 // declarations -- definitions don't matter
00052 //
00053 // (DOS, other system definitions to be added later)
00054 //
00055 /*
00056 #ifdef IS_WIN32
00057 
00058   #define SALEXPORT WINAPI
00059 
00060   #ifdef BUILD_SAL
00061     #define DXDEC __declspec(dllexport)
00062     #define DXDEF __declspec(dllexport)
00063   #else
00064     #define DXDEC __declspec(dllimport)
00065   #endif
00066 
00067 #else
00068 
00069   #define SALEXPORT
00070   #define WINAPI
00071 
00072 #endif
00073 */
00074 
00075 #define SALEXPORT WINAPI
00076 #define DXDEC 
00077 #define DXDEF 
00078 
00079 //
00080 // Misc. constant definitions  
00081 //
00082 
00083 //
00084 // General type definitions for portability
00085 // 
00086 
00087 #ifndef US_TYPEDEFS
00088 #define US_TYPEDEFS
00089 
00090   typedef unsigned char   U8 ;
00091   typedef unsigned short  U16;
00092   typedef unsigned long   U32;
00093   typedef          char   C8 ;
00094   typedef signed   char   S8 ;
00095   typedef signed   short  S16;
00096   typedef signed   long   S32;
00097 
00098 #endif
00099 
00100 #ifndef YES
00101 #define YES 1
00102 #endif
00103 
00104 #ifndef NO
00105 #define NO  0
00106 #endif
00107 
00108 #ifndef TRUE
00109 #define TRUE 1
00110 #endif
00111 
00112 #ifndef FALSE
00113 #define FALSE  0
00114 #endif
00115 
00116 #define SAL_FULLSCREEN     0               // Set fullscreen DDraw mode
00117 #define SAL_WINDOW         1               // Set DIB windowed mode
00118 #define SAL_TRY_FULLSCREEN 2               // Try fullscreen, fall back to DIB
00119 
00120 #define SAL_FRONT_SURFACE 0
00121 #define SAL_BACK_SURFACE  1
00122 
00123 //
00124 // Preference names and default values
00125 //
00126 
00127 #define SAL_ALLOW_FRONT_LOCK         0     // Disregard request for front surface lock
00128 #define DEFAULT_AFL                  NO
00129                                      
00130 #define SAL_BUFFER_IF_NO_LFB         1     // Use system RAM page buffer if no LFB available
00131 #define DEFAULT_BINL                 YES   
00132                                      
00133 #define SAL_DOS_MONO_DEBUG           2     // Set up monochrome TTY debug monitor for DOS
00134 #define DEFAULT_DMD                  YES
00135 
00136 #define SAL_MAX_VIDEO_PAGES          3     // Allocate up to 3 video pages if possible
00137 #define DEFAULT_MVP                  3     
00138 
00139 #define SAL_ALLOW_WINDOW_RESIZE      4     // Allow window to be resized
00140 #define DEFAULT_AWR                  YES
00141 
00142 #define SAL_PREVENT_ALT_MENU_POPUP   5     // Do not allow ALT to pause app
00143 #define DEFAULT_PAMP                 YES
00144 
00145 #define SAL_ALWAYS_ON_TOP            6     // App has normal window Z order
00146 #define DEFAULT_SAOT                 NO
00147 
00148 #define SAL_MAXIMIZE_TO_FULLSCREEN   7     // Maximize button switches to FS
00149 #define DEFAULT_MTF                  YES   
00150 
00151 #define N_SAL_PREFS                  8     // # of preference types
00152 
00153 //
00154 // Structures
00155 //
00156 
00157 typedef struct
00158 {
00159    U32 r;
00160    U32 g;
00161    U32 b;
00162    S32 alpha;
00163 }
00164 SAL_RGB32;
00165 
00166 typedef struct
00167 {
00168    S32 x0;
00169    S32 y0;
00170    S32 x1;
00171    S32 y1;
00172 }
00173 SAL_REGION;
00174 
00175 typedef struct
00176 {
00177    S32 x;
00178    S32 y;
00179    S32 width;
00180    S32 height;
00181 }
00182 SAL_WINAREA;
00183 
00184 //
00185 // Function pointer types
00186 //
00187 
00188 typedef void (SALEXPORT * SALFOCUSCB) (S32 status);
00189 typedef void (SALEXPORT * SALEXITCB) (void);
00190 
00191 //
00192 // Miscellaneous/support services (not system-specific)
00193 //
00194 
00195 DXDEC void __cdecl SAL_debug_printf          (char *fmt, ...);
00196 
00197 DXDEC  S32 WINAPI  SAL_get_preference        (U32   number);
00198                    
00199 DXDEC  S32 WINAPI  SAL_set_preference        (U32   number, 
00200                                               S32   value);
00201 
00202 //
00203 // General services (not system-specific)
00204 //
00205 
00206 DXDEC void WINAPI SAL_set_palette_entry      (S32        index,
00207                                               SAL_RGB32 *entry,
00208                                               S32        wait_flag);
00209                                              
00210 DXDEC void WINAPI SAL_get_palette_entry      (S32        index,
00211                                               SAL_RGB32 *entry);
00212 
00213 DXDEC void WINAPI SAL_set_palette_range      (S32        index,
00214                                               S32        num_entries,
00215                                               SAL_RGB32 *entry_list,
00216                                               S32        wait_flag);
00217                                              
00218 DXDEC void WINAPI SAL_get_palette_range      (S32        index,
00219                                               S32        num_entries,
00220                                               SAL_RGB32 *entry_list);
00221 
00222 DXDEC void WINAPI SAL_get_pixel_format       (S32       *pixel_pitch,
00223                                               S32       *bytes_per_pixel,
00224                                               S32       *R_shift,
00225                                               U32       *R_mask,
00226                                               S32       *R_width,
00227                                               S32       *G_shift,
00228                                               U32       *G_mask,
00229                                               S32       *G_width,
00230                                               S32       *B_shift,
00231                                               U32       *B_mask,
00232                                               S32       *B_width);
00233 
00234 
00235 DXDEC void WINAPI SAL_flip_surface           (void);
00236 DXDEF void WINAPI SAL_blit_surface                              (void);
00237 
00238 DXDEC void WINAPI SAL_wipe_surface           (S32        surface,
00239                                               U32        color);
00240 
00241 DXDEC void WINAPI SAL_lock_surface           (S32        surface,
00242                                               U8       **ptr,
00243                                               S32       *pitch);
00244 
00245 DXDEC void WINAPI SAL_release_surface        (S32        surface,
00246                                               S32        perform_flip);
00247 
00248 DXDEC void WINAPI SAL_lock_region            (S32        surface,
00249                                               SAL_REGION region,
00250                                               U8       **ptr,
00251                                               S32       *pitch);
00252 
00253 DXDEC void WINAPI SAL_release_region         (S32        surface,
00254                                               SAL_REGION region);
00255 
00256 //
00257 // Mouse services
00258 //
00259 
00260 DXDEC void WINAPI SAL_show_system_mouse      (void);
00261 DXDEC void WINAPI SAL_hide_system_mouse      (void);
00262 
00263 DXDEC void WINAPI SAL_constrain_mouse        (void);
00264 DXDEC void WINAPI SAL_unconstrain_mouse      (void);
00265 
00266 //
00267 // System-specific functions for Win32 version
00268 //
00269 
00270 #ifdef IS_WIN32
00271   
00272   DXDEC S32        WINAPI SAL_startup                 (BOOL FileLog);
00273   DXDEC void       WINAPI SAL_shutdown                (void);
00274 
00275   DXDEC BOOL WINAPI SAL_set_main_window(HWND hWindow);
00276   // CHANGE! (12/18/96)
00277   // Must have a menu in my app. 
00278   DXDEC HWND WINAPI SAL_create_main_window  (const char *MenuName);
00279                                                       
00280   DXDEC S32        WINAPI SAL_set_display_mode        (S32   display_size_X,
00281                                                        S32   display_size_Y,
00282                                                        S32   display_bpp,
00283                                                        S32   initial_window_mode,
00284                                                        S32   allow_mode_switch);
00285 
00286   DXDEC S32        WINAPI SAL_window_status           (void);
00287   DXDEC void       WINAPI SAL_window_area             (SAL_WINAREA *area);
00288   DXDEC void       WINAPI SAL_client_area             (SAL_WINAREA *area);
00289   DXDEC S32        WINAPI SAL_set_window_area         (SAL_WINAREA *area);
00290   DXDEC S32        WINAPI SAL_is_app_active           (void);
00291   DXDEC SALFOCUSCB WINAPI SAL_register_focus_callback (SALFOCUSCB fn);
00292   DXDEC WNDPROC    WINAPI SAL_register_WNDPROC        (WNDPROC fn);
00293 
00294   DXDEC void       WINAPI SAL_serve_message_queue     (void);
00295 
00296   DXDEC void      __cdecl SAL_error_box               (C8 *caption,
00297                                                        C8 *fmt, ...);
00298   // CHANGE! (12/18/96) John Pollard
00299   DXDEC void WINAPI SAL_GetBackBufferDC(HDC *dc);
00300   DXDEC void WINAPI SAL_ReleaseBackBufferDC(HDC dc);
00301 
00302 #endif
00303 
00304 #ifdef __cplusplus
00305 }
00306 #endif
00307 
00308 #endif

Generated on Tue Sep 30 12:36:19 2003 for GTestAndEngine by doxygen 1.3.2