From bfa61a7ce481bd6ef96b596f607e4ebb7ca15ff1 Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Sun, 27 Apr 2014 23:17:46 -0400 Subject: [PATCH] clean out a bunch of code for old renderers --- include/2d.h | 10 +- include/bitblt.h | 48 - include/circle.h | 50 - include/colors.h | 67 - include/font.h | 3 +- include/fxdll.h | 125 - include/fxglob.h | 31 - include/glide.h | 1377 --------- include/glidesys.h | 128 - include/glideutl.h | 133 - include/gradient.h | 64 - include/grd3d.h | 71 - include/grd3dinternal.h | 229 -- include/grdirectdraw.h | 44 - include/grglide.h | 48 - include/grglideinternal.h | 69 - include/grinternal.h | 19 - include/grsoft.h | 67 - include/line.h | 3 - include/model.h | 12 - include/pixel.h | 71 - include/pstypes.h | 2 - include/scaler.h | 69 - include/shade.h | 64 - include/sst1vid.h | 120 - include/sw_force.h | 477 ---- include/systemvars.h | 5 - include/tmapper.h | 12 - include/tmapscanline.h | 201 -- include/vasync.h | 132 - include/vd3d.h | 897 ------ include/vd3dcaps.h | 314 -- include/vd3di.h | 794 ------ include/vd3drm.h | 229 -- include/vd3drmdef.h | 473 --- include/vd3drmobj.h | 1101 ------- include/vd3drmwin.h | 49 - include/vd3dtypes.h | 1202 -------- include/vddraw.h | 3792 ------------------------- include/vdinput.h | 1850 ------------ include/vdplay.h | 1711 ----------- include/vdplobby.h | 628 ---- include/vdsetup.h | 268 -- include/vdsound.h | 864 ------ include/vdvp.h | 832 ------ includes.cmake | 37 - src/freespace2/freespace.cpp | 96 +- src/globalincs/systemvars.cpp | 4 - src/graphics/2d.cpp | 140 +- src/graphics/font.cpp | 200 +- src/graphics/gropengl.cpp | 2 - src/graphics/gropengl1.cpp | 1 - src/hud/hudreticle.cpp | 1 - src/menuui/mainhallmenu.cpp | 5 - src/menuui/playermenu.cpp | 12 - src/missionui/missionscreencommon.cpp | 4 - src/model/modelinterp.cpp | 696 +---- src/model/modelread.cpp | 3 - src/network/multi_pinfo.cpp | 3 - src/network/multiui.cpp | 6 - src/object/object.cpp | 37 +- src/render/3ddraw.cpp | 1 - src/ship/shield.cpp | 6 +- src/ship/shipfx.cpp | 18 +- src/starfield/starfield.cpp | 68 +- src/stats/medals.cpp | 12 - src/ui/button.cpp | 1 + src/ui/checkbox.cpp | 1 + src/ui/icon.cpp | 1 + src/ui/inputbox.cpp | 1 + src/ui/listbox.cpp | 1 + src/ui/radio.cpp | 1 + src/ui/scroll.cpp | 1 + src/ui/window.cpp | 3 - src/weapon/trails.cpp | 13 +- 75 files changed, 99 insertions(+), 20031 deletions(-) delete mode 100644 include/bitblt.h delete mode 100644 include/circle.h delete mode 100644 include/colors.h delete mode 100644 include/fxdll.h delete mode 100644 include/fxglob.h delete mode 100644 include/glide.h delete mode 100644 include/glidesys.h delete mode 100644 include/glideutl.h delete mode 100644 include/gradient.h delete mode 100644 include/grd3d.h delete mode 100644 include/grd3dinternal.h delete mode 100644 include/grdirectdraw.h delete mode 100644 include/grglide.h delete mode 100644 include/grglideinternal.h delete mode 100644 include/grsoft.h delete mode 100644 include/pixel.h delete mode 100644 include/scaler.h delete mode 100644 include/shade.h delete mode 100644 include/sst1vid.h delete mode 100644 include/sw_force.h delete mode 100644 include/tmapscanline.h delete mode 100644 include/vasync.h delete mode 100644 include/vd3d.h delete mode 100644 include/vd3dcaps.h delete mode 100644 include/vd3di.h delete mode 100644 include/vd3drm.h delete mode 100644 include/vd3drmdef.h delete mode 100644 include/vd3drmobj.h delete mode 100644 include/vd3drmwin.h delete mode 100644 include/vd3dtypes.h delete mode 100644 include/vddraw.h delete mode 100644 include/vdinput.h delete mode 100644 include/vdplay.h delete mode 100644 include/vdplobby.h delete mode 100644 include/vdsetup.h delete mode 100644 include/vdsound.h delete mode 100644 include/vdvp.h diff --git a/include/2d.h b/include/2d.h index 428c7d0..928e902 100644 --- a/include/2d.h +++ b/include/2d.h @@ -378,7 +378,6 @@ typedef struct screen { int mode; // What mode gr_init was called with. int use_sections; // whether to use bitmap sections or not float aspect; // Aspect ratio - int rowsize; // What you need to add to go to next row (includes bytes_per_pixel) int bits_per_pixel; // How many bits per pixel it is. (7,8,15,16,24,32) int bytes_per_pixel; // How many bytes per pixel (1,2,3,4) int offset_x, offset_y; // The offsets into the screen @@ -402,8 +401,6 @@ typedef struct screen { color current_clear_color; // current clear color shader current_shader; float current_alpha; - void *offscreen_buffer; // NEVER ACCESS! This+rowsize*y = screen offset - void *offscreen_buffer_base; // Pointer to lowest address of offscreen buffer //switch onscreen, offscreen void (*gf_flip)(); @@ -428,8 +425,6 @@ typedef struct screen { void (*gf_init_alphacolor)( color * dst, int r, int g, int b, int alpha, int type ); void (*gf_set_color_fast)( color * dst ); - void (*gf_set_font)(int fontnum); - // Sets the current bitmap void (*gf_set_bitmap)( int bitmap_num, int alphablend, int bitbltmode, float alpha, int sx, int sy ); @@ -566,8 +561,7 @@ typedef struct screen { //-------------------------------------- // Call this at application startup -#define GR_SDL (100) // SDL2 renderer -#define GR_OPENGL (101) // OpenGL (generic) +#define GR_OPENGL (100) // OpenGL (generic) // resolution constants - always keep resolutions in ascending order and starting from 0 #define GR_NUM_RESOLUTIONS 2 @@ -632,7 +626,6 @@ extern void gr_activate(int active); #define gr_set_clip GR_CALL(gr_screen.gf_set_clip) #define gr_reset_clip GR_CALL(gr_screen.gf_reset_clip) -#define gr_set_font GR_CALL(gr_screen.gf_set_font) #define gr_init_color GR_CALL(gr_screen.gf_init_color) #define gr_init_alphacolor GR_CALL(gr_screen.gf_init_alphacolor) @@ -713,6 +706,7 @@ __inline bool gr_is_32bit() void gr_force_fullscreen(); void gr_force_windowed(); +void gr_toggle_fullscreen(); // new bitmap functions void gr_bitmap(int x, int y); diff --git a/include/bitblt.h b/include/bitblt.h deleted file mode 100644 index ef04997..0000000 --- a/include/bitblt.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) Volition, Inc. 1999. All rights reserved. - * - * All source code herein is the property of Volition, Inc. You may not sell - * or otherwise commercially exploit the source or things you created based on - * the source. - */ - -/* - * $Logfile: /Freespace2/code/Graphics/Bitblt.h $ - * $Revision$ - * $Date$ - * $Author$ - * - * Include file for software bitblt type stuff - * - * $Log$ - * Revision 1.2 2002/06/09 04:41:12 relnev - * added copyright header - * - * Revision 1.1.1.1 2002/05/03 03:28:12 root - * Initial import. - * - * - * 2 10/07/98 10:52a Dave - * Initial checkin. - * - * 1 10/07/98 10:48a Dave - * - * 2 4/14/98 12:15p John - * Made 16-bpp movies work. - * - * 1 3/25/98 8:07p John - * Split software renderer into Win32 and DirectX - * - * $NoKeywords: $ - */ - -#ifndef _BITBLT_H -#define _BITBLT_H - -void grx_bitmap(int x,int y); -void grx_bitmap_ex(int x,int y,int w,int h,int sx,int sy); -void grx_aabitmap(int x,int y); -void grx_aabitmap_ex(int x,int y,int w,int h,int sx,int sy); - -#endif //_BITBLT_H - diff --git a/include/circle.h b/include/circle.h deleted file mode 100644 index bfeebbb..0000000 --- a/include/circle.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) Volition, Inc. 1999. All rights reserved. - * - * All source code herein is the property of Volition, Inc. You may not sell - * or otherwise commercially exploit the source or things you created based on - * the source. - */ - -/* - * $Logfile: /Freespace2/code/Graphics/Circle.h $ - * $Revision$ - * $Date$ - * $Author$ - * - * Header file for circle.cpp - * - * $Log$ - * Revision 1.2 2002/06/09 04:41:12 relnev - * added copyright header - * - * Revision 1.1.1.1 2002/05/03 03:28:12 root - * Initial import. - * - * - * 2 10/07/98 10:52a Dave - * Initial checkin. - * - * 1 10/07/98 10:48a Dave - * - * 5 3/10/98 4:18p John - * Cleaned up graphics lib. Took out most unused gr functions. Made D3D - * & Glide have popups and print screen. Took out all >8bpp software - * support. Made Fred zbuffer. Made zbuffer allocate dynamically to - * support Fred. Made zbuffering key off of functions rather than one - * global variable. - * - * 4 10/26/96 1:40p John - * Added some now primitives to the 2d library and - * cleaned up some old ones. - * - * $NoKeywords: $ - */ - -#ifndef _CIRCLE_H -#define _CIRCLE_H - -extern void gr8_circle( int xc, int yc, int d ); - -#endif - diff --git a/include/colors.h b/include/colors.h deleted file mode 100644 index 7ce532c..0000000 --- a/include/colors.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) Volition, Inc. 1999. All rights reserved. - * - * All source code herein is the property of Volition, Inc. You may not sell - * or otherwise commercially exploit the source or things you created based on - * the source. - */ - -/* - * $Logfile: /Freespace2/code/Graphics/Colors.h $ - * $Revision$ - * $Date$ - * $Author$ - * - * Functions to deal with colors & alphacolors - * - * $Log$ - * Revision 1.3 2004/09/20 01:31:44 theoddone33 - * GCC 3.4 fixes. - * - * Revision 1.2 2002/06/09 04:41:12 relnev - * added copyright header - * - * Revision 1.1.1.1 2002/05/03 03:28:12 root - * Initial import. - * - * - * 5 1/14/99 12:48a Dave - * Todo list bug fixes. Made a pass at putting briefing icons back into - * FRED. Sort of works :( - * - * 4 11/30/98 5:31p Dave - * Fixed up Fred support for software mode. - * - * 3 11/30/98 1:07p Dave - * 16 bit conversion, first run. - * - * 2 10/07/98 10:52a Dave - * Initial checkin. - * - * 1 10/07/98 10:49a Dave - * - * 2 2/07/98 7:50p John - * Added code so that we can use the old blending type of alphacolors if - * we want to. Made the stars use them. - * - * 1 6/17/97 12:01p John - * - * $NoKeywords: $ - */ - -#ifndef _COLORS_H -#define _COLORS_H - -struct alphacolor_old; - -void grx_init_alphacolors(); -void grx_init_color( color *clr, int r, int g, int b ); -void grx_init_alphacolor( color *clr, int r, int g, int b, int alpha, int type=AC_TYPE_HUD ); -void grx_set_color( int r, int g, int b ); -void grx_set_color_fast( color *clr ); -void grx_get_color( int *r, int *g, int *b ); - -void calc_alphacolor_old(alphacolor_old *ac); - -#endif - diff --git a/include/font.h b/include/font.h index 4b6a58a..63cce85 100644 --- a/include/font.h +++ b/include/font.h @@ -153,8 +153,7 @@ extern font *Current_font; #endif // extern definitions for basic font functions -extern void grx_set_font(int fontnum); -extern void gr8_string(int x, int y, const char * text); +void gr_set_font(int fontnum); void gr_print_timestamp(int x, int y, int timestamp); char *gr_force_fit_string(char *str, int max_str, int max_width); diff --git a/include/fxdll.h b/include/fxdll.h deleted file mode 100644 index ab218ac..0000000 --- a/include/fxdll.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -** Copyright (c) 1995, 1996, 3Dfx Interactive, Inc. -** All Rights Reserved. -** -** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.; -** the contents of this file may not be disclosed to third parties, copied or -** duplicated in any form, in whole or in part, without the prior written -** permission of 3Dfx Interactive, Inc. -** -** RESTRICTED RIGHTS LEGEND: -** Use, duplication or disclosure by the Government is subject to restrictions -** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data -** and Computer Software clause at DFARS 252.227-7013, and/or in similar or -** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - -** rights reserved under the Copyright Laws of the United States. -** -** $Revision$ -** $Date$ -*/ -/* preprocessor defines for libraries to support DLL creation */ - -/* in header file, use FX_ENTRY return-type FX_CALL function-name ( ... ) */ -/* in source file, use FX_EXPORT return-type FX_CSTYLE function-name (... ) */ - -/* in source file, set FX_DLL_DEFINITION, include this file, then include - header file for library. */ - -/* we need to use two macros per declaration/definition because MSVC - requires __stdcall and __declspec( dllexport ) be in different parts - of the prototype! */ - -/* I use two sets in case we need to control declarations and definitions - differently. If it turns out we don't, it should be easy to do a search - and replace to eliminate one set */ - -/* NOTE: this header file may be included more than once, and FX_DLL_DEFINITION - may have changed, so we do not protect this with an #fndef __FXDLL_H__ - statement like we normally would. */ - - -#ifdef FX_ENTRY -#undef FX_ENTRY -#endif - -#ifdef FX_CALL -#undef FX_CALL -#endif - -#ifdef FX_EXPORT -#undef FX_EXPORT -#endif - -#ifdef FX_CSTYLE -#undef FX_CSTYLE -#endif - -#if defined(FX_DLL_DEFINITION) - #if defined(FX_DLL_ENABLE) - #if defined(__MSC__) - #ifndef KERNEL - #define FX_ENTRY __declspec( dllexport ) - #define FX_EXPORT __declspec( dllexport ) - #else - #define FX_ENTRY - #define FX_EXPORT - #endif /* #ifndef KERNEL */ - #define FX_CALL __stdcall - #define FX_CSTYLE __stdcall - - #elif defined(__WATCOMC__) - #define FX_ENTRY - #define FX_CALL __stdcall __export - - #define FX_EXPORT - #define FX_CSTYLE __stdcall __export - - #else /* compiler */ - #error define FX_ENTRY,FX_CALL & FX_EXPORT,FX_CSTYLE for your compiler - #endif /* compiler */ - - #else /* FX_DLL_ENABLE */ - #define FX_ENTRY - #define FX_CALL __stdcall - - #define FX_EXPORT - #define FX_CSTYLE __stdcall - #endif /* FX_DLL_ENABLE */ - -#else /* FX_DLL_DEFINITION */ - #define FX_ENTRY extern - #define FX_CALL __stdcall -#endif /* FX_DLL_DEFINITION */ - -/* - * We don't want any of this DLL junk for DJGPP or UNIX - * so undo what is done above. - */ -#if defined(__DJGPP__) || defined(__unix__) - #ifdef FX_CALL - #undef FX_CALL - #endif - - #ifdef FX_CSTYLE - #undef FX_CSTYLE - #endif - - #ifdef FX_EXPORT - #undef FX_EXPORT - #endif - - #ifdef FX_ENTRY - #undef FX_ENTRY - #endif - - #define FX_CALL - #define FX_CSTYLE - #define FX_EXPORT - #define FX_ENTRY -#endif - -#if defined (MSVC16) - #undef FX_CALL - #define FX_CALL -#endif - diff --git a/include/fxglob.h b/include/fxglob.h deleted file mode 100644 index 3cd4ff6..0000000 --- a/include/fxglob.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -** Copyright (c) 1995, 3Dfx Interactive, Inc. -** All Rights Reserved. -** -** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.; -** the contents of this file may not be disclosed to third parties, copied or -** duplicated in any form, in whole or in part, without the prior written -** permission of 3Dfx Interactive, Inc. -** -** RESTRICTED RIGHTS LEGEND: -** Use, duplication or disclosure by the Government is subject to restrictions -** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data -** and Computer Software clause at DFARS 252.227-7013, and/or in similar or -** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - -** rights reserved under the Copyright Laws of the United States. -** -** $ Revision: $ -** $ Date: $ -** -*/ - - -#ifndef _FXGLOB_H_ -#define _FXGLOB_H_ - - -void fxGlobify( int *argc, char ***argv ); - - -#endif - diff --git a/include/glide.h b/include/glide.h deleted file mode 100644 index 70a3b05..0000000 --- a/include/glide.h +++ /dev/null @@ -1,1377 +0,0 @@ -/* -** Copyright (c) 1995, 3Dfx Interactive, Inc. -** All Rights Reserved. -** -** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.; -** the contents of this file may not be disclosed to third parties, copied or -** duplicated in any form, in whole or in part, without the prior written -** permission of 3Dfx Interactive, Inc. -** -** RESTRICTED RIGHTS LEGEND: -** Use, duplication or disclosure by the Government is subject to restrictions -** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data -** and Computer Software clause at DFARS 252.227-7013, and/or in similar or -** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - -** rights reserved under the Copyright Laws of the United States. -*/ - -/* -** GLIDE.H -** -** The following #defines are relevant when using Glide: -** -** One of the following "platform constants" must be defined during -** compilation: -** -** __DOS__ Defined for 32-bit DOS applications -** __WIN32__ Defined for 32-bit Windows applications -** __sparc__ Defined for Sun Solaris/SunOS -** __linux__ Defined for Linux applications -** __IRIX__ Defined for SGI Irix applications -** -*/ -#ifndef __GLIDE_H__ -#define __GLIDE_H__ - -#define __MSC__ -#define FX_GLIDE_NO_FUNC_PROTO - -#include "3dfx.h" -#include "sst1vid.h" -#include "glidesys.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** ----------------------------------------------------------------------- -** TYPE DEFINITIONS -** ----------------------------------------------------------------------- -*/ -typedef FxU32 GrColor_t; -typedef FxU8 GrAlpha_t; -typedef FxU32 GrMipMapId_t; -typedef FxU8 GrFog_t; - -/* -** ----------------------------------------------------------------------- -** CONSTANTS AND TYPES -** ----------------------------------------------------------------------- -*/ -#define MAX_NUM_SST 4 -#define MAX_MIPMAPS_PER_SST 1024 -#define GR_FOG_TABLE_SIZE 64 -#define GR_NULL_MIPMAP_HANDLE ((GrMipMapId_t) -1) -#define GR_ZDEPTHVALUE_NEAREST 0xFFFF -#define GR_ZDEPTHVALUE_FARTHEST 0x0000 -#define GR_WDEPTHVALUE_NEAREST 0x0000 -#define GR_WDEPTHVALUE_FARTHEST 0xFFFF - -#define GR_MIPMAPLEVELMASK_EVEN FXBIT(0) -#define GR_MIPMAPLEVELMASK_ODD FXBIT(1) -#define GR_MIPMAPLEVELMASK_BOTH (GR_MIPMAPLEVELMASK_EVEN | GR_MIPMAPLEVELMASK_ODD ) - -#define GR_LODBIAS_BILINEAR 0.5 -#define GR_LODBIAS_TRILINEAR 0.0 - -typedef FxI32 GrChipID_t; -#define GR_TMU0 0x0 -#define GR_TMU1 0x1 -#define GR_TMU2 0x2 -#define GR_FBI 0x3 - -typedef FxI32 GrCombineFunction_t; -#define GR_COMBINE_FUNCTION_ZERO 0x0 -#define GR_COMBINE_FUNCTION_NONE GR_COMBINE_FUNCTION_ZERO -#define GR_COMBINE_FUNCTION_LOCAL 0x1 -#define GR_COMBINE_FUNCTION_LOCAL_ALPHA 0x2 -#define GR_COMBINE_FUNCTION_SCALE_OTHER 0x3 -#define GR_COMBINE_FUNCTION_BLEND_OTHER GR_COMBINE_FUNCTION_SCALE_OTHER -#define GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL 0x4 -#define GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL_ALPHA 0x5 -#define GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL 0x6 -#define GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL 0x7 -#define GR_COMBINE_FUNCTION_BLEND GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL -#define GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL_ALPHA 0x8 -#define GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL 0x9 -#define GR_COMBINE_FUNCTION_BLEND_LOCAL GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL -#define GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL_ALPHA 0x10 - -typedef FxI32 GrCombineFactor_t; -#define GR_COMBINE_FACTOR_ZERO 0x0 -#define GR_COMBINE_FACTOR_NONE GR_COMBINE_FACTOR_ZERO -#define GR_COMBINE_FACTOR_LOCAL 0x1 -#define GR_COMBINE_FACTOR_OTHER_ALPHA 0x2 -#define GR_COMBINE_FACTOR_LOCAL_ALPHA 0x3 -#define GR_COMBINE_FACTOR_TEXTURE_ALPHA 0x4 -#define GR_COMBINE_FACTOR_DETAIL_FACTOR GR_COMBINE_FACTOR_TEXTURE_ALPHA -#define GR_COMBINE_FACTOR_LOD_FRACTION 0x5 -#define GR_COMBINE_FACTOR_ONE 0x8 -#define GR_COMBINE_FACTOR_ONE_MINUS_LOCAL 0x9 -#define GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA 0xa -#define GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA 0xb -#define GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA 0xc -#define GR_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA -#define GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION 0xd - - -typedef FxI32 GrCombineLocal_t; -#define GR_COMBINE_LOCAL_ITERATED 0x0 -#define GR_COMBINE_LOCAL_CONSTANT 0x1 -#define GR_COMBINE_LOCAL_NONE GR_COMBINE_LOCAL_CONSTANT -#define GR_COMBINE_LOCAL_DEPTH 0x2 - -typedef FxI32 GrCombineOther_t; -#define GR_COMBINE_OTHER_ITERATED 0x0 -#define GR_COMBINE_OTHER_TEXTURE 0x1 -#define GR_COMBINE_OTHER_CONSTANT 0x2 -#define GR_COMBINE_OTHER_NONE GR_COMBINE_OTHER_CONSTANT - - -typedef FxI32 GrAlphaSource_t; -#define GR_ALPHASOURCE_CC_ALPHA 0x0 -#define GR_ALPHASOURCE_ITERATED_ALPHA 0x1 -#define GR_ALPHASOURCE_TEXTURE_ALPHA 0x2 -#define GR_ALPHASOURCE_TEXTURE_ALPHA_TIMES_ITERATED_ALPHA 0x3 - - -typedef FxI32 GrColorCombineFnc_t; -#define GR_COLORCOMBINE_ZERO 0x0 -#define GR_COLORCOMBINE_CCRGB 0x1 -#define GR_COLORCOMBINE_ITRGB 0x2 -#define GR_COLORCOMBINE_ITRGB_DELTA0 0x3 -#define GR_COLORCOMBINE_DECAL_TEXTURE 0x4 -#define GR_COLORCOMBINE_TEXTURE_TIMES_CCRGB 0x5 -#define GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB 0x6 -#define GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB_DELTA0 0x7 -#define GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB_ADD_ALPHA 0x8 -#define GR_COLORCOMBINE_TEXTURE_TIMES_ALPHA 0x9 -#define GR_COLORCOMBINE_TEXTURE_TIMES_ALPHA_ADD_ITRGB 0xa -#define GR_COLORCOMBINE_TEXTURE_ADD_ITRGB 0xb -#define GR_COLORCOMBINE_TEXTURE_SUB_ITRGB 0xc -#define GR_COLORCOMBINE_CCRGB_BLEND_ITRGB_ON_TEXALPHA 0xd -#define GR_COLORCOMBINE_DIFF_SPEC_A 0xe -#define GR_COLORCOMBINE_DIFF_SPEC_B 0xf -#define GR_COLORCOMBINE_ONE 0x10 - -typedef FxI32 GrAlphaBlendFnc_t; -#define GR_BLEND_ZERO 0x0 -#define GR_BLEND_SRC_ALPHA 0x1 -#define GR_BLEND_SRC_COLOR 0x2 -#define GR_BLEND_DST_COLOR GR_BLEND_SRC_COLOR -#define GR_BLEND_DST_ALPHA 0x3 -#define GR_BLEND_ONE 0x4 -#define GR_BLEND_ONE_MINUS_SRC_ALPHA 0x5 -#define GR_BLEND_ONE_MINUS_SRC_COLOR 0x6 -#define GR_BLEND_ONE_MINUS_DST_COLOR GR_BLEND_ONE_MINUS_SRC_COLOR -#define GR_BLEND_ONE_MINUS_DST_ALPHA 0x7 -#define GR_BLEND_RESERVED_8 0x8 -#define GR_BLEND_RESERVED_9 0x9 -#define GR_BLEND_RESERVED_A 0xa -#define GR_BLEND_RESERVED_B 0xb -#define GR_BLEND_RESERVED_C 0xc -#define GR_BLEND_RESERVED_D 0xd -#define GR_BLEND_RESERVED_E 0xe -#define GR_BLEND_ALPHA_SATURATE 0xf -#define GR_BLEND_PREFOG_COLOR GR_BLEND_ALPHA_SATURATE - -typedef FxI32 GrAspectRatio_t; -#define GR_ASPECT_8x1 0x0 /* 8W x 1H */ -#define GR_ASPECT_4x1 0x1 /* 4W x 1H */ -#define GR_ASPECT_2x1 0x2 /* 2W x 1H */ -#define GR_ASPECT_1x1 0x3 /* 1W x 1H */ -#define GR_ASPECT_1x2 0x4 /* 1W x 2H */ -#define GR_ASPECT_1x4 0x5 /* 1W x 4H */ -#define GR_ASPECT_1x8 0x6 /* 1W x 8H */ - -typedef FxI32 GrBuffer_t; -#define GR_BUFFER_FRONTBUFFER 0x0 -#define GR_BUFFER_BACKBUFFER 0x1 -#define GR_BUFFER_AUXBUFFER 0x2 -#define GR_BUFFER_DEPTHBUFFER 0x3 -#define GR_BUFFER_ALPHABUFFER 0x4 -#define GR_BUFFER_TRIPLEBUFFER 0x5 - -typedef FxI32 GrChromakeyMode_t; -#define GR_CHROMAKEY_DISABLE 0x0 -#define GR_CHROMAKEY_ENABLE 0x1 - -typedef FxI32 GrCmpFnc_t; -#define GR_CMP_NEVER 0x0 -#define GR_CMP_LESS 0x1 -#define GR_CMP_EQUAL 0x2 -#define GR_CMP_LEQUAL 0x3 -#define GR_CMP_GREATER 0x4 -#define GR_CMP_NOTEQUAL 0x5 -#define GR_CMP_GEQUAL 0x6 -#define GR_CMP_ALWAYS 0x7 - -typedef FxI32 GrColorFormat_t; -#define GR_COLORFORMAT_ARGB 0x0 -#define GR_COLORFORMAT_ABGR 0x1 - -#define GR_COLORFORMAT_RGBA 0x2 -#define GR_COLORFORMAT_BGRA 0x3 - -typedef FxI32 GrCullMode_t; -#define GR_CULL_DISABLE 0x0 -#define GR_CULL_NEGATIVE 0x1 -#define GR_CULL_POSITIVE 0x2 - -typedef FxI32 GrDepthBufferMode_t; -#define GR_DEPTHBUFFER_DISABLE 0x0 -#define GR_DEPTHBUFFER_ZBUFFER 0x1 -#define GR_DEPTHBUFFER_WBUFFER 0x2 -#define GR_DEPTHBUFFER_ZBUFFER_COMPARE_TO_BIAS 0x3 -#define GR_DEPTHBUFFER_WBUFFER_COMPARE_TO_BIAS 0x4 - -typedef FxI32 GrDitherMode_t; -#define GR_DITHER_DISABLE 0x0 -#define GR_DITHER_2x2 0x1 -#define GR_DITHER_4x4 0x2 - -typedef FxI32 GrFogMode_t; -#define GR_FOG_DISABLE 0x0 -#define GR_FOG_WITH_ITERATED_ALPHA 0x1 -#define GR_FOG_WITH_TABLE 0x2 -#define GR_FOG_WITH_ITERATED_Z 0x3 /* Bug 735 */ -#define GR_FOG_MULT2 0x100 -#define GR_FOG_ADD2 0x200 - -typedef FxU32 GrLock_t; -#define GR_LFB_READ_ONLY 0x00 -#define GR_LFB_WRITE_ONLY 0x01 -#define GR_LFB_IDLE 0x00 -#define GR_LFB_NOIDLE 0x10 - -typedef FxI32 GrLfbBypassMode_t; -#define GR_LFBBYPASS_DISABLE 0x0 -#define GR_LFBBYPASS_ENABLE 0x1 - -typedef FxI32 GrLfbWriteMode_t; -#define GR_LFBWRITEMODE_565 0x0 /* RGB:RGB */ -#define GR_LFBWRITEMODE_555 0x1 /* RGB:RGB */ -#define GR_LFBWRITEMODE_1555 0x2 /* ARGB:ARGB */ -#define GR_LFBWRITEMODE_RESERVED1 0x3 -#define GR_LFBWRITEMODE_888 0x4 /* RGB */ -#define GR_LFBWRITEMODE_8888 0x5 /* ARGB */ -#define GR_LFBWRITEMODE_RESERVED2 0x6 -#define GR_LFBWRITEMODE_RESERVED3 0x7 -#define GR_LFBWRITEMODE_RESERVED4 0x8 -#define GR_LFBWRITEMODE_RESERVED5 0x9 -#define GR_LFBWRITEMODE_RESERVED6 0xa -#define GR_LFBWRITEMODE_RESERVED7 0xb -#define GR_LFBWRITEMODE_565_DEPTH 0xc /* RGB:DEPTH */ -#define GR_LFBWRITEMODE_555_DEPTH 0xd /* RGB:DEPTH */ -#define GR_LFBWRITEMODE_1555_DEPTH 0xe /* ARGB:DEPTH */ -#define GR_LFBWRITEMODE_ZA16 0xf /* DEPTH:DEPTH */ -#define GR_LFBWRITEMODE_ANY 0xFF - - -typedef FxI32 GrOriginLocation_t; -#define GR_ORIGIN_UPPER_LEFT 0x0 -#define GR_ORIGIN_LOWER_LEFT 0x1 -#define GR_ORIGIN_ANY 0xFF - -typedef struct { - int size; - void *lfbPtr; - FxU32 strideInBytes; - GrLfbWriteMode_t writeMode; - GrOriginLocation_t origin; -} GrLfbInfo_t; - -typedef FxI32 GrLOD_t; -#define GR_LOD_256 0x0 -#define GR_LOD_128 0x1 -#define GR_LOD_64 0x2 -#define GR_LOD_32 0x3 -#define GR_LOD_16 0x4 -#define GR_LOD_8 0x5 -#define GR_LOD_4 0x6 -#define GR_LOD_2 0x7 -#define GR_LOD_1 0x8 - -typedef FxI32 GrMipMapMode_t; -#define GR_MIPMAP_DISABLE 0x0 /* no mip mapping */ -#define GR_MIPMAP_NEAREST 0x1 /* use nearest mipmap */ -#define GR_MIPMAP_NEAREST_DITHER 0x2 /* GR_MIPMAP_NEAREST + LOD dith */ - - -typedef FxI32 GrSmoothingMode_t; -#define GR_SMOOTHING_DISABLE 0x0 -#define GR_SMOOTHING_ENABLE 0x1 - -typedef FxI32 GrTextureClampMode_t; -#define GR_TEXTURECLAMP_WRAP 0x0 -#define GR_TEXTURECLAMP_CLAMP 0x1 - -typedef FxI32 GrTextureCombineFnc_t; -#define GR_TEXTURECOMBINE_ZERO 0x0 /* texout = 0 */ -#define GR_TEXTURECOMBINE_DECAL 0x1 /* texout = texthis */ -#define GR_TEXTURECOMBINE_OTHER 0x2 /* this TMU in passthru mode */ -#define GR_TEXTURECOMBINE_ADD 0x3 /* tout = tthis + t(this+1) */ -#define GR_TEXTURECOMBINE_MULTIPLY 0x4 /* texout = tthis * t(this+1) */ -#define GR_TEXTURECOMBINE_SUBTRACT 0x5 /* Sutract from upstream TMU */ -#define GR_TEXTURECOMBINE_DETAIL 0x6 /* detail--detail on tthis */ -#define GR_TEXTURECOMBINE_DETAIL_OTHER 0x7 /* detail--detail on tthis+1 */ -#define GR_TEXTURECOMBINE_TRILINEAR_ODD 0x8 /* trilinear--odd levels tthis*/ -#define GR_TEXTURECOMBINE_TRILINEAR_EVEN 0x9 /*trilinear--even levels tthis*/ -#define GR_TEXTURECOMBINE_ONE 0xa /* texout = 0xFFFFFFFF */ - -typedef FxI32 GrTextureFilterMode_t; -#define GR_TEXTUREFILTER_POINT_SAMPLED 0x0 -#define GR_TEXTUREFILTER_BILINEAR 0x1 - -typedef FxI32 GrTextureFormat_t; -#define GR_TEXFMT_8BIT 0x0 -#define GR_TEXFMT_RGB_332 GR_TEXFMT_8BIT -#define GR_TEXFMT_YIQ_422 0x1 -#define GR_TEXFMT_ALPHA_8 0x2 /* (0..0xFF) alpha */ -#define GR_TEXFMT_INTENSITY_8 0x3 /* (0..0xFF) intensity */ -#define GR_TEXFMT_ALPHA_INTENSITY_44 0x4 -#define GR_TEXFMT_P_8 0x5 /* 8-bit palette */ -#define GR_TEXFMT_RSVD0 0x6 -#define GR_TEXFMT_RSVD1 0x7 -#define GR_TEXFMT_16BIT 0x8 -#define GR_TEXFMT_ARGB_8332 GR_TEXFMT_16BIT -#define GR_TEXFMT_AYIQ_8422 0x9 -#define GR_TEXFMT_RGB_565 0xa -#define GR_TEXFMT_ARGB_1555 0xb -#define GR_TEXFMT_ARGB_4444 0xc -#define GR_TEXFMT_ALPHA_INTENSITY_88 0xd -#define GR_TEXFMT_AP_88 0xe /* 8-bit alpha 8-bit palette */ -#define GR_TEXFMT_RSVD2 0xf - -typedef FxU32 GrTexTable_t; -#define GR_TEXTABLE_NCC0 0x0 -#define GR_TEXTABLE_NCC1 0x1 -#define GR_TEXTABLE_PALETTE 0x2 - -typedef FxU32 GrNCCTable_t; -#define GR_NCCTABLE_NCC0 0x0 -#define GR_NCCTABLE_NCC1 0x1 - -typedef FxU32 GrTexBaseRange_t; -#define GR_TEXBASE_256 0x0 -#define GR_TEXBASE_128 0x1 -#define GR_TEXBASE_64 0x2 -#define GR_TEXBASE_32_TO_1 0x3 - -#define GLIDE_STATE_PAD_SIZE 312 -#ifdef GLIDE_LIB -typedef struct _GrState_s GrState; -#else -typedef struct _GrState_s { - char pad[GLIDE_STATE_PAD_SIZE]; -} GrState; -#endif - -/* -** ----------------------------------------------------------------------- -** STRUCTURES -** ----------------------------------------------------------------------- -*/ -/* -** 3DF texture file structs -*/ -typedef struct -{ - FxU32 width, height; - int small_lod, large_lod; - GrAspectRatio_t aspect_ratio; - GrTextureFormat_t format; -} Gu3dfHeader; - -typedef struct -{ - FxU8 yRGB[16]; - FxI16 iRGB[4][3]; - FxI16 qRGB[4][3]; - FxU32 packed_data[12]; -} GuNccTable; - -typedef struct { - FxU32 data[256]; -} GuTexPalette; - -typedef union { - GuNccTable nccTable; - GuTexPalette palette; -} GuTexTable; - -typedef struct -{ - Gu3dfHeader header; - GuTexTable table; - void *data; - FxU32 mem_required; /* memory required for mip map in bytes. */ -} Gu3dfInfo; - -typedef struct { - GrLOD_t smallLod; - GrLOD_t largeLod; - GrAspectRatio_t aspectRatio; - GrTextureFormat_t format; - void *data; -} GrTexInfo; - -typedef struct -{ - int sst; /* SST where this texture map was stored */ - FxBool valid; /* set when this table entry is allocated*/ - int width, height; - GrAspectRatio_t aspect_ratio; /* aspect ratio of the mip map. */ - void *data; /* actual texture data */ - - GrTextureFormat_t format; /* format of the texture table */ - GrMipMapMode_t mipmap_mode; /* mip map mode for this texture */ - GrTextureFilterMode_t magfilter_mode; /* filtering to be used when magnified */ - GrTextureFilterMode_t minfilter_mode; /* filtering to be used with minified */ - GrTextureClampMode_t s_clamp_mode; /* how this texture should be clamped in s */ - GrTextureClampMode_t t_clamp_mode; /* how this texture should be clamped in t */ - FxU32 tLOD; /* Register value for tLOD register */ - FxU32 tTextureMode; /* Register value for tTextureMode register - not including non-texture specific bits */ - FxU32 lod_bias; /* LOD bias of the mip map in preshifted 4.2*/ - GrLOD_t lod_min, lod_max; /* largest and smallest levels of detail */ - int tmu; /* tmu on which this texture resides */ - FxU32 odd_even_mask; /* mask specifying levels on this tmu */ - FxU32 tmu_base_address; /* base addr (in TMU mem) of this texture */ - FxBool trilinear; /* should we blend by lod? */ - - GuNccTable ncc_table; /* NCC compression table (optional) */ -} GrMipMapInfo; - -typedef int GrSstType; -#define GR_SSTTYPE_VOODOO 0 -#define GR_SSTTYPE_SST96 1 -#define GR_SSTTYPE_AT3D 2 -#define GR_SSTTYPE_Voodoo2 3 - -typedef struct GrTMUConfig_St { - int tmuRev; /* Rev of Texelfx chip */ - int tmuRam; /* 1, 2, or 4 MB */ -} GrTMUConfig_t; - -typedef struct GrVoodooConfig_St { - int fbRam; /* 1, 2, or 4 MB */ - int fbiRev; /* Rev of Pixelfx chip */ - int nTexelfx; /* How many texelFX chips are there? */ - FxBool sliDetect; /* Is it a scan-line interleaved board? */ - GrTMUConfig_t tmuConfig[GLIDE_NUM_TMU]; /* Configuration of the Texelfx chips */ -} GrVoodooConfig_t; - -typedef struct GrSst96Config_St { - int fbRam; /* How much? */ - int nTexelfx; - GrTMUConfig_t tmuConfig; -} GrSst96Config_t; - -typedef GrVoodooConfig_t GrVoodoo2Config_t; - -typedef struct GrAT3DConfig_St { - int rev; -} GrAT3DConfig_t; - -typedef struct { - int num_sst; /* # of HW units in the system */ - struct { - GrSstType type; /* Which hardware is it? */ - union SstBoard_u { - GrVoodooConfig_t VoodooConfig; - GrSst96Config_t SST96Config; - GrAT3DConfig_t AT3DConfig; - GrVoodoo2Config_t Voodoo2Config; - } sstBoard; - } SSTs[MAX_NUM_SST]; /* configuration for each board */ -} GrHwConfiguration; - -typedef struct GrSstPerfStats_s { - FxU32 pixelsIn; /* # pixels processed (minus buffer clears) */ - FxU32 chromaFail; /* # pixels not drawn due to chroma key */ - FxU32 zFuncFail; /* # pixels not drawn due to Z comparison */ - FxU32 aFuncFail; /* # pixels not drawn due to alpha comparison */ - FxU32 pixelsOut; /* # pixels drawn (including buffer clears) */ -} GrSstPerfStats_t; - - -typedef struct { - float sow; /* s texture ordinate (s over w) */ - float tow; /* t texture ordinate (t over w) */ - float oow; /* 1/w (used mipmapping - really 0xfff/w) */ -} GrTmuVertex; - -/* -** GrVertex -** If these are changed the C & assembly language trisetup routines MUST -** be changed, for they will no longer work. -*/ -typedef struct -{ - float x, y, z; /* X, Y, and Z of scrn space -- Z is ignored */ - float r, g, b; /* R, G, B, ([0..255.0]) */ - float ooz; /* 65535/Z (used for Z-buffering) */ - float a; /* Alpha [0..255.0] */ - float oow; /* 1/W (used for W-buffering, texturing) */ - GrTmuVertex tmuvtx[GLIDE_NUM_TMU]; -} GrVertex; - -/* For indexing GrVertex as a float *. - CHANGE THESE IF THE VERTEX STRUCTURE CHANGES! - */ -#define GR_VERTEX_X_OFFSET 0 -#define GR_VERTEX_Y_OFFSET 1 -#define GR_VERTEX_Z_OFFSET 2 -#define GR_VERTEX_R_OFFSET 3 -#define GR_VERTEX_G_OFFSET 4 -#define GR_VERTEX_B_OFFSET 5 -#define GR_VERTEX_OOZ_OFFSET 6 -#define GR_VERTEX_A_OFFSET 7 -#define GR_VERTEX_OOW_OFFSET 8 -#define GR_VERTEX_SOW_TMU0_OFFSET 9 -#define GR_VERTEX_TOW_TMU0_OFFSET 10 -#define GR_VERTEX_OOW_TMU0_OFFSET 11 -#define GR_VERTEX_SOW_TMU1_OFFSET 12 -#define GR_VERTEX_TOW_TMU1_OFFSET 13 -#define GR_VERTEX_OOW_TMU1_OFFSET 14 -#if (GLIDE_NUM_TMU > 2) -#define GR_VERTEX_SOW_TMU2_OFFSET 15 -#define GR_VERTEX_TOW_TMU2_OFFSET 16 -#define GR_VERTEX_OOW_TMU2_OFFSET 17 -#endif - -typedef FxU32 GrLfbSrcFmt_t; -#define GR_LFB_SRC_FMT_565 0x00 -#define GR_LFB_SRC_FMT_555 0x01 -#define GR_LFB_SRC_FMT_1555 0x02 -#define GR_LFB_SRC_FMT_888 0x04 -#define GR_LFB_SRC_FMT_8888 0x05 -#define GR_LFB_SRC_FMT_565_DEPTH 0x0c -#define GR_LFB_SRC_FMT_555_DEPTH 0x0d -#define GR_LFB_SRC_FMT_1555_DEPTH 0x0e -#define GR_LFB_SRC_FMT_ZA16 0x0f -#define GR_LFB_SRC_FMT_RLE16 0x80 - -typedef FxI32 GrPassthruMode_t; -#define GR_PASSTHRU_SHOW_VGA 0x0 -#define GR_PASSTHRU_SHOW_SST1 0x1 - -typedef FxU32 GrHint_t; -#define GR_HINTTYPE_MIN 0 -#define GR_HINT_STWHINT 0 -#define GR_HINT_FIFOCHECKHINT 1 -#define GR_HINT_FPUPRECISION 2 -#define GR_HINT_ALLOW_MIPMAP_DITHER 3 -#define GR_HINTTYPE_MAX 3 - -typedef FxU32 GrSTWHint_t; -#define GR_STWHINT_W_DIFF_FBI FXBIT(0) -#define GR_STWHINT_W_DIFF_TMU0 FXBIT(1) -#define GR_STWHINT_ST_DIFF_TMU0 FXBIT(2) -#define GR_STWHINT_W_DIFF_TMU1 FXBIT(3) -#define GR_STWHINT_ST_DIFF_TMU1 FXBIT(4) -#define GR_STWHINT_W_DIFF_TMU2 FXBIT(5) -#define GR_STWHINT_ST_DIFF_TMU2 FXBIT(6) - -typedef FxU32 GrControl_t; -#define GR_CONTROL_ACTIVATE 0x1 -#define GR_CONTROL_DEACTIVATE 0x2 -#define GR_CONTROL_RESIZE 0x3 -#define GR_CONTROL_MOVE 0x4 - -#define GR_GENERATE_FIFOCHECK_HINT_MASK(swHWM, swLWM) \ - (((swHWM & 0xffff) << 16) | (swLWM & 0xffff)) - -/* -** ----------------------------------------------------------------------- -** FUNCTION PROTOTYPES -** ----------------------------------------------------------------------- -*/ -#ifndef FX_GLIDE_NO_FUNC_PROTO -/* -** rendering functions -*/ -FX_ENTRY void FX_CALL -grDrawLine( const GrVertex *v1, const GrVertex *v2 ); - -FX_ENTRY void FX_CALL -grDrawPlanarPolygon( int nverts, const int ilist[], const GrVertex vlist[] ); - -FX_ENTRY void FX_CALL -grDrawPlanarPolygonVertexList( int nverts, const GrVertex vlist[] ); - -FX_ENTRY void FX_CALL -grDrawPoint( const GrVertex *pt ); - -FX_ENTRY void FX_CALL -grDrawPolygon( int nverts, const int ilist[], const GrVertex vlist[] ); - -FX_ENTRY void FX_CALL -grDrawPolygonVertexList( int nverts, const GrVertex vlist[] ); - -FX_ENTRY void FX_CALL -grDrawTriangle( const GrVertex *a, const GrVertex *b, const GrVertex *c ); - -FX_ENTRY void FX_CALL -guDrawTriangleWithClip( const GrVertex *a, const GrVertex *b, const GrVertex *c ); - -/* -** buffer management -*/ -FX_ENTRY void FX_CALL -grBufferClear( GrColor_t color, GrAlpha_t alpha, FxU16 depth ); - -FX_ENTRY int FX_CALL -grBufferNumPending( void ); - -FX_ENTRY void FX_CALL -grBufferSwap( int swap_interval ); - -FX_ENTRY void FX_CALL -grRenderBuffer( GrBuffer_t buffer ); - -/* -** error management -*/ -typedef void (*GrErrorCallbackFnc_t)( const char *string, FxBool fatal ); - -FX_ENTRY void FX_CALL -grErrorSetCallback( GrErrorCallbackFnc_t fnc ); - -/* -** SST routines -*/ -FX_ENTRY void FX_CALL -grSstIdle(void); - -FX_ENTRY FxU32 FX_CALL -grSstVideoLine( void ); - -FX_ENTRY FxBool FX_CALL -grSstVRetraceOn( void ); - -FX_ENTRY FxBool FX_CALL -grSstIsBusy( void ); - -FX_ENTRY FxBool FX_CALL -grSstWinOpen( - FxU32 hWnd, - GrScreenResolution_t screen_resolution, - GrScreenRefresh_t refresh_rate, - GrColorFormat_t color_format, - GrOriginLocation_t origin_location, - int nColBuffers, - int nAuxBuffers); - -FX_ENTRY void FX_CALL -grSstWinClose( void ); - -FX_ENTRY FxBool FX_CALL -grSstControl( FxU32 code ); - -FX_ENTRY FxBool FX_CALL -grSstQueryHardware( GrHwConfiguration *hwconfig ); - -FX_ENTRY FxBool FX_CALL -grSstQueryBoards( GrHwConfiguration *hwconfig ); - -FX_ENTRY void FX_CALL -grSstOrigin(GrOriginLocation_t origin); - -FX_ENTRY void FX_CALL -grSstSelect( int which_sst ); - -FX_ENTRY FxU32 FX_CALL -grSstScreenHeight( void ); - -FX_ENTRY FxU32 FX_CALL -grSstScreenWidth( void ); - -FX_ENTRY FxU32 FX_CALL -grSstStatus( void ); - -/* -** Drawing Statistics -*/ -FX_ENTRY void FX_CALL -grSstPerfStats(GrSstPerfStats_t *pStats); - -FX_ENTRY void FX_CALL -grSstResetPerfStats(void); - -FX_ENTRY void FX_CALL -grResetTriStats(); - -FX_ENTRY void FX_CALL -grTriStats(FxU32 *trisProcessed, FxU32 *trisDrawn); - -/* -** Glide configuration and special effect maintenance functions -*/ -FX_ENTRY void FX_CALL -grAlphaBlendFunction( - GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, - GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df - ); - -FX_ENTRY void FX_CALL -grAlphaCombine( - GrCombineFunction_t function, GrCombineFactor_t factor, - GrCombineLocal_t local, GrCombineOther_t other, - FxBool invert - ); - -FX_ENTRY void FX_CALL -grAlphaControlsITRGBLighting( FxBool enable ); - -FX_ENTRY void FX_CALL -grAlphaTestFunction( GrCmpFnc_t function ); - -FX_ENTRY void FX_CALL -grAlphaTestReferenceValue( GrAlpha_t value ); - -FX_ENTRY void FX_CALL -grChromakeyMode( GrChromakeyMode_t mode ); - -FX_ENTRY void FX_CALL -grChromakeyValue( GrColor_t value ); - -FX_ENTRY void FX_CALL -grClipWindow( FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy ); - -FX_ENTRY void FX_CALL -grColorCombine( - GrCombineFunction_t function, GrCombineFactor_t factor, - GrCombineLocal_t local, GrCombineOther_t other, - FxBool invert ); - -FX_ENTRY void FX_CALL -grColorMask( FxBool rgb, FxBool a ); - -FX_ENTRY void FX_CALL -grCullMode( GrCullMode_t mode ); - -FX_ENTRY void FX_CALL -grConstantColorValue( GrColor_t value ); - -FX_ENTRY void FX_CALL -grConstantColorValue4( float a, float r, float g, float b ); - -FX_ENTRY void FX_CALL -grDepthBiasLevel( FxI16 level ); - -FX_ENTRY void FX_CALL -grDepthBufferFunction( GrCmpFnc_t function ); - -FX_ENTRY void FX_CALL -grDepthBufferMode( GrDepthBufferMode_t mode ); - -FX_ENTRY void FX_CALL -grDepthMask( FxBool mask ); - -FX_ENTRY void FX_CALL -grDisableAllEffects( void ); - -FX_ENTRY void FX_CALL -grDitherMode( GrDitherMode_t mode ); - -FX_ENTRY void FX_CALL -grFogColorValue( GrColor_t fogcolor ); - -FX_ENTRY void FX_CALL -grFogMode( GrFogMode_t mode ); - -FX_ENTRY void FX_CALL -grFogTable( const GrFog_t ft[GR_FOG_TABLE_SIZE] ); - -FX_ENTRY void FX_CALL -grGammaCorrectionValue( float value ); - -FX_ENTRY void FX_CALL -grSplash(float x, float y, float width, float height, FxU32 frame); - -/* -** texture mapping control functions -*/ -FX_ENTRY FxU32 FX_CALL -grTexCalcMemRequired( - GrLOD_t lodmin, GrLOD_t lodmax, - GrAspectRatio_t aspect, GrTextureFormat_t fmt); - -FX_ENTRY FxU32 FX_CALL -grTexTextureMemRequired( FxU32 evenOdd, - GrTexInfo *info ); - -FX_ENTRY FxU32 FX_CALL -grTexMinAddress( GrChipID_t tmu ); - - -FX_ENTRY FxU32 FX_CALL -grTexMaxAddress( GrChipID_t tmu ); - - -FX_ENTRY void FX_CALL -grTexNCCTable( GrChipID_t tmu, GrNCCTable_t table ); - -FX_ENTRY void FX_CALL -grTexSource( GrChipID_t tmu, - FxU32 startAddress, - FxU32 evenOdd, - GrTexInfo *info ); - -FX_ENTRY void FX_CALL -grTexClampMode( - GrChipID_t tmu, - GrTextureClampMode_t s_clampmode, - GrTextureClampMode_t t_clampmode - ); - -FX_ENTRY void FX_CALL -grTexCombine( - GrChipID_t tmu, - GrCombineFunction_t rgb_function, - GrCombineFactor_t rgb_factor, - GrCombineFunction_t alpha_function, - GrCombineFactor_t alpha_factor, - FxBool rgb_invert, - FxBool alpha_invert - ); - -FX_ENTRY void FX_CALL -grTexCombineFunction( - GrChipID_t tmu, - GrTextureCombineFnc_t fnc - ); - -FX_ENTRY void FX_CALL -grTexDetailControl( - GrChipID_t tmu, - int lod_bias, - FxU8 detail_scale, - float detail_max - ); - -FX_ENTRY void FX_CALL -grTexFilterMode( - GrChipID_t tmu, - GrTextureFilterMode_t minfilter_mode, - GrTextureFilterMode_t magfilter_mode - ); - - -FX_ENTRY void FX_CALL -grTexLodBiasValue(GrChipID_t tmu, float bias ); - -FX_ENTRY void FX_CALL -grTexDownloadMipMap( GrChipID_t tmu, - FxU32 startAddress, - FxU32 evenOdd, - GrTexInfo *info ); - -FX_ENTRY void FX_CALL -grTexDownloadMipMapLevel( GrChipID_t tmu, - FxU32 startAddress, - GrLOD_t thisLod, - GrLOD_t largeLod, - GrAspectRatio_t aspectRatio, - GrTextureFormat_t format, - FxU32 evenOdd, - void *data ); - -FX_ENTRY void FX_CALL -grTexDownloadMipMapLevelPartial( GrChipID_t tmu, - FxU32 startAddress, - GrLOD_t thisLod, - GrLOD_t largeLod, - GrAspectRatio_t aspectRatio, - GrTextureFormat_t format, - FxU32 evenOdd, - void *data, - int start, - int end ); - - -FX_ENTRY void FX_CALL -ConvertAndDownloadRle( GrChipID_t tmu, - FxU32 startAddress, - GrLOD_t thisLod, - GrLOD_t largeLod, - GrAspectRatio_t aspectRatio, - GrTextureFormat_t format, - FxU32 evenOdd, - FxU8 *bm_data, - long bm_h, - FxU32 u0, - FxU32 v0, - FxU32 width, - FxU32 height, - FxU32 dest_width, - FxU32 dest_height, - FxU16 *tlut); - -FX_ENTRY void FX_CALL -grCheckForRoom(FxI32 n); - -FX_ENTRY void FX_CALL -grTexDownloadTable( GrChipID_t tmu, - GrTexTable_t type, - void *data ); - -FX_ENTRY void FX_CALL -grTexDownloadTablePartial( GrChipID_t tmu, - GrTexTable_t type, - void *data, - int start, - int end ); - -FX_ENTRY void FX_CALL -grTexMipMapMode( GrChipID_t tmu, - GrMipMapMode_t mode, - FxBool lodBlend ); - -FX_ENTRY void FX_CALL -grTexMultibase( GrChipID_t tmu, - FxBool enable ); - -FX_ENTRY void FX_CALL -grTexMultibaseAddress( GrChipID_t tmu, - GrTexBaseRange_t range, - FxU32 startAddress, - FxU32 evenOdd, - GrTexInfo *info ); - -/* -** utility texture functions -*/ -FX_ENTRY GrMipMapId_t FX_CALL -guTexAllocateMemory( - GrChipID_t tmu, - FxU8 odd_even_mask, - int width, int height, - GrTextureFormat_t fmt, - GrMipMapMode_t mm_mode, - GrLOD_t smallest_lod, GrLOD_t largest_lod, - GrAspectRatio_t aspect, - GrTextureClampMode_t s_clamp_mode, - GrTextureClampMode_t t_clamp_mode, - GrTextureFilterMode_t minfilter_mode, - GrTextureFilterMode_t magfilter_mode, - float lod_bias, - FxBool trilinear - ); - -FX_ENTRY FxBool FX_CALL -guTexChangeAttributes( - GrMipMapId_t mmid, - int width, int height, - GrTextureFormat_t fmt, - GrMipMapMode_t mm_mode, - GrLOD_t smallest_lod, GrLOD_t largest_lod, - GrAspectRatio_t aspect, - GrTextureClampMode_t s_clamp_mode, - GrTextureClampMode_t t_clamp_mode, - GrTextureFilterMode_t minFilterMode, - GrTextureFilterMode_t magFilterMode - ); - -FX_ENTRY void FX_CALL -guTexCombineFunction( - GrChipID_t tmu, - GrTextureCombineFnc_t fnc - ); - -FX_ENTRY GrMipMapId_t FX_CALL -guTexGetCurrentMipMap( GrChipID_t tmu ); - -FX_ENTRY GrMipMapInfo * FX_CALL -guTexGetMipMapInfo( GrMipMapId_t mmid ); - -FX_ENTRY FxU32 FX_CALL -guTexMemQueryAvail( GrChipID_t tmu ); - -FX_ENTRY void FX_CALL -guTexMemReset( void ); - -FX_ENTRY void FX_CALL -guTexDownloadMipMap( - GrMipMapId_t mmid, - const void *src, - const GuNccTable *table - ); - -FX_ENTRY void FX_CALL -guTexDownloadMipMapLevel( - GrMipMapId_t mmid, - GrLOD_t lod, - const void **src - ); -FX_ENTRY void FX_CALL -guTexSource( GrMipMapId_t id ); - -/* -** linear frame buffer functions -*/ - -FX_ENTRY FxBool FX_CALL -grLfbLock( GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode, - GrOriginLocation_t origin, FxBool pixelPipeline, - GrLfbInfo_t *info ); - -FX_ENTRY FxBool FX_CALL -grLfbUnlock( GrLock_t type, GrBuffer_t buffer ); - -FX_ENTRY void FX_CALL -grLfbConstantAlpha( GrAlpha_t alpha ); - -FX_ENTRY void FX_CALL -grLfbConstantDepth( FxU16 depth ); - -FX_ENTRY void FX_CALL -grLfbWriteColorSwizzle(FxBool swizzleBytes, FxBool swapWords); - -FX_ENTRY void FX_CALL -grLfbWriteColorFormat(GrColorFormat_t colorFormat); - - -FX_ENTRY FxBool FX_CALL -grLfbWriteRegion( GrBuffer_t dst_buffer, - FxU32 dst_x, FxU32 dst_y, - GrLfbSrcFmt_t src_format, - FxU32 src_width, FxU32 src_height, - FxI32 src_stride, void *src_data ); - -FX_ENTRY FxBool FX_CALL -grLfbReadRegion( GrBuffer_t src_buffer, - FxU32 src_x, FxU32 src_y, - FxU32 src_width, FxU32 src_height, - FxU32 dst_stride, void *dst_data ); - - -/* -** Antialiasing Functions -*/ -FX_ENTRY void FX_CALL -grAADrawLine(const GrVertex *v1, const GrVertex *v2); - -FX_ENTRY void FX_CALL -grAADrawPoint(const GrVertex *pt ); - -FX_ENTRY void FX_CALL -grAADrawPolygon(const int nverts, const int ilist[], const GrVertex vlist[]); - -FX_ENTRY void FX_CALL -grAADrawPolygonVertexList(const int nverts, const GrVertex vlist[]); - -FX_ENTRY void FX_CALL -grAADrawTriangle( - const GrVertex *a, const GrVertex *b, const GrVertex *c, - FxBool ab_antialias, FxBool bc_antialias, FxBool ca_antialias - ); - -/* -** glide management functions -*/ -FX_ENTRY void FX_CALL -grGlideInit( void ); - -FX_ENTRY void FX_CALL -grGlideShutdown( void ); - -FX_ENTRY void FX_CALL -grGlideGetVersion( char version[80] ); - -FX_ENTRY void FX_CALL -grGlideGetState( GrState *state ); - -FX_ENTRY void FX_CALL -grGlideSetState( const GrState *state ); - -FX_ENTRY void FX_CALL -grGlideShamelessPlug(const FxBool on); - -FX_ENTRY void FX_CALL -grHints(GrHint_t hintType, FxU32 hintMask); - -#endif /* FX_GLIDE_NO_FUNC_PROTO */ - -#ifdef __cplusplus -} -#endif - -#include "glideutl.h" - -#endif /* __GLIDE_H__ */ - - -#ifndef _VOLITION_GLIDE_EXT -#define _VOLITION_GLIDE_EXT - -// Returns 1 if Glide found, else 0 if not -int vglide_init(); - -// shuts glide lib -void vglide_close(); - -extern void (__stdcall *grDrawLine)(const GrVertex *v1, const GrVertex *v2); -extern void (__stdcall *grDrawPlanarPolygon)(int nverts, const int ilist[], const GrVertex vlist[]); -extern void (__stdcall *grDrawPlanarPolygonVertexList)(int nverts, const GrVertex vlist[]); -extern void (__stdcall *grDrawPoint)(const GrVertex *pt); -extern void (__stdcall *grDrawPolygon)(int nverts, const int ilist[], const GrVertex vlist[]); -extern void (__stdcall *grDrawPolygonVertexList)(int nverts, const GrVertex vlist[]); -extern void (__stdcall *grDrawTriangle)(const GrVertex *a, const GrVertex *b, const GrVertex *c); -extern void (__stdcall *guDrawTriangleWithClip)(const GrVertex *a, const GrVertex *b, const GrVertex *c); -extern void (__stdcall *grBufferClear)(GrColor_t color, GrAlpha_t alpha, FxU16 depth); -extern int (__stdcall *grBufferNumPending)(void); -extern void (__stdcall *grBufferSwap)(int swap_interval); -extern void (__stdcall *grRenderBuffer)(GrBuffer_t buffer); - -typedef void (*GrErrorCallbackFnc_t)(const char *string, FxBool fatal); - -extern void (__stdcall *grErrorSetCallback)(GrErrorCallbackFnc_t fnc); -extern void (__stdcall *grSstIdle)(void); -extern FxU32 (__stdcall *grSstVideoLine)(void); -extern FxBool (__stdcall *grSstVRetraceOn)(void); -extern FxBool (__stdcall *grSstIsBusy)(void); -extern FxBool (__stdcall *grSstWinOpen)( - FxU32 hWnd, - GrScreenResolution_t screen_resolution, - GrScreenRefresh_t refresh_rate, - GrColorFormat_t color_format, - GrOriginLocation_t origin_location, - int nColBuffers, - int nAuxBuffers); -extern void (__stdcall *grSstWinClose)(void); -extern FxBool (__stdcall *grSstControl)(FxU32 code); -extern FxBool (__stdcall *grSstQueryHardware)(GrHwConfiguration *hwconfig); -extern FxBool (__stdcall *grSstQueryBoards)(GrHwConfiguration *hwconfig); -extern void (__stdcall *grSstOrigin)(GrOriginLocation_t origin); -extern void (__stdcall *grSstSelect)(int which_sst); -extern FxU32 (__stdcall *grSstScreenHeight)(void); -extern FxU32 (__stdcall *grSstScreenWidth)(void); -extern FxU32 (__stdcall *grSstStatus)(void); -extern void (__stdcall *grSstPerfStats)(GrSstPerfStats_t *pStats); -extern void (__stdcall *grSstResetPerfStats)(void); -extern void (__stdcall *grResetTriStats)(); -extern void (__stdcall *grTriStats)(FxU32 *trisProcessed, FxU32 *trisDrawn); -extern void (__stdcall *grAlphaBlendFunction)(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df); -extern void (__stdcall *grAlphaCombine)(GrCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, FxBool invert); -extern void (__stdcall *grAlphaControlsITRGBLighting)(FxBool enable); -extern void (__stdcall *grAlphaTestFunction)(GrCmpFnc_t function); -extern void (__stdcall *grAlphaTestReferenceValue)(GrAlpha_t value); -extern void (__stdcall *grChromakeyMode)(GrChromakeyMode_t mode); -extern void (__stdcall *grChromakeyValue)(GrColor_t value); -extern void (__stdcall *grClipWindow)(FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy); -extern void (__stdcall *grColorCombine)( - GrCombineFunction_t function, GrCombineFactor_t factor, - GrCombineLocal_t local, GrCombineOther_t other, - FxBool invert); -extern void (__stdcall *grColorMask)(FxBool rgb, FxBool a); -extern void (__stdcall *grCullMode)(GrCullMode_t mode); -extern void (__stdcall *grConstantColorValue)(GrColor_t value); -extern void (__stdcall *grConstantColorValue4)(float a, float r, float g, float b); -extern void (__stdcall *grDepthBiasLevel)(FxI16 level); -extern void (__stdcall *grDepthBufferFunction)(GrCmpFnc_t function); -extern void (__stdcall *grDepthBufferMode)(GrDepthBufferMode_t mode); -extern void (__stdcall *grDepthMask)(FxBool mask); -extern void (__stdcall *grDisableAllEffects)(void); -extern void (__stdcall *grDitherMode)( GrDitherMode_t mode); -extern void (__stdcall *grFogColorValue)( GrColor_t fogcolor); -extern void (__stdcall *grFogMode)(GrFogMode_t mode); -extern void (__stdcall *grFogTable)(const GrFog_t ft[GR_FOG_TABLE_SIZE]); -extern void (__stdcall *grGammaCorrectionValue)(float value); -extern void (__stdcall *grSplash)(float x, float y, float width, float height, FxU32 frame); -extern FxU32 (__stdcall *grTexCalcMemRequired)( - GrLOD_t lodmin, GrLOD_t lodmax, - GrAspectRatio_t aspect, GrTextureFormat_t fmt); -extern FxU32 (__stdcall *grTexTextureMemRequired)(FxU32 evenOdd, GrTexInfo *info); -extern FxU32 (__stdcall *grTexMinAddress)(GrChipID_t tmu); -extern FxU32 (__stdcall *grTexMaxAddress)(GrChipID_t tmu); -extern void (__stdcall *grTexNCCTable)(GrChipID_t tmu, GrNCCTable_t table); -extern void (__stdcall *grTexSource)(GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info); -extern void (__stdcall *grTexClampMode)(GrChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextureClampMode_t t_clampmode); -extern void (__stdcall *grTexCombine)( - GrChipID_t tmu, - GrCombineFunction_t rgb_function, - GrCombineFactor_t rgb_factor, - GrCombineFunction_t alpha_function, - GrCombineFactor_t alpha_factor, - FxBool rgb_invert, - FxBool alpha_invert - ); -extern void (__stdcall *grTexCombineFunction)( - GrChipID_t tmu, - GrTextureCombineFnc_t fnc - ); -extern void (__stdcall *grTexDetailControl)( - GrChipID_t tmu, - int lod_bias, - FxU8 detail_scale, - float detail_max - ); -extern void (__stdcall *grTexFilterMode)( - GrChipID_t tmu, - GrTextureFilterMode_t minfilter_mode, - GrTextureFilterMode_t magfilter_mode - ); -extern void (__stdcall *grTexLodBiasValue)(GrChipID_t tmu, float bias); -extern void (__stdcall *grTexDownloadMipMap)(GrChipID_t tmu, - FxU32 startAddress, - FxU32 evenOdd, - GrTexInfo *info); - -extern void (__stdcall *grTexDownloadMipMapLevel)(GrChipID_t tmu, - FxU32 startAddress, - GrLOD_t thisLod, - GrLOD_t largeLod, - GrAspectRatio_t aspectRatio, - GrTextureFormat_t format, - FxU32 evenOdd, - void *data); - -extern void (__stdcall *grTexDownloadMipMapLevelPartial)(GrChipID_t tmu, - FxU32 startAddress, - GrLOD_t thisLod, - GrLOD_t largeLod, - GrAspectRatio_t aspectRatio, - GrTextureFormat_t format, - FxU32 evenOdd, - void *data, - int start, - int end); - - -extern void (__stdcall *ConvertAndDownloadRle)(GrChipID_t tmu, - FxU32 startAddress, - GrLOD_t thisLod, - GrLOD_t largeLod, - GrAspectRatio_t aspectRatio, - GrTextureFormat_t format, - FxU32 evenOdd, - FxU8 *bm_data, - long bm_h, - FxU32 u0, - FxU32 v0, - FxU32 width, - FxU32 height, - FxU32 dest_width, - FxU32 dest_height, - FxU16 *tlut); - -extern void (__stdcall *grCheckForRoom)(FxI32 n); - -extern void (__stdcall *grTexDownloadTable)(GrChipID_t tmu, - GrTexTable_t type, - void *data); - -extern void (__stdcall *grTexDownloadTablePartial)(GrChipID_t tmu, - GrTexTable_t type, - void *data, - int start, - int end); - -extern void (__stdcall *grTexMipMapMode)(GrChipID_t tmu, - GrMipMapMode_t mode, - FxBool lodBlend); - -extern void (__stdcall *grTexMultibase)(GrChipID_t tmu, - FxBool enable); - -extern void (__stdcall *grTexMultibaseAddress)(GrChipID_t tmu, - GrTexBaseRange_t range, - FxU32 startAddress, - FxU32 evenOdd, - GrTexInfo *info); - -extern GrMipMapId_t (__stdcall *guTexAllocateMemory)( - GrChipID_t tmu, - FxU8 odd_even_mask, - int width, int height, - GrTextureFormat_t fmt, - GrMipMapMode_t mm_mode, - GrLOD_t smallest_lod, GrLOD_t largest_lod, - GrAspectRatio_t aspect, - GrTextureClampMode_t s_clamp_mode, - GrTextureClampMode_t t_clamp_mode, - GrTextureFilterMode_t minfilter_mode, - GrTextureFilterMode_t magfilter_mode, - float lod_bias, - FxBool trilinear - ); - -extern FxBool (__stdcall *guTexChangeAttributes)( - GrMipMapId_t mmid, - int width, int height, - GrTextureFormat_t fmt, - GrMipMapMode_t mm_mode, - GrLOD_t smallest_lod, GrLOD_t largest_lod, - GrAspectRatio_t aspect, - GrTextureClampMode_t s_clamp_mode, - GrTextureClampMode_t t_clamp_mode, - GrTextureFilterMode_t minFilterMode, - GrTextureFilterMode_t magFilterMode - ); -extern void (__stdcall *guTexCombineFunction)( - GrChipID_t tmu, - GrTextureCombineFnc_t fnc - ); -extern GrMipMapId_t (__stdcall *guTexGetCurrentMipMap)(GrChipID_t tmu); -extern GrMipMapInfo* (__stdcall *guTexGetMipMapInfo)(GrMipMapId_t mmid); -extern FxU32 (__stdcall *guTexMemQueryAvail)(GrChipID_t tmu); -extern void (__stdcall *guTexMemReset)(void); -extern void (__stdcall *guTexDownloadMipMap)( - GrMipMapId_t mmid, - const void *src, - const GuNccTable *table - ); -extern void (__stdcall *guTexDownloadMipMapLevel)( - GrMipMapId_t mmid, - GrLOD_t lod, - const void **src - ); -extern void (__stdcall *guTexSource)(GrMipMapId_t id); -extern void (__stdcall *guColorCombineFunction)(GrColorCombineFnc_t fnc); - -extern FxBool (__stdcall *grLfbLock)( GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode, - GrOriginLocation_t origin, FxBool pixelPipeline, - GrLfbInfo_t *info); -extern FxBool (__stdcall *grLfbUnlock)(GrLock_t type, GrBuffer_t buffer); -extern void (__stdcall *grLfbConstantAlpha)(GrAlpha_t alpha); -extern void (__stdcall *grLfbConstantDepth)(FxU16 depth); -extern void (__stdcall *grLfbWriteColorSwizzle)(FxBool swizzleBytes, FxBool swapWords); -extern void (__stdcall *grLfbWriteColorFormat)(GrColorFormat_t colorFormat); -extern FxBool (__stdcall *grLfbWriteRegion)(GrBuffer_t dst_buffer, - FxU32 dst_x, FxU32 dst_y, - GrLfbSrcFmt_t src_format, - FxU32 src_width, FxU32 src_height, - FxI32 src_stride, void *src_data); - -extern FxBool (__stdcall *grLfbReadRegion)(GrBuffer_t src_buffer, - FxU32 src_x, FxU32 src_y, - FxU32 src_width, FxU32 src_height, - FxU32 dst_stride, void *dst_data); - -extern void (__stdcall *grAADrawLine)(const GrVertex *v1, const GrVertex *v2); -extern void (__stdcall *grAADrawPoint)(const GrVertex *pt); -extern void (__stdcall *grAADrawPolygon)(const int nverts, const int ilist[], const GrVertex vlist[]); -extern void (__stdcall *grAADrawPolygonVertexList)(const int nverts, const GrVertex vlist[]); -extern void (__stdcall *grAADrawTriangle)( - const GrVertex *a, const GrVertex *b, const GrVertex *c, - FxBool ab_antialias, FxBool bc_antialias, FxBool ca_antialias - ); -extern void (__stdcall *grGlideInit)(void); -extern void (__stdcall *grGlideShutdown)(void); -extern void (__stdcall *grGlideGetVersion)(char version[80]); -extern void (__stdcall *grGlideGetState)(GrState *state); -extern void (__stdcall *grGlideSetState)( const GrState *state); -extern void (__stdcall *grGlideShamelessPlug)(const FxBool on); -extern void (__stdcall *grHints)(GrHint_t hintType, FxU32 hintMask); - -extern float (__stdcall *guFogTableIndexToW)(int i); -extern void (__stdcall *guFogGenerateExp)( GrFog_t fogtable[GR_FOG_TABLE_SIZE], float density ); -extern void (__stdcall *guFogGenerateExp2)( GrFog_t fogtable[GR_FOG_TABLE_SIZE], float density ); -extern void (__stdcall *guFogGenerateLinear)( GrFog_t fogtable[GR_FOG_TABLE_SIZE], float nearZ, float farZ ); - -#endif //_VOLITION_GLIDE_EXT - diff --git a/include/glidesys.h b/include/glidesys.h deleted file mode 100644 index fc8430a..0000000 --- a/include/glidesys.h +++ /dev/null @@ -1,128 +0,0 @@ -/* -** Copyright (c) 1995, 3Dfx Interactive, Inc. -** All Rights Reserved. -** -** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.; -** the contents of this file may not be disclosed to third parties, copied or -** duplicated in any form, in whole or in part, without the prior written -** permission of 3Dfx Interactive, Inc. -** -** RESTRICTED RIGHTS LEGEND: -** Use, duplication or disclosure by the Government is subject to restrictions -n** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data -** and Computer Software clause at DFARS 252.227-7013, and/or in similar or -** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - -** rights reserved under the Copyright Laws of the United States. -** -** $Header$ -** $Log$ -** Revision 1.1 2002/05/03 03:28:12 root -** Initial revision -** - * - * 2 10/07/98 10:52a Dave - * Initial checkin. - * - * 1 10/07/98 10:48a Dave - * - * 2 2/27/98 3:25p Frank - * (John/Frank K.) updated to 2.43 headers - * - * 1 10/16/97 11:51a Klier -*/ -#ifndef __GLIDESYS_H__ -#define __GLIDESYS_H__ - -/* -n** ----------------------------------------------------------------------- -** COMPILER/ENVIRONMENT CONFIGURATION -** ----------------------------------------------------------------------- -*/ - -/* Endianness is stored in bits [30:31] */ -#define GLIDE_ENDIAN_SHIFT 30 -#define GLIDE_ENDIAN_LITTLE (0x1 << GLIDE_ENDIAN_SHIFT) -#define GLIDE_ENDIAN_BIG (0x2 << GLIDE_ENDIAN_SHIFT) - -/* OS is stored in bits [0:6] */ -#define GLIDE_OS_SHIFT 0 -#define GLIDE_OS_UNIX 0x1 -#define GLIDE_OS_DOS32 0x2 -#define GLIDE_OS_WIN32 0x4 -#define GLIDE_OS_SYSTEM7 0x8 -#define GLIDE_OS_OS2 0x10 -#define GLIDE_OS_OTHER 0x20 /* For Proprietary Arcade HW */ - -/* Sim vs. Hardware is stored in bits [7:8] */ -#define GLIDE_SST_SHIFT 7 -#define GLIDE_SST_SIM (0x1 << GLIDE_SST_SHIFT) -#define GLIDE_SST_HW (0x2 << GLIDE_SST_SHIFT ) - -/* Hardware Type is stored in bits [9:12] */ -#define GLIDE_HW_SHIFT 9 -#define GLIDE_HW_SST1 (0x1 << GLIDE_HW_SHIFT) -#define GLIDE_HW_SST96 (0x2 << GLIDE_HW_SHIFT) -#define GLIDE_HW_SSTH3 (0x4 << GLIDE_HW_SHIFT) -#define GLIDE_HW_SST2 (0x8 << GLIDE_HW_SHIFT) - -/* -** Make sure we handle all instances of WIN32 -*/ -#ifndef __WIN32__ -# if defined ( _WIN32 ) || defined (WIN32) || defined(__NT__) -# define __WIN32__ -# endif -#endif - -/* We need two checks on the OS: one for endian, the other for OS */ -/* Check for endianness */ -#if defined(__IRIX__) || defined(__sparc__) || defined(MACOS) -# define GLIDE_ENDIAN GLIDE_ENDIAN_BIG -#else -# define GLIDE_ENDIAN GLIDE_ENDIAN_LITTLE -#endif - -/* Check for OS */ -#if defined(__IRIX__) || defined(__sparc__) || defined(__linux__) -# define GLIDE_OS GLIDE_OS_UNIX -#elif defined(__DOS__) -# define GLIDE_OS GLIDE_OS_DOS32 -#elif defined(__WIN32__) -# define GLIDE_OS GLIDE_OS_WIN32 -#endif - -/* Check for Simulator vs. Hardware */ -#ifdef GLIDE_SIMULATOR -# define GLIDE_SST GLIDE_SST_SIM -#else -# define GLIDE_SST GLIDE_SST_HW -#endif - -/* Check for type of hardware */ -#ifdef SST96 -# define GLIDE_HW GLIDE_HW_SST96 -#elif defined(SSTH3) -# define GLIDE_HW GLIDE_HW_SSTH3 -#elif defined(SST2) -# define GLIDE_HW GLIDE_HW_SST2 -#else /* Default to SST1 */ -# define GLIDE_HW GLIDE_HW_SST1 -#endif - - -#define GLIDE_PLATFORM (GLIDE_ENDIAN | GLIDE_OS | GLIDE_SST | GLIDE_HW) - -/* -** Control the number of TMUs -*/ -#ifndef GLIDE_NUM_TMU -# define GLIDE_NUM_TMU 2 -#endif - - -#if ( ( GLIDE_NUM_TMU < 0 ) && ( GLIDE_NUM_TMU > 3 ) ) -# error "GLIDE_NUM_TMU set to an invalid value" -#endif - -#endif /* __GLIDESYS_H__ */ - diff --git a/include/glideutl.h b/include/glideutl.h deleted file mode 100644 index c047f23..0000000 --- a/include/glideutl.h +++ /dev/null @@ -1,133 +0,0 @@ -/* -** Copyright (c) 1995, 3Dfx Interactive, Inc. -** All Rights Reserved. -** -** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.; -** the contents of this file may not be disclosed to third parties, copied or -** duplicated in any form, in whole or in part, without the prior written -** permission of 3Dfx Interactive, Inc. -** -** RESTRICTED RIGHTS LEGEND: -** Use, duplication or disclosure by the Government is subject to restrictions -** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data -** and Computer Software clause at DFARS 252.227-7013, and/or in similar or -** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - -** rights reserved under the Copyright Laws of the United States. -** -** $Header$ -** $Log$ -** Revision 1.1 2002/05/03 03:28:12 root -** Initial revision -** - * - * 2 10/07/98 10:52a Dave - * Initial checkin. - * - * 1 10/07/98 10:48a Dave - * - * 2 2/27/98 3:25p Frank - * (John/Frank K.) updated to 2.43 headers - * - * 1 10/16/97 11:51a Klier - * - * 6 8/14/97 5:32p Pgj - * remove dead code per GMT - * - * 5 6/12/97 5:19p Pgj - * Fix bug 578 - * - * 4 3/05/97 9:36p Jdt - * Removed guFbWriteRegion added guEncodeRLE16 - * - * 3 1/16/97 3:45p Dow - * Embedded fn protos in ifndef FX_GLIDE_NO_FUNC_PROTO -*/ - -/* Glide Utility routines */ - -#ifndef __GLIDEUTL_H__ -#define __GLIDEUTL_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef FX_GLIDE_NO_FUNC_PROTO -/* -** rendering functions -*/ -FX_ENTRY void FX_CALL -guAADrawTriangleWithClip( const GrVertex *a, const GrVertex - *b, const GrVertex *c); - -FX_ENTRY void FX_CALL -guDrawTriangleWithClip( - const GrVertex *a, - const GrVertex *b, - const GrVertex *c - ); - -FX_ENTRY void FX_CALL -guDrawPolygonVertexListWithClip( int nverts, const GrVertex vlist[] ); - -/* -** hi-level rendering utility functions -*/ -FX_ENTRY void FX_CALL -guAlphaSource( GrAlphaSource_t mode ); - -FX_ENTRY void FX_CALL -guColorCombineFunction( GrColorCombineFnc_t fnc ); - -FX_ENTRY int FX_CALL -guEncodeRLE16( void *dst, - void *src, - FxU32 width, - FxU32 height ); - -FX_ENTRY FxU16 * FX_CALL -guTexCreateColorMipMap( void ); - -/* -** fog stuff -*/ -FX_ENTRY float FX_CALL -guFogTableIndexToW( int i ); - -FX_ENTRY void FX_CALL -guFogGenerateExp( GrFog_t fogtable[GR_FOG_TABLE_SIZE], float density ); - -FX_ENTRY void FX_CALL -guFogGenerateExp2( GrFog_t fogtable[GR_FOG_TABLE_SIZE], float density ); - -FX_ENTRY void FX_CALL -guFogGenerateLinear( - GrFog_t fogtable[GR_FOG_TABLE_SIZE], - float nearZ, float farZ ); - -/* -** endian stuff -*/ -FX_ENTRY FxU32 FX_CALL -guEndianSwapWords( FxU32 value ); - -FX_ENTRY FxU16 FX_CALL -guEndianSwapBytes( FxU16 value ); - -/* -** hi-level texture manipulation tools. -*/ -FX_ENTRY FxBool FX_CALL -gu3dfGetInfo( const char *filename, Gu3dfInfo *info ); - -FX_ENTRY FxBool FX_CALL -gu3dfLoad( const char *filename, Gu3dfInfo *data ); - -#endif /* FX_GLIDE_NO_FUNC_PROTO */ - -#ifdef __cplusplus -} -#endif - -#endif /* __GLIDEUTL_H__ */ - diff --git a/include/gradient.h b/include/gradient.h deleted file mode 100644 index 711ded1..0000000 --- a/include/gradient.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) Volition, Inc. 1999. All rights reserved. - * - * All source code herein is the property of Volition, Inc. You may not sell - * or otherwise commercially exploit the source or things you created based on - * the source. - */ - -/* - * $Logfile: /Freespace2/code/Graphics/Gradient.h $ - * $Revision$ - * $Date$ - * $Author$ - * - * Prototype for Gradient.cpp - * - * $Log$ - * Revision 1.2 2002/06/09 04:41:13 relnev - * added copyright header - * - * Revision 1.1.1.1 2002/05/03 03:28:12 root - * Initial import. - * - * - * 2 10/07/98 10:52a Dave - * Initial checkin. - * - * 1 10/07/98 10:49a Dave - * - * 6 5/06/98 5:30p John - * Removed unused cfilearchiver. Removed/replaced some unused/little used - * graphics functions, namely gradient_h and _v and pixel_sp. Put in new - * DirectX header files and libs that fixed the Direct3D alpha blending - * problems. - * - * 5 3/10/98 4:18p John - * Cleaned up graphics lib. Took out most unused gr functions. Made D3D - * & Glide have popups and print screen. Took out all >8bpp software - * support. Made Fred zbuffer. Made zbuffer allocate dynamically to - * support Fred. Made zbuffering key off of functions rather than one - * global variable. - * - * 4 11/30/97 12:18p John - * added more 24 & 32-bpp primitives - * - * 3 6/11/97 1:12p John - * Started fixing all the text colors in the game. - * - * 2 11/18/96 4:34p Allender - * new 16 bit gradient functions - * - * 1 10/26/96 1:45p John - * Initial skeletion code. - * - * $NoKeywords: $ - */ - -#ifndef _GRADIENT_H -#define _GRADIENT_H - -extern void gr8_gradient(int x1,int y1,int x2,int y2); - -#endif - diff --git a/include/grd3d.h b/include/grd3d.h deleted file mode 100644 index 0ae1a56..0000000 --- a/include/grd3d.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) Volition, Inc. 1999. All rights reserved. - * - * All source code herein is the property of Volition, Inc. You may not sell - * or otherwise commercially exploit the source or things you created based on - * the source. - */ - -/* - * $Logfile: /Freespace2/code/Graphics/GrD3D.h $ - * $Revision$ - * $Date$ - * $Author$ - * - * Include file for our Direct3D renderer - * - * $Log$ - * Revision 1.2 2002/06/09 04:41:13 relnev - * added copyright header - * - * Revision 1.1.1.1 2002/05/03 03:28:12 root - * Initial import. - * - * - * 6 9/13/99 11:25p Dave - * Fixed problem with mode-switching and D3D movies. - * - * 5 9/04/99 8:00p Dave - * Fixed up 1024 and 32 bit movie support. - * - * 4 6/29/99 10:35a Dave - * Interface polygon bitmaps! Whee! - * - * 3 1/15/99 11:29a Neilk - * Fixed D3D screen/texture pixel formatting problem. - * - * 2 10/07/98 10:52a Dave - * Initial checkin. - * - * 1 10/07/98 10:49a Dave - * - * 2 5/12/97 12:27p John - * Restructured Graphics Library to add support for multiple renderers. - * - * 1 5/01/97 2:17p John - * - * $NoKeywords: $ - */ - -#ifndef _GRD3D_H -#define _GRD3D_H - -void gr_d3d_init(); -void gr_d3d_cleanup(); - -// call this to safely fill in the texture shift and scale values for the specified texture type (Gr_t_*) -void gr_d3d_get_tex_format(int alpha); - -// bitmap functions -void gr_d3d_bitmap(int x, int y); -void gr_d3d_bitmap_ex(int x, int y, int w, int h, int sx, int sy); - -// create all rendering objects (surfaces, d3d device, viewport, etc) -int gr_d3d_create_rendering_objects(int clear); -void gr_d3d_release_rendering_objects(); - - -void gr_d3d_set_initial_render_state(); - -#endif - diff --git a/include/grd3dinternal.h b/include/grd3dinternal.h deleted file mode 100644 index 282e200..0000000 --- a/include/grd3dinternal.h +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (C) Volition, Inc. 1999. All rights reserved. - * - * All source code herein is the property of Volition, Inc. You may not sell - * or otherwise commercially exploit the source or things you created based on - * the source. - */ - -/* - * $Logfile: /Freespace2/code/Graphics/GrD3DInternal.h $ - * $Revision$ - * $Date$ - * $Author$ - * - * Prototypes for the variables used internally by the Direct3D renderer - * - * $Log$ - * Revision 1.3 2004/09/20 01:31:44 theoddone33 - * GCC 3.4 fixes. - * - * Revision 1.2 2002/06/09 04:41:13 relnev - * added copyright header - * - * Revision 1.1.1.1 2002/05/03 03:28:12 root - * Initial import. - * - * - * 5 7/13/99 1:15p Dave - * 32 bit support. Whee! - * - * 4 7/09/99 9:51a Dave - * Added thick polyline code. - * - * 3 6/29/99 10:35a Dave - * Interface polygon bitmaps! Whee! - * - * 2 10/07/98 10:52a Dave - * Initial checkin. - * - * 1 10/07/98 10:49a Dave - * - * 21 5/23/98 4:14p John - * Added code to preload textures to video card for AGP. Added in code - * to page in some bitmaps that weren't getting paged in at level start. - * - * 20 5/20/98 9:45p John - * added code so the places in code that change half the palette don't - * have to clear the screen. - * - * 19 5/12/98 10:34a John - * Added d3d_shade functionality. Added d3d_flush function, since the - * shader seems to get reorganzed behind the overlay text stuff! - * - * 18 5/12/98 8:18a John - * Put in code to use a different texture format for alpha textures and - * normal textures. Turned off filtering for aabitmaps. Took out - * destblend=invsrccolor alpha mode that doesn't work on riva128. - * - * 17 5/11/98 10:19a John - * Added caps checking - * - * 16 5/07/98 3:02p John - * Mpre texture cleanup. You can now reinit d3d without a crash. - * - * 15 5/07/98 9:54a John - * Added in palette flash functionallity. - * - * 14 5/06/98 11:21p John - * Fixed a bitmap bug with Direct3D. Started adding new caching code into - * D3D. - * - * 13 5/06/98 8:41p John - * Fixed some font clipping bugs. Moved texture handle set code for d3d - * into the texture module. - * - * 12 5/06/98 5:30p John - * Removed unused cfilearchiver. Removed/replaced some unused/little used - * graphics functions, namely gradient_h and _v and pixel_sp. Put in new - * DirectX header files and libs that fixed the Direct3D alpha blending - * problems. - * - * 11 5/05/98 10:37p John - * Added code to optionally use execute buffers. - * - * 10 5/04/98 3:36p John - * Got zbuffering working with Direct3D. - * - * 9 4/14/98 12:15p John - * Made 16-bpp movies work. - * - * 8 3/12/98 5:36p John - * Took out any unused shaders. Made shader code take rgbc instead of - * matrix and vector since noone used it like a matrix and it would have - * been impossible to do in hardware. Made Glide implement a basic - * shader for online help. - * - * 7 3/10/98 4:18p John - * Cleaned up graphics lib. Took out most unused gr functions. Made D3D - * & Glide have popups and print screen. Took out all >8bpp software - * support. Made Fred zbuffer. Made zbuffer allocate dynamically to - * support Fred. Made zbuffering key off of functions rather than one - * global variable. - * - * 6 3/09/98 6:06p John - * Restructured font stuff to avoid duplicate code in Direct3D and Glide. - * Restructured Glide to avoid redundent state setting. - * - * 5 3/08/98 12:33p John - * Made d3d cleanup free textures. Made d3d always divide texture size by - * 2 for now. - * - * 4 3/07/98 8:29p John - * Put in some Direct3D features. Transparency on bitmaps. Made fonts & - * aabitmaps render nice. - * - * 3 2/17/98 7:28p John - * Got fonts and texturing working in Direct3D - * - * 2 2/07/98 7:50p John - * Added code so that we can use the old blending type of alphacolors if - * we want to. Made the stars use them. - * - * 1 2/03/98 9:24p John - * - * $NoKeywords: $ - */ - - -#ifndef _GRD3DINTERNAL_H -#define _GRD3DINTERNAL_H - -#include -#include - -#define D3D_OVERLOADS -#include "vddraw.h" - -// To remove an otherwise well-lodged compiler error -// 4201 nonstandard extension used : nameless struct/union (happens a lot in Windows include headers) -#pragma warning(disable: 4201) - -#include "vd3d.h" -#include "2d.h" -#include "grinternal.h" - - -extern LPDIRECTDRAW lpDD1; -extern LPDIRECTDRAW2 lpDD; -extern LPDIRECT3D2 lpD3D; -extern LPDIRECT3DDEVICE lpD3DDeviceEB; -extern LPDIRECT3DDEVICE2 lpD3DDevice; -extern LPDIRECTDRAWSURFACE lpBackBuffer; -extern LPDIRECTDRAWSURFACE lpFrontBuffer; -extern LPDIRECTDRAWSURFACE lpZBuffer; - -extern LPDIRECT3DVIEWPORT2 lpViewport; -extern LPDIRECTDRAWPALETTE lpPalette; - -extern DDPIXELFORMAT AlphaTextureFormat; -extern DDPIXELFORMAT NonAlphaTextureFormat; -extern DDPIXELFORMAT ScreenFormat; - -extern D3DDEVICEDESC D3DHWDevDesc, D3DHELDevDesc; -extern LPD3DDEVICEDESC lpDevDesc; -extern DDCAPS DD_driver_caps; -extern DDCAPS DD_hel_caps; - -extern int D3D_texture_divider; - -extern int D3D_32bit; - -extern char* d3d_error_string(HRESULT error); - -void d3d_tcache_init(int use_sections); -void d3d_tcache_cleanup(); -void d3d_tcache_flush(); -void d3d_tcache_frame(); - -// Flushes any pending operations -void d3d_flush(); - -int d3d_tcache_set(int bitmap_id, int bitmap_type, float *u_ratio, float *v_ratio, int fail_on_full=0, int sx = -1, int sy = -1, int force = 0); - -// Functions in GrD3DRender.cpp stuffed into gr_screen structure - -void gr_d3d_flash(int r, int g, int b); -void gr_d3d_zbuffer_clear(int mode); -int gr_d3d_zbuffer_get(); -int gr_d3d_zbuffer_set(int mode); -void gr_d3d_tmapper( int nverts, vertex **verts, uint flags ); -void gr_d3d_scaler(vertex *va, vertex *vb ); -void gr_d3d_aascaler(vertex *va, vertex *vb ); -void gr_d3d_pixel(int x, int y); -void gr_d3d_clear(); -void gr_d3d_set_clip(int x,int y,int w,int h); -void gr_d3d_reset_clip(); -void gr_d3d_init_color(color *c, int r, int g, int b); -void gr_d3d_init_alphacolor( color *clr, int r, int g, int b, int alpha, int type=AC_TYPE_HUD ); -void gr_d3d_set_color( int r, int g, int b ); -void gr_d3d_get_color( int * r, int * g, int * b ); -void gr_d3d_set_color_fast(color *dst); -void gr_d3d_set_bitmap( int bitmap_num, int alphablend_mode=GR_ALPHABLEND_NONE, int bitblt_mode=GR_BITBLT_MODE_NORMAL, float alpha=1.0f, int sx=-1, int sy=-1 ); -void gr_d3d_bitmap_ex(int x,int y,int w,int h,int sx,int sy); -void gr_d3d_bitmap(int x, int y); -void gr_d3d_aabitmap_ex(int x,int y,int w,int h,int sx,int sy); -void gr_d3d_aabitmap(int x, int y); -void gr_d3d_rect(int x,int y,int w,int h); -void gr_d3d_create_shader(shader * shade, float r, float g, float b, float c ); -void gr_d3d_set_shader( shader * shade ); -void gr_d3d_shade(int x,int y,int w,int h); -void gr_d3d_create_font_bitmap(); -void gr_d3d_char(int x,int y,int letter); -void gr_d3d_string( int sx, int sy, char *s ); -void gr_d3d_circle( int xc, int yc, int d ); -void gr_d3d_line(int x1,int y1,int x2,int y2); -void gr_d3d_aaline(vertex *v1, vertex *v2); -void gr_d3d_gradient(int x1,int y1,int x2,int y2); -void gr_d3d_set_palette(ubyte *new_palette, int restrict_alphacolor = 0); -void gr_d3d_diamond(int x, int y, int width, int height); -void gr_d3d_print_screen(char *filename); - -void gr_d3d_fog_set(int fog_mode, int r, int g, int b, float fog_near = -1.0f, float fog_far = -1.0f); - -// Functions used to render. Calls either DrawPrim or Execute buffer code -HRESULT d3d_SetRenderState( D3DRENDERSTATETYPE dwRenderStateType, DWORD dwRenderState ); -HRESULT d3d_DrawPrimitive( D3DPRIMITIVETYPE dptPrimitiveType, D3DVERTEXTYPE dvtVertexType, LPVOID lpvVertices, DWORD dwVertexCount, DWORD dwFlags ); - -#endif //_GRD3DINTERNAL_H - diff --git a/include/grdirectdraw.h b/include/grdirectdraw.h deleted file mode 100644 index 84cea93..0000000 --- a/include/grdirectdraw.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) Volition, Inc. 1999. All rights reserved. - * - * All source code herein is the property of Volition, Inc. You may not sell - * or otherwise commercially exploit the source or things you created based on - * the source. - */ - -/* - * $Logfile: /Freespace2/code/Graphics/GrDirectDraw.h $ - * $Revision$ - * $Date$ - * $Author$ - * - * Include file for software 8-bpp rendering using DirectDraw - * - * $Log$ - * Revision 1.2 2002/06/09 04:41:13 relnev - * added copyright header - * - * Revision 1.1.1.1 2002/05/03 03:28:12 root - * Initial import. - * - * - * 2 10/07/98 10:52a Dave - * Initial checkin. - * - * 1 10/07/98 10:49a Dave - * - * 1 3/25/98 8:07p John - * Split software renderer into Win32 and DirectX - * - * $NoKeywords: $ - */ - - -#ifndef _GRDIRECTDRAW_H -#define _GRDIRECTDRAW_H - -void gr_directdraw_init(); -void gr_directdraw_cleanup(); - -#endif //_GRDIRECTDRAW_H - diff --git a/include/grglide.h b/include/grglide.h deleted file mode 100644 index 78f9fbc..0000000 --- a/include/grglide.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) Volition, Inc. 1999. All rights reserved. - * - * All source code herein is the property of Volition, Inc. You may not sell - * or otherwise commercially exploit the source or things you created based on - * the source. - */ - -/* - * $Logfile: /Freespace2/code/Graphics/GrGlide.h $ - * $Revision$ - * $Date$ - * $Author$ - * - * Include file for a 3DFX's Glide graphics lib - * - * $Log$ - * Revision 1.2 2002/06/09 04:41:13 relnev - * added copyright header - * - * Revision 1.1.1.1 2002/05/03 03:28:12 root - * Initial import. - * - * - * 3 6/29/99 10:35a Dave - * Interface polygon bitmaps! Whee! - * - * 2 10/07/98 10:53a Dave - * Initial checkin. - * - * 1 10/07/98 10:49a Dave - * - * 1 5/12/97 12:13p John - * - * $NoKeywords: $ - */ - -#ifndef _GRGLIDE_H -#define _GRGLIDE_H - -void gr_glide_init(); -void gr_glide_cleanup(); - -void gr_glide_bitmap(int x, int y); -void gr_glide_bitmap_ex(int x, int y, int w, int h, int sx, int sy); - -#endif - diff --git a/include/grglideinternal.h b/include/grglideinternal.h deleted file mode 100644 index 277fe8a..0000000 --- a/include/grglideinternal.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) Volition, Inc. 1999. All rights reserved. - * - * All source code herein is the property of Volition, Inc. You may not sell - * or otherwise commercially exploit the source or things you created based on - * the source. - */ - -/* - * $Logfile: /Freespace2/code/Graphics/GrGlideInternal.h $ - * $Revision$ - * $Date$ - * $Author$ - * - * Common include file for Glide modules - * - * $Log$ - * Revision 1.2 2002/06/09 04:41:13 relnev - * added copyright header - * - * Revision 1.1.1.1 2002/05/03 03:28:12 root - * Initial import. - * - * - * 4 7/09/99 9:51a Dave - * Added thick polyline code. - * - * 3 6/29/99 10:35a Dave - * Interface polygon bitmaps! Whee! - * - * 2 10/07/98 10:53a Dave - * Initial checkin. - * - * 1 10/07/98 10:49a Dave - * - * 4 5/06/98 11:21p John - * Fixed a bitmap bug with Direct3D. Started adding new caching code into - * D3D. - * - * 3 4/09/98 4:38p John - * Made non-darkening and transparent textures work under Glide. Fixed - * bug with Jim's computer not drawing any bitmaps. - * - * 2 4/08/98 8:47a John - * Moved all texture caching into a new module - * - * 1 3/03/98 4:42p John - * Added in Leighton's code to do texture caching on Glide. - * - * $NoKeywords: $ - */ - -#ifndef _GRGLIDEINTERNAL_H -#define _GRGLIDEINTERNAL_H - -#include "grinternal.h" - -void glide_tcache_init(); -void glide_tcache_cleanup(); -void glide_tcache_flush(); -void glide_tcache_frame(); - -// Bitmap_type see TCACHE_ defines in GrInternal.h -int glide_tcache_set(int bitmap_id, int bitmap_type, float *u_ratio, float *v_ratio, int fail_on_full = 0, int sx = -1, int sy = -1, int force = 0); - -extern int Glide_textures_in; - -#endif //_GRGLIDEINTERNAL_H - diff --git a/include/grinternal.h b/include/grinternal.h index 8b0b2c5..d77ac05 100644 --- a/include/grinternal.h +++ b/include/grinternal.h @@ -144,9 +144,6 @@ extern int Gr_cursor; -#define GR_SCREEN_PTR(type,x,y) ((type *)(ptr_u(gr_screen.offscreen_buffer) + ptr_u(((x)+gr_screen.offset_x)*sizeof(type)) + ptr_u(((y)+gr_screen.offset_y)*gr_screen.rowsize))) -#define GR_SCREEN_PTR_SIZE(bpp,x,y) ((ptr_u)(ptr_u(gr_screen.offscreen_buffer) + ptr_u(((x)+gr_screen.offset_x)*(bpp)) + ptr_u(((y)+gr_screen.offset_y)*gr_screen.rowsize))) - extern ubyte Gr_original_palette[768]; // The palette extern ubyte Gr_current_palette[768]; @@ -155,24 +152,8 @@ typedef struct alphacolor { int r,g,b,alpha; int type; // See AC_TYPE_??? define color *clr; - /* - union { - ubyte lookup[16][256]; // For 8-bpp rendering modes - } table; - */ } alphacolor; -// for backwards fred aabitmap compatibility -typedef struct alphacolor_old { - int used; - int r,g,b,alpha; - int type; // See AC_TYPE_??? define - color *clr; - union { - ubyte lookup[16][256]; // For 8-bpp rendering modes - } table; -} alphacolor_old; - extern alphacolor * Current_alphacolor; void gr_init_alphacolors(); diff --git a/include/grsoft.h b/include/grsoft.h deleted file mode 100644 index a5c1c98..0000000 --- a/include/grsoft.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) Volition, Inc. 1999. All rights reserved. - * - * All source code herein is the property of Volition, Inc. You may not sell - * or otherwise commercially exploit the source or things you created based on - * the source. - */ - -/* - * $Logfile: /Freespace2/code/Graphics/GrSoft.h $ - * $Revision$ - * $Date$ - * $Author$ - * - * Include file for our software renderer - * - * $Log$ - * Revision 1.2 2002/06/09 04:41:13 relnev - * added copyright header - * - * Revision 1.1.1.1 2002/05/03 03:28:12 root - * Initial import. - * - * - * 3 6/29/99 10:35a Dave - * Interface polygon bitmaps! Whee! - * - * 2 10/07/98 10:53a Dave - * Initial checkin. - * - * 1 10/07/98 10:49a Dave - * - * 2 3/25/98 8:07p John - * Restructured software rendering into two modules; One for windowed - * debug mode and one for DirectX fullscreen. - * - * 1 5/12/97 12:14p John - * - * $NoKeywords: $ - */ - -#ifndef _GRSOFT_H -#define _GRSOFT_H - -void gr_soft_init(); -void gr_soft_cleanup(); - - -// Functions/variables common between grsoft and grdirectdraw -extern int Grx_mouse_saved; -void grx_save_mouse_area(int x, int y, int w, int h ); -void grx_restore_mouse_area(); -void grx_print_screen(char * filename); -int gr8_save_screen(); -void gr8_restore_screen(int id); -void gr8_free_screen(int id); -void gr8_dump_frame_start(int first_frame, int frames_between_dumps); -void gr8_dump_frame(); -void gr8_dump_frame_stop(); -void gr8_set_gamma(float gamma); - -// bitmap functions -void grx_bitmap(int x, int y); -void grx_bitmap_ex(int x, int y, int w, int h, int sx, int sy); - -#endif - diff --git a/include/line.h b/include/line.h index d1ef07b..df421ee 100644 --- a/include/line.h +++ b/include/line.h @@ -62,9 +62,6 @@ #ifndef _LINE_H #define _LINE_H - -void gr8_line(int x1,int y1,int x2,int y2); -void gr8_aaline(vertex *v1, vertex *v2); #define INT_EXCHG(a,b) do { \ diff --git a/include/model.h b/include/model.h index 5a09264..0712d30 100644 --- a/include/model.h +++ b/include/model.h @@ -1062,18 +1062,6 @@ int model_which_octant( vector *pnt, int model_num,matrix *model_orient, vector // Only enabled if MR_SHOW_THRUSTERS is on void model_set_thrust(int model_num, float length, int bitmapnum, int glow_bitmapnum=-1, float glow_noise=1.0f); -//========================================================= -// model caching - -// Call once to init the model caching stuff -void model_cache_init(); - -// Call before every level to clean up the model caching stuff -void model_cache_reset(); - -// If TRUE, then model caching is enabled -extern int Model_caching; - //======================================================================================= // Finds the closest point on a model to a point in space. Actually only finds a point diff --git a/include/pixel.h b/include/pixel.h deleted file mode 100644 index b9c1edf..0000000 --- a/include/pixel.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) Volition, Inc. 1999. All rights reserved. - * - * All source code herein is the property of Volition, Inc. You may not sell - * or otherwise commercially exploit the source or things you created based on - * the source. - */ - -/* - * $Logfile: /Freespace2/code/Graphics/Pixel.h $ - * $Revision$ - * $Date$ - * $Author$ - * - * Header file for pixel routines. - * - * $Log$ - * Revision 1.2 2002/06/09 04:41:14 relnev - * added copyright header - * - * Revision 1.1.1.1 2002/05/03 03:28:12 root - * Initial import. - * - * - * 2 10/07/98 10:53a Dave - * Initial checkin. - * - * 1 10/07/98 10:49a Dave - * - * 9 5/06/98 5:30p John - * Removed unused cfilearchiver. Removed/replaced some unused/little used - * graphics functions, namely gradient_h and _v and pixel_sp. Put in new - * DirectX header files and libs that fixed the Direct3D alpha blending - * problems. - * - * 8 3/10/98 4:18p John - * Cleaned up graphics lib. Took out most unused gr functions. Made D3D - * & Glide have popups and print screen. Took out all >8bpp software - * support. Made Fred zbuffer. Made zbuffer allocate dynamically to - * support Fred. Made zbuffering key off of functions rather than one - * global variable. - * - * 7 5/29/97 3:10p John - * Took out debug menu. - * Made software scaler draw larger bitmaps. - * Optimized Direct3D some. - * - * 6 5/12/97 12:27p John - * Restructured Graphics Library to add support for multiple renderers. - * - * 5 1/09/97 11:35a John - * Added some 2d functions to get/put screen images. - * - * 4 11/07/96 6:19p John - * Added a bunch of 16bpp primitives so the game sort of runs in 16bpp - * mode. - * - * 3 10/26/96 1:40p John - * Added some now primitives to the 2d library and - * cleaned up some old ones. - * - * $NoKeywords: $ - */ - -#ifndef _PIXEL_H -#define _PIXEL_H - -extern void gr8_pixel( int x, int y ); - -#endif - diff --git a/include/pstypes.h b/include/pstypes.h index a8a841a..89ad44c 100644 --- a/include/pstypes.h +++ b/include/pstypes.h @@ -309,8 +309,6 @@ typedef Sint32 ptr_s; typedef Uint32 ptr_u; #endif -#define HARDWARE_ONLY - //Stucture to store clipping codes in a word typedef struct ccodes { ubyte vor,vand; //or is low byte, and is high byte diff --git a/include/scaler.h b/include/scaler.h deleted file mode 100644 index 2b8d4e5..0000000 --- a/include/scaler.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) Volition, Inc. 1999. All rights reserved. - * - * All source code herein is the property of Volition, Inc. You may not sell - * or otherwise commercially exploit the source or things you created based on - * the source. - */ - -/* - * $Logfile: /Freespace2/code/Graphics/Scaler.h $ - * $Revision$ - * $Date$ - * $Author$ - * - * Header file for bitmap scaler. - * - * $Log$ - * Revision 1.2 2002/06/09 04:41:14 relnev - * added copyright header - * - * Revision 1.1.1.1 2002/05/03 03:28:12 root - * Initial import. - * - * - * 2 10/07/98 10:53a Dave - * Initial checkin. - * - * 1 10/07/98 10:49a Dave - * - * 9 3/10/98 4:19p John - * Cleaned up graphics lib. Took out most unused gr functions. Made D3D - * & Glide have popups and print screen. Took out all >8bpp software - * support. Made Fred zbuffer. Made zbuffer allocate dynamically to - * support Fred. Made zbuffering key off of functions rather than one - * global variable. - * - * 8 11/30/97 12:18p John - * added more 24 & 32-bpp primitives - * - * 7 10/15/97 4:48p John - * added 16-bpp aascaler - * - * 6 8/04/97 4:47p John - * added gr_aascaler. - * - * 5 11/07/96 6:19p John - * Added a bunch of 16bpp primitives so the game sort of runs in 16bpp - * mode. - * - * 4 10/26/96 1:40p John - * Added some now primitives to the 2d library and - * cleaned up some old ones. - * - * $NoKeywords: $ - */ - - -#ifndef _SCALER_H -#define _SCALER_H - -#include "pstypes.h" - - -// Scales current bitmap between va and vb -void gr8_scaler(vertex *va, vertex *vb ); -void gr8_aascaler(vertex *va, vertex *vb ); - -#endif - diff --git a/include/shade.h b/include/shade.h deleted file mode 100644 index 859528e..0000000 --- a/include/shade.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) Volition, Inc. 1999. All rights reserved. - * - * All source code herein is the property of Volition, Inc. You may not sell - * or otherwise commercially exploit the source or things you created based on - * the source. - */ - -/* - * $Logfile: /Freespace2/code/Graphics/Shade.h $ - * $Revision$ - * $Date$ - * $Author$ - * - * Header file for Shade.cpp - * - * $Log$ - * Revision 1.2 2002/06/09 04:41:14 relnev - * added copyright header - * - * Revision 1.1.1.1 2002/05/03 03:28:12 root - * Initial import. - * - * - * 2 10/07/98 10:53a Dave - * Initial checkin. - * - * 1 10/07/98 10:49a Dave - * - * 7 3/12/98 5:36p John - * Took out any unused shaders. Made shader code take rgbc instead of - * matrix and vector since noone used it like a matrix and it would have - * been impossible to do in hardware. Made Glide implement a basic - * shader for online help. - * - * 6 3/10/98 4:19p John - * Cleaned up graphics lib. Took out most unused gr functions. Made D3D - * & Glide have popups and print screen. Took out all >8bpp software - * support. Made Fred zbuffer. Made zbuffer allocate dynamically to - * support Fred. Made zbuffering key off of functions rather than one - * global variable. - * - * 5 11/30/97 12:18p John - * added more 24 & 32-bpp primitives - * - * 4 11/18/96 1:48p Allender - * added 16 bit version of (very slow) shader - * - * 3 10/26/96 1:40p John - * Added some now primitives to the 2d library and - * cleaned up some old ones. - * - * $NoKeywords: $ - */ - -#ifndef _SHADE_H -#define _SHADE_H - -extern void grx_create_shader(shader * shade, float r, float g, float b, float c ); -extern void grx_set_shader( shader * shade ); -extern void gr8_shade(int x,int y,int w,int h); - -#endif - diff --git a/include/sst1vid.h b/include/sst1vid.h deleted file mode 100644 index 5be60c6..0000000 --- a/include/sst1vid.h +++ /dev/null @@ -1,120 +0,0 @@ -/* -** Copyright (c) 1995, 3Dfx Interactive, Inc. -** All Rights Reserved. -** -** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.; -** the contents of this file may not be disclosed to third parties, copied or -** duplicated in any form, in whole or in part, without the prior written -** permission of 3Dfx Interactive, Inc. -** -** RESTRICTED RIGHTS LEGEND: -** Use, duplication or disclosure by the Government is subject to restrictions -** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data -** and Computer Software clause at DFARS 252.227-7013, and/or in similar or -** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - -** rights reserved under the Copyright Laws of the United States. -** -** $Header$ -** $Log$ -** Revision 1.1 2002/05/03 03:28:12 root -** Initial revision -** - * - * 2 10/07/98 10:52a Dave - * Initial checkin. - * - * 1 10/07/98 10:48a Dave - * - * 2 2/27/98 3:25p Frank - * (John/Frank K.) updated to 2.43 headers - * - * 1 10/16/97 11:51a Klier - * - * 4 9/09/97 7:35p Sellers - * Added 400x300 resolution - * - * 3 8/24/97 9:31a Sellers - * moved new video timing to sst1vid.h - * redefined 1600x1280 to be 1600x1200 - * - * 2 6/05/97 11:14p Pgj - * - * 5 7/24/96 3:43p Sellers - * added 512x384 @ 60 Hz for arcade monitors - * added 512x256 @ 60 Hz for arcade monitors - * - * 4 7/18/96 10:58a Sellers - * fixed FT and TF clock delay values for lower frequencies with - * .5/.5 combos - * - * 3 6/18/96 6:54p Sellers - * added sst1InitShutdownSli() to fix Glide Splash screen problems with - * SLI - * - * 2 6/13/96 7:45p Sellers - * added "voodoo.ini" support - * added DirectX support - * misc cleanup - * - * 2 6/11/96 1:43p Sellers - * added support for 60, 75, 85, and 120 Hz refresh rates for "most" - * resolutions - * - * 1 5/08/96 5:43p Paik - * Video definitions -*/ -#ifndef __SST1VID_H__ -#define __SST1VID_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Video defines */ - -typedef FxI32 GrScreenRefresh_t; -#define GR_REFRESH_60Hz 0x0 -#define GR_REFRESH_70Hz 0x1 -#define GR_REFRESH_72Hz 0x2 -#define GR_REFRESH_75Hz 0x3 -#define GR_REFRESH_80Hz 0x4 -#define GR_REFRESH_90Hz 0x5 -#define GR_REFRESH_100Hz 0x6 -#define GR_REFRESH_85Hz 0x7 -#define GR_REFRESH_120Hz 0x8 -#define GR_REFRESH_NONE 0xff - -typedef FxI32 GrScreenResolution_t; -#define GR_RESOLUTION_320x200 0x0 -#define GR_RESOLUTION_320x240 0x1 -#define GR_RESOLUTION_400x256 0x2 -#define GR_RESOLUTION_512x384 0x3 -#define GR_RESOLUTION_640x200 0x4 -#define GR_RESOLUTION_640x350 0x5 -#define GR_RESOLUTION_640x400 0x6 -#define GR_RESOLUTION_640x480 0x7 -#define GR_RESOLUTION_800x600 0x8 -#define GR_RESOLUTION_960x720 0x9 -#define GR_RESOLUTION_856x480 0xa -#define GR_RESOLUTION_512x256 0xb -#define GR_RESOLUTION_1024x768 0xC -#define GR_RESOLUTION_1280x1024 0xD -#define GR_RESOLUTION_1600x1200 0xE -#define GR_RESOLUTION_400x300 0xF -#define GR_RESOLUTION_NONE 0xff - -#ifdef GR_RESOLUTION_MAX -#undef GR_RESOLUTION_MAX -#endif -#ifdef GR_RESOLUTION_MIN -#undef GR_RESOLUTION_MIN -#endif -#define GR_RESOLUTION_MIN GR_RESOLUTION_320x200 -#define GR_RESOLUTION_MAX GR_RESOLUTION_1600x1200 - -#ifdef __cplusplus -} -#endif - -#endif /* __SST1VID_H__ */ - diff --git a/include/sw_force.h b/include/sw_force.h deleted file mode 100644 index 0f17c58..0000000 --- a/include/sw_force.h +++ /dev/null @@ -1,477 +0,0 @@ -/**************************************************************************** - - MODULE: SW_Force.H - Tab settings: 5 9 - - Copyright 1995, 1996, Microsoft Corporation, All Rights Reserved. - - You have a royalty-free right to use, modify, reproduce and - distribute this header Files (and/or any modified version) in - any way you find useful, provided that you agree that - Microsoft has no warranty obligations or liability for any - Application Files which are created using the header Files. - - PURPOSE: Header for SideWinder Force Feedback Joystick - and interface to DirectInput Force Feedback API - - - Author(s): Name: - ---------- ---------------- - - - Revision History: - ----------------- - Version Date Author Comments - 1.0 24-Mar-97 MEA original - -****************************************************************************/ -#ifndef _SW_Force_SEEN -#define _SW_Force_SEEN -#include -#include -#include -#include -#define INC_OLE2 -#include -#include -#include -#undef INITGUIDS - -#include "sw_guid.hpp" -#include "vdinput.h" -#include "sw_error.hpp" - -/* -#include "sw_guid.h" -#include "vdinput.h" -#include "sw_error.h" -*/ - - -// -// --- Defines and macros for making DirectInput FF a little easier to work -// with. -// -#define SINE 1 -#define COSINE 2 -#define SQUARE_HIGH 3 -#define SQUARE_LOW 4 -#define TRIANGLE_UP 5 -#define TRIANGLE_DOWN 6 -#define SAWTOOTH_UP 7 -#define SAWTOOTH_DOWN 8 -#define RAMP_UP 9 -#define RAMP_DOWN 10 -#define SPRING 11 -#define INERTIA 12 -#define DAMPER 13 -#define FRICTION 14 -#define WALL 15 - -#define HZ_TO_uS(HZ) ((int)(1000000.0/(double)(HZ) + 0.5)) -#define uS_TO_HZ(uS) (max(1,(int)((double)(uS)/1000000.0 + 0.5))) - -#ifndef X_AXIS -#define X_AXIS 1 -#endif - -#ifndef Y_AXIS -#define Y_AXIS 2 -#endif - -//--------------------------------------------------------------------------- -// Function prototype declarations C-callable -//--------------------------------------------------------------------------- -#ifdef __cplusplus -extern "C" { -#endif - -HRESULT SWFF_OpenDefaultFFJoystick( - IN HWND hWnd, - OUT LPDIRECTINPUT* ppDI, - OUT LPDIRECTINPUTDEVICE2* ppDIDevice2); - -HRESULT SWFF_OpenDefaultFFJoystickEx( - IN HWND hWnd, - IN HINSTANCE hInstance, - OUT LPDIRECTINPUT* ppDI, - OUT LPDIRECTINPUTDEVICE2* ppDIDevice, - DWORD dwFlags); - -HRESULT SWFF_DestroyEffect( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN LPDIRECTINPUTEFFECT pDIEffect); - -HRESULT SWFF_DestroyAllEffects( - IN LPDIRECTINPUTDEVICE2 pDIDevice); - -HRESULT SWFF_SetGain( - IN LPDIRECTINPUTEFFECT pDIEffect, - IN DWORD dwGain); - -HRESULT SWFF_SetDirection( - IN LPDIRECTINPUTEFFECT pDIEffect, - IN DWORD dwAngle); - -HRESULT SWFF_SetDuration( - IN LPDIRECTINPUTEFFECT pDIEffect, - IN DWORD dwDuration); - -HRESULT SWFF_SetDirectionGain( - IN LPDIRECTINPUTEFFECT pDIEffect, - IN DWORD dwAngle, - IN DWORD dwMag); - -HRESULT SWFF_PutRawForce( - IN LPDIRECTINPUTEFFECT pDIEffect, - IN LONG lMagnitude, - IN DWORD dwDirection); - -HRESULT SWFF_PutRawAxisForce( - IN LPDIRECTINPUTEFFECT pDIEffect, - IN LONG lMagnitude); - -HRESULT SWFF_CreateRawForceEffect( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT * ppDIEffect, - IN LONG lMagnitude, - IN DWORD dwDirection); - -HRESULT SWFF_CreateRawAxisForceEffect( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT * ppDIEffect, - IN LONG lMagnitude, - IN DWORD dwAxis); - -HRESULT SWFF_CreateROMEffect( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT * ppDIEffect, - IN REFGUID refGUID, - IN DWORD dwDuration, - IN DWORD dwGain, - IN DWORD dwDirection, - IN LONG lButton); - -HRESULT SWFF_CreatePeriodicEffect( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN DWORD dwType, - IN DWORD dwDuration, - IN DWORD dwPeriod, - IN DWORD dwDirection, - IN DWORD dwMagnitude, - IN LONG lOffset, - IN DWORD dwAttackTime, - IN DWORD dwAttackLevel, - IN DWORD dwFadeTime, - IN DWORD dwFadeLevel, - IN LONG lButton); - -HRESULT SWFF_CreateSpringEffect( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN DWORD dwDuration, - IN LONG lKx, - IN LONG lCenterX, - IN LONG lKy, - IN LONG lCenterY, - IN LONG lButton); - -HRESULT SWFF_CreateDamperEffect( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN DWORD dwDuration, - IN LONG lBx, - IN LONG lV0x, - IN LONG lBy, - IN LONG lV0y, - IN LONG lButton); - -HRESULT SWFF_CreateInertiaEffect( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN DWORD dwDuration, - IN LONG lMx, - IN LONG lA0x, - IN LONG lMy, - IN LONG lA0y, - IN LONG lButton); - -HRESULT SWFF_CreateFrictionEffect( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN DWORD dwDuration, - IN LONG lFx, - IN LONG lFy, - IN LONG lButton); - -HRESULT SWFF_CreateConditionEffect( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN DWORD dwType, - IN DWORD dwDuration, - IN LONG lXCoefficient, - IN LONG lXOffset, - IN LONG lYCoefficient, - IN LONG lYOffset, - IN LONG lButton); - -HRESULT SWFF_CreateRampEffect( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN DWORD dwDuration, - IN DWORD dwDirection, - IN LONG lStart, - IN LONG lEnd, - IN DWORD dwAttackTime, - IN DWORD dwAttackLevel, - IN DWORD dwFadeTime, - IN DWORD dwFadeLevel, - IN LONG lButtonMask); - -HRESULT SWFF_CreateConstantForceEffect( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN DWORD dwDuration, - IN DWORD dwDirection, - IN LONG lMagnitude, - IN DWORD dwAttackTime, - IN DWORD dwAttackLevel, - IN DWORD dwFadeTime, - IN DWORD dwFadeLevel, - IN LONG lButton); - -HRESULT SWFF_CreateWallEffect( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN DWORD dwDuration, - IN DWORD dwDirection, - IN DWORD dwDistance, - IN BOOL bInner, - IN LONG lWallCoefficient, - IN LONG lButton); - -HRESULT SWFF_CreateVFXEffectFromFile( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN const TCHAR *pszFileName); - -HRESULT SWFF_CreateVFXEffectFromFileEx( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN const TCHAR *pszFileName, - IN DWORD dwDuration, - IN DWORD dwGain, - IN DWORD dwDirection); - -HRESULT SWFF_CreateVFXEffectFromBuffer( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN const LPVOID pBuffer, - IN DWORD dwBufferSize); - -HRESULT SWFF_CreateVFXEffectFromBufferEx( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN const LPVOID pBuffer, - IN DWORD dwBufferSize, - IN DWORD dwDuration, - IN DWORD dwGain, - IN DWORD dwDirection); - -HRESULT SWFF_CreateDIEffectFromFile( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN const TCHAR *pszFileName); - -HRESULT SWFF_CreateDIEffectFromFileEx( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT** pppDIEffect, - IN OUT PDWORD pdwEffectCount, - IN const TCHAR *pszFileName, - IN OUT void** ppUDBuffer, - IN OUT PDWORD pdwOutFlags); - -HRESULT SWFF_CreateDIEffectFromBuffer( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN const LPVOID pBuffer, - IN DWORD dwBufferSize); - -HRESULT SWFF_CreateDIEffectFromBufferEx( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT** pppDIEffect, - IN OUT PDWORD pdwEffectCount, - IN const LPVOID pBuffer, - IN DWORD dwBufferSize, - IN OUT void** ppUDBuffer, - IN OUT PDWORD pdwOutFlags); - -BOOL SWFF_RegisterVFXObject(LPCTSTR pszVFXPath); - -BOOL SWFF_GetJoyData( - IN int nJoyID, - IN OUT JOYINFOEX * pjix, - OUT char *pszErr); -/* -HRESULT SWFF_GetJoyData2( - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIJOYSTATE pjs); -*/ -void SWFF_ErrorCodeToString( - IN HRESULT hResult, - OUT TCHAR * pszCodeString); - - -#ifdef __cplusplus -} -#endif - -// -// --- IVFX Interface prototypes -// -#ifndef PPVOID -typedef LPVOID * PPVOID; -#endif //PPVOID - -typedef struct IVFX *PVFX; -typedef struct IVFX **PPVFX; - -#define VFXCE_CREATE_SINGLE 0x00001 -#define VFXCE_CREATE_MULTIPLE 0x00002 -#define VFXCE_CALC_BUFFER_SIZE 0x00004 -#define VFXCE_CALC_EFFECT_COUNT 0x00008 -#define VFXCE_CONCATENATE 0x00010 -#define VFXCE_SUPERIMPOSE 0x00020 - - -#undef INTERFACE -#define INTERFACE IVFX -DECLARE_INTERFACE_(IVFX, IUnknown) -{ - //IUnknown members - STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - //IVFX Interface members - // General Methods - STDMETHOD_(HRESULT, CreateEffectFromFile) ( - THIS_ - LPDIRECTINPUTDEVICE2, - LPDIRECTINPUTEFFECT*, - LPDWORD, - const TCHAR*, - LPVOID, - LPDWORD, - DWORD, - LPDWORD) PURE; - - STDMETHOD_(HRESULT, CreateEffectFromBuffer) ( - THIS_ - LPDIRECTINPUTDEVICE2, - LPDIRECTINPUTEFFECT*, - LPDWORD, - PVOID, - DWORD, - LPVOID, - LPDWORD, - DWORD, - LPDWORD) PURE; -}; - -// -// --- SideWinder specific -// -#define DEFAULT_ROM_EFFECT_GAIN 100 // Set dwGain to this for Default - // ROM Effect gain -#define DEFAULT_ROM_EFFECT_DURATION 1000 // Set dwDuration to this for Default - // ROM Effect Duration -#define DEFAULT_ROM_EFFECT_OUTPUTRATE 1000 // Set dwSampleRate to this for - // Default ROM Effect output rate - -#define MIN_ANGLE 0 -#define MAX_ANGLE 36000 -#define MIN_FORCEOUTPUTRATE 1 -#define MIN_GAIN 1 -#define MAX_GAIN 10000 -#define MAX_FORCE 10000 -#define MIN_FORCE -10000 -#define MIN_TIME_PERIOD 1 -#define MAX_TIME_PERIOD 4294967296L // 4096 * 10^^6 usecs - -#define SCALE_GAIN 100 // DX is +/- 10000 -#define SCALE_TIME 1000 // DX is in microseconds -#define SCALE_POSITION 100 // DX is +/- 10000 -#define SCALE_CONSTANTS 100 // DX is +/- 10000 -#define SCALE_DIRECTION 100 // DX is 0 to 35900 - -// -// --- Default Values -// -#define DEFAULT_OFFSET 0 -#define DEFAULT_ATTACK_LEVEL 0 -#define DEFAULT_ATTACK_TIME 0 -#define DEFAULT_SUSTAIN_LEVEL 10000 -#define DEFAULT_FADE_LEVEL 0 -#define DEFAULT_FADE_TIME 0 - - -// -// The following are Type Specific parameters structures for SideWinder -// - -// -// --- WALL Effect -// -#define WALL_INNER 0 // Wall material:from center to Wall Distance -#define WALL_OUTER 1 // Wall material:greater than Wall Distance - -typedef struct _BE_WALL_PARAM { - ULONG m_Bytes; // Size of this structure - ULONG m_WallType; // WALL_INNER or WALL_OUTER - LONG m_WallConstant; // in +/- 10000% - ULONG m_WallAngle; // 0, 9000, 18000, 27000 - ULONG m_WallDistance; // Distance from Wall face normal to center. 0 to 10000 -} BE_WALL_PARAM, *PBE_WALL_PARAM; - -// -// --- EF_VFX_EFFECT = { FRC file effects } -// -// Subtypes: none - -#define VFX_FILENAME 0L -#define VFX_BUFFER 1L - -#define DEFAULT_VFX_EFFECT_GAIN 10000 // set dwGain to this for default gain -#define DEFAULT_VFX_EFFECT_DIRECTION 0 // set polar direction to this for default direction -#define DEFAULT_VFX_EFFECT_DURATION 1000 // set dwDuration to this for default duration - -typedef struct _VFX_PARAM -{ - ULONG m_Bytes; // Size of this structure - ULONG m_PointerType; // VFX_FILENAME or VFX_BUFFER - ULONG m_BufferSize; // number of bytes in buffer (if VFX_BUFFER) - PVOID m_pFileNameOrBuffer; // file name to open -} VFX_PARAM, *PVFX_PARAM; - -typedef struct { - DIEFFECT DIEffectStruct; - DICONDITION DIConditionStruct[2]; - LONG rglDirection[2]; -} di_condition_effect_struct; - -HRESULT SWFF_CreateConditionEffectStruct( - di_condition_effect_struct *ptr, - IN LPDIRECTINPUTDEVICE2 pDIDevice, - IN OUT LPDIRECTINPUTEFFECT* ppDIEffect, - IN DWORD dwType, - IN DWORD dwDuration, - IN LONG lXCoefficient, - IN LONG lXOffset, - IN LONG lYCoefficient, - IN LONG lYOffset, - IN LONG lButton); - -#endif // of ifdef _SW_Force_SEEN - diff --git a/include/systemvars.h b/include/systemvars.h index 666bbae..04716dc 100644 --- a/include/systemvars.h +++ b/include/systemvars.h @@ -295,11 +295,6 @@ extern int Fred_found_unknown_ship_during_parsing; // Noise numbers go from 0 to 1.0 extern float Noise[NOISE_NUM_FRAMES]; - -// If true, then we are using Direct3D hardware. This is used for game type stuff -// that changes when you're using hardware. -extern int D3D_enabled; - // game skill levels #define NUM_SKILL_LEVELS 5 diff --git a/include/tmapper.h b/include/tmapper.h index ec80533..f71dabf 100644 --- a/include/tmapper.h +++ b/include/tmapper.h @@ -87,18 +87,6 @@ #ifndef _TMAPPER_H #define _TMAPPER_H -// call this to reinit the scanline function pointers. -extern void tmapper_setup(); - -// Used to tell the tmapper what the current lighting values are -// if the TMAP_FLAG_RAMP or TMAP_FLAG_RGB are set and the TMAP_FLAG_GOURAUD -// isn't set. -void tmapper_set_light(vertex *v, uint flags); - -// DO NOT CALL grx_tmapper DIRECTLY!!!! Only use the -// gr_tmapper equivalent!!!! -extern void grx_tmapper( int nv, vertex * verts[], uint flags ); - #define TMAP_MAX_VERTS 25 // Max number of vertices per polygon // Flags to pass to g3_draw_??? routines diff --git a/include/tmapscanline.h b/include/tmapscanline.h deleted file mode 100644 index c277f77..0000000 --- a/include/tmapscanline.h +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (C) Volition, Inc. 1999. All rights reserved. - * - * All source code herein is the property of Volition, Inc. You may not sell - * or otherwise commercially exploit the source or things you created based on - * the source. - */ - -/* - * $Logfile: /Freespace2/code/Graphics/TmapScanline.h $ - * $Revision$ - * $Date$ - * $Author$ - * - * Header file for tmapscanline.cpp. - * - * $Log$ - * Revision 1.2 2002/06/09 04:41:15 relnev - * added copyright header - * - * Revision 1.1.1.1 2002/05/03 03:28:12 root - * Initial import. - * - * - * 2 10/07/98 10:53a Dave - * Initial checkin. - * - * 1 10/07/98 10:49a Dave - * - * 25 5/13/98 2:53p John - * Made subspace effect work under software. Had to add new inner loop to - * tmapper. Added glows to end of subspace effect. Made subspace effect - * levels use gamepalette-subspace palette. - * - * 24 4/10/98 5:20p John - * Changed RGB in lighting structure to be ubytes. Removed old - * not-necessary 24 bpp software stuff. - * - * 23 3/22/98 2:33p John - * Took out fx_v/v_right. Made fx_u etc get calculated in tmapper. - * - * 22 3/10/98 4:19p John - * Cleaned up graphics lib. Took out most unused gr functions. Made D3D - * & Glide have popups and print screen. Took out all >8bpp software - * support. Made Fred zbuffer. Made zbuffer allocate dynamically to - * support Fred. Made zbuffering key off of functions rather than one - * global variable. - * - * 21 12/15/97 11:32a John - * New Laser Code - * - * 20 12/02/97 4:00p John - * Added first rev of thruster glow, along with variable levels of - * translucency, which retquired some restructing of palman. - * - * 19 11/30/97 3:57p John - * Made fixed 32-bpp translucency. Made BmpMan always map translucent - * color into 255 even if you aren't supposed to remap and make it's - * palette black. - * - * 18 11/21/97 11:32a John - * Added nebulas. Fixed some warpout bugs. - * - * 17 10/16/97 10:55a John - * added tmapper to draw a monochrome alpha blended bitmap. - * - * 16 3/14/97 3:55p John - * Made tiled tmapper not always be zbuffered. - * - * 15 3/13/97 10:32a John - * Added code for tiled 256x256 textures in certain models. - * - * 14 3/05/97 7:15p John - * took out the old z stop tmapper used for briefing. - * - * 13 1/20/97 4:17p John - * - * 12 1/06/97 2:44p John - * Added in slow (but correct) zbuffering - * - * 11 12/10/96 10:37a John - * Restructured texture mapper to remove some overhead from each scanline - * setup. This gave about a 30% improvement drawing trans01.pof, which is - * a really complex model. In the process, I cleaned up the scanline - * functions and separated them into different modules for each pixel - * depth. - * - * 10 11/26/96 6:50p John - * Added some more hicolor primitives. Made windowed mode run as current - * bpp, if bpp is 8,16,or 32. - * - * 9 11/07/96 6:19p John - * Added a bunch of 16bpp primitives so the game sort of runs in 16bpp - * mode. - * - * 8 11/05/96 4:05p John - * Added roller. Added code to draw a distant planet. Made bm_load - * return -1 if invalid bitmap. - * - * 7 10/31/96 7:20p John - * Added per,tiled tmapper. Made models tile if they use 64x64 textures. - * - * 6 10/26/96 1:40p John - * Added some now primitives to the 2d library and - * cleaned up some old ones. - * - * $NoKeywords: $ - */ - - -#ifndef _TMAPSCANLINE_H -#define _TMAPSCANLINE_H - - -typedef struct tmapper_vertex { - float sx, sy, sw, u, v, b; -} tmapper_vertex; - -typedef struct tmapper_data { - // These are filled once for each texture map being drawn. - // The inner loop cannot change any of these!! - int nv; // number of vertices - ubyte *pixptr; - bitmap *bp; - int src_offset; - uint flags; - float FixedScale; // constant for asm inner loop - float FixedScale8; // constant for asm inner loop - float One; // constant for asm inner loop - - // This are filled in by the outer loop before each scan line. - int loop_count; - tmapper_vertex l, r, dl, dr, deltas; - int lx, rx, y; - float clipped_left; // how many pixels were clipped off the left in 2d. - - // These are used internally by the assembly texture mapper. - fix fx_l, fx_l_right, fx_dl_dx; - fix fx_u, fx_v, fx_du_dx, fx_dv_dx; - float fl_dudx_wide; - float fl_dvdx_wide; - float fl_dwdx_wide; - uint dest_row_data; - int num_big_steps; - uint uv_delta[2]; - float FloatTemp; - uint Subdivisions; - uint WidthModLength; - uint BlendLookup; - uint FadeLookup; - uint DeltaU; - uint DeltaV; - uint DeltaUFrac, DeltaVFrac; - uint UFixed; - uint VFixed; - ushort FPUCW; - ushort OldFPUCW; - int InnerLooper; - uint pScreenBits; - int fx_w; - int fx_dwdx; - - uint saved_esp; - uint lookup; - -} tmapper_data; - -extern tmapper_data Tmap; - -extern void tmapscan_generic(); -extern void tmapscan_generic8(); -//extern void tmapscan_pnn(); -extern void tmapscan_pln(); -extern void tmapscan_lln(); -extern void tmapscan_flat(); -extern void tmapscan_nebula8(); -extern void tmapscan_flat_z(); - -extern void tmapscan_flat8(); -extern void tmapscan_lln8(); -extern void tmapscan_lnt8(); -extern void tmapscan_lnn8(); -extern void tmapscan_lnt8(); -extern void tmapscan_lln8_tiled(); -extern void tmapscan_llt8_tiled(); -extern void tmapscan_pln8(); -extern void tmapscan_plt8(); - -extern void tmapscan_lnaa8(); - -extern void tmapscan_pln8_tiled(); - -extern void tmapscan_lnn8_tiled_256x256(); -extern void tmapscan_pnn8_tiled_256x256_subspace(); - -extern void tmapscan_flat_gouraud(); - -extern void tmapscan_nebula8(); - -#endif - diff --git a/include/vasync.h b/include/vasync.h deleted file mode 100644 index acd7156..0000000 --- a/include/vasync.h +++ /dev/null @@ -1,132 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved. - * - * File: async.h - * Content: AsyncData object include file - ***************************************************************************/ -#ifndef __ASYNC_INCLUDED__ -#define __ASYNC_INCLUDED__ - - -#include // for DECLARE_INTERFACE and HRESULT - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* - * GUIDS used by DPAsyncData objects - */ - -// {47BCD7E0-2E89-11d0-A889-00A0C905433C} -DEFINE_GUID(IID_IDPAsyncData, 0x47bcd7e0, 0x2e89, 0x11d0, 0xa8, 0x89, 0x0, 0xa0, 0xc9, 0x5, 0x43, 0x3c); - - -/**************************************************************************** - * - * IDPAsyncData Structures - * - * Various structures used to invoke DPAsyncData. - * - ****************************************************************************/ - -typedef struct IDPAsyncData FAR *LPDPASYNCDATA; - - -/**************************************************************************** - * - * IDPAsyncData Interface - * - ****************************************************************************/ - -#undef INTERFACE -#define INTERFACE IDPAsyncData -DECLARE_INTERFACE_( IDPAsyncData, IUnknown ) -{ - /* IUnknown Methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDPAsyncData Methods */ - STDMETHOD(AddItem) (THIS_ LPDWORD, LPVOID, DWORD) PURE; - STDMETHOD(Cancel) (THIS) PURE; - STDMETHOD(GetFlags) (THIS_ LPDWORD) PURE; - STDMETHOD(GetItem) (THIS_ DWORD, LPVOID *) PURE; - STDMETHOD(GetItemCount) (THIS_ LPDWORD) PURE; - STDMETHOD(GetStatus) (THIS_ LPDWORD, LPDWORD, HRESULT *) PURE; - STDMETHOD(IsSnapshotCurrent) (THIS) PURE; - STDMETHOD(RefreshSnapshot) (THIS) PURE; - STDMETHOD(RemoveItem) (THIS_ DWORD) PURE; - STDMETHOD(SetFlags) (THIS_ DWORD) PURE; - STDMETHOD(SetItem) (THIS_ DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetStatus) (THIS_ DWORD) PURE; - STDMETHOD(SetStatusEvent) (THIS_ DWORD, HANDLE) PURE; -}; - - -/**************************************************************************** - * - * IDPAsyncData interface macros - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDPAsyncData_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDPAsyncData_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDPAsyncData_Release(p) (p)->lpVtbl->Release(p) -#define IDPAsyncData_AddItem(p) (p)->lpVtbl->AddItem(p) -#define IDPAsyncData_Cancel(p) (p)->lpVtbl->Cancel(p) -#define IDPAsyncData_GetItem(p,a,b) (p)->lpVtbl->GetItem(p,a,b) -#define IDPAsyncData_GetItemCount(p,a) (p)->lpVtbl->GetItemCount(p,a) -#define IDPAsyncData_GetStatus(p,a,b,c) (p)->lpVtbl->GetStatus(p,a,b,c) -#define IDPAsyncData_IsSnapshotCurrent(p) (p)->lpVtbl->IsSnapshotCurrent(p) -#define IDPAsyncData_RefreshSnapshot(p) (p)->lpVtbl->RefreshSnapshot(p) -#define IDPAsyncData_RemoveItem(p) (p)->lpVtbl->RemoveItem(p) -#define IDPAsyncData_SetFlags(p) (p)->lpVtbl->SetFlags(p) -#define IDPAsyncData_SetItem(p) (p)->lpVtbl->SetItem(p) -#define IDPAsyncData_SetStatus(p) (p)->lpVtbl->SetStatus(p) -#define IDPAsyncData_SetStatusEvent(p,a,b) (p)->lpVtbl->SetStatusEvent(p,a,b) - -#else /* C++ */ - -#define IDPAsyncData_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDPAsyncData_AddRef(p) (p)->AddRef() -#define IDPAsyncData_Release(p) (p)->Release() -#define IDPAsyncData_AddItem(p) (p)->AddItem() -#define IDPAsyncData_Cancel(p) (p)->Cancel() -#define IDPAsyncData_GetItem(p,a,b) (p)->GetItem(a,b) -#define IDPAsyncData_GetItemCount(p,a) (p)->GetItemCount(a) -#define IDPAsyncData_GetStatus(p,a,b,c) (p)->GetStatus(a,b,c) -#define IDPAsyncData_IsSnapshotCurrent(p) (p)->IsSnapshotCurrent() -#define IDPAsyncData_RefreshSnapshot(p) (p)->RefreshSnapshot() -#define IDPAsyncData_RemoveItem(p) (p)->RemoveItem() -#define IDPAsyncData_SetFlags(p) (p)->SetFlags() -#define IDPAsyncData_SetItem(p) (p)->SetItem() -#define IDPAsyncData_SetStatus(p) (p)->SetStatus() -#define IDPAsyncData_SetStatusEvent(p,a,b) (p)->SetStatusEvent(a,b) - -#endif - - -/**************************************************************************** - * - * AsyncData Flags - * - ****************************************************************************/ - -/* - * This flag is set if the ItemData is ANSI. If it is not set, the ItemData - * is either Unicode or doesn't contain any string information. - */ -#define DPASYNCDATA_ANSI (0x00000001) - - -#ifdef __cplusplus -}; -#endif /* __cplusplus */ - -#endif /* __ASYNC_INCLUDED__ */ - diff --git a/include/vd3d.h b/include/vd3d.h deleted file mode 100644 index c0954b8..0000000 --- a/include/vd3d.h +++ /dev/null @@ -1,897 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. - * - * File: d3d.h - * Content: Direct3D include file - * - ***************************************************************************/ - -#ifndef _D3D_H_ -#define _D3D_H_ - -#include - -#ifdef _WIN32 -#define COM_NO_WINDOWS_H -#include -#else -#include "d3dcom.h" -#endif - -#ifdef _WIN32 -#define D3DAPI WINAPI -#else -#define D3DAPI -#endif - -/* - * Interface IID's - */ -#if defined( _WIN32 ) && !defined( _NO_COM) -DEFINE_GUID( IID_IDirect3D, 0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -DEFINE_GUID( IID_IDirect3D2, 0x6aae1ec1,0x662a,0x11d0,0x88,0x9d,0x00,0xaa,0x00,0xbb,0xb7,0x6a); - -DEFINE_GUID( IID_IDirect3DRampDevice, 0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -DEFINE_GUID( IID_IDirect3DRGBDevice, 0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -DEFINE_GUID( IID_IDirect3DHALDevice, 0x84E63dE0,0x46AA,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); -DEFINE_GUID( IID_IDirect3DMMXDevice, 0x881949a1,0xd6f3,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 ); - -DEFINE_GUID( IID_IDirect3DDevice, 0x64108800,0x957d,0X11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 ); -DEFINE_GUID( IID_IDirect3DDevice2, 0x93281501, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); -DEFINE_GUID( IID_IDirect3DTexture, 0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -DEFINE_GUID( IID_IDirect3DTexture2, 0x93281502, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); -DEFINE_GUID( IID_IDirect3DLight, 0x4417C142,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); -DEFINE_GUID( IID_IDirect3DMaterial, 0x4417C144,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); -DEFINE_GUID( IID_IDirect3DMaterial2, 0x93281503, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); -DEFINE_GUID( IID_IDirect3DExecuteBuffer,0x4417C145,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); -DEFINE_GUID( IID_IDirect3DViewport, 0x4417C146,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); -DEFINE_GUID( IID_IDirect3DViewport2, 0x93281500, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); -#endif - -/* - * Data structures - */ -#ifdef __cplusplus - -/* 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined */ -struct IDirect3D; -struct IDirect3D2; -struct IDirect3DDevice; -struct IDirect3DDevice2; -struct IDirect3DExecuteBuffer; -struct IDirect3DLight; -struct IDirect3DMaterial; -struct IDirect3DMaterial2; -struct IDirect3DTexture; -struct IDirect3DTexture2; -struct IDirect3DViewport; -struct IDirect3DViewport2; -typedef struct IDirect3D *LPDIRECT3D; -typedef struct IDirect3D2 *LPDIRECT3D2; -typedef struct IDirect3DDevice *LPDIRECT3DDEVICE; -typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2; -typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER; -typedef struct IDirect3DLight *LPDIRECT3DLIGHT; -typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL; -typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2; -typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE; -typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2; -typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT; -typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2; - -#else - -typedef struct IDirect3D *LPDIRECT3D; -typedef struct IDirect3D2 *LPDIRECT3D2; -typedef struct IDirect3DDevice *LPDIRECT3DDEVICE; -typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2; -typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER; -typedef struct IDirect3DLight *LPDIRECT3DLIGHT; -typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL; -typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2; -typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE; -typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2; -typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT; -typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2; - -#endif - -#include "vd3dtypes.h" -#include "vd3dcaps.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * IDirect3D - */ -#undef INTERFACE -#define INTERFACE IDirect3D -DECLARE_INTERFACE_(IDirect3D, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef) (THIS) PURE; - STDMETHOD_(ULONG, Release) (THIS) PURE; - /*** IDirect3D methods ***/ - STDMETHOD(Initialize) (THIS_ REFIID) PURE; - STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE; - STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE; - STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL*, IUnknown*) PURE; - STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT*, IUnknown*) PURE; - STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3D_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3D_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3D_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirect3D_EnumDevices(p, a, b) (p)->lpVtbl->EnumDevices(p, a, b) -#define IDirect3D_CreateLight(p, a, b) (p)->lpVtbl->CreateLight(p, a, b) -#define IDirect3D_CreateMaterial(p, a, b) (p)->lpVtbl->CreateMaterial(p, a, b) -#define IDirect3D_CreateViewport(p, a, b) (p)->lpVtbl->CreateViewport(p, a, b) -#define IDirect3D_FindDevice(p, a, b) (p)->lpVtbl->FindDevice(p, a, b) -#else -#define IDirect3D_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirect3D_AddRef(p) (p)->AddRef() -#define IDirect3D_Release(p) (p)->Release() -#define IDirect3D_Initialize(p, a) (p)->Initialize(a) -#define IDirect3D_EnumDevices(p, a, b) (p)->EnumDevices(a, b) -#define IDirect3D_CreateLight(p, a, b) (p)->CreateLight(a, b) -#define IDirect3D_CreateMaterial(p, a, b) (p)->CreateMaterial(a, b) -#define IDirect3D_CreateViewport(p, a, b) (p)->CreateViewport(a, b) -#define IDirect3D_FindDevice(p, a, b) (p)->FindDevice(a, b) -#endif - -/* - * IDirect3D2 - */ -#undef INTERFACE -#define INTERFACE IDirect3D2 -DECLARE_INTERFACE_(IDirect3D2, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef) (THIS) PURE; - STDMETHOD_(ULONG, Release) (THIS) PURE; - /*** IDirect3D methods ***/ - STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE; - STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE; - STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL2*, IUnknown*) PURE; - STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT2*, IUnknown*) PURE; - STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE; - - STDMETHOD(CreateDevice)(THIS_ REFCLSID, LPDIRECTDRAWSURFACE, LPDIRECT3DDEVICE2 *) PURE; - -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3D2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirect3D2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3D2_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3D2_EnumDevices(p, a, b) (p)->lpVtbl->EnumDevices(p, a, b) -#define IDirect3D2_CreateLight(p, a, b) (p)->lpVtbl->CreateLight(p, a, b) -#define IDirect3D2_CreateMaterial(p, a, b) (p)->lpVtbl->CreateMaterial(p, a, b) -#define IDirect3D2_CreateViewport(p, a, b) (p)->lpVtbl->CreateViewport(p, a, b) -#define IDirect3D2_FindDevice(p, a, b) (p)->lpVtbl->FindDevice(p, a, b) -#define IDirect3D2_CreateDevice(p, a, b, c) (p)->lpVtbl->CreateDevice(p, a, b, c) -#else -#define IDirect3D2_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirect3D2_AddRef(p) (p)->AddRef() -#define IDirect3D2_Release(p) (p)->Release() -#define IDirect3D2_EnumDevices(p, a, b) (p)->EnumDevices(a, b) -#define IDirect3D2_CreateLight(p, a, b) (p)->CreateLight(a, b) -#define IDirect3D2_CreateMaterial(p, a, b) (p)->CreateMaterial(a, b) -#define IDirect3D2_CreateViewport(p, a, b) (p)->CreateViewport(a, b) -#define IDirect3D2_FindDevice(p, a, b) (p)->FindDevice(a, b) -#define IDirect3D2_CreateDevice(p, a, b, c) (p)->CreateDevice(a, b, c) -#endif - -/* - * IDirect3DDevice - */ -#undef INTERFACE -#define INTERFACE IDirect3DDevice -DECLARE_INTERFACE_(IDirect3DDevice, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef) (THIS) PURE; - STDMETHOD_(ULONG, Release) (THIS) PURE; - /*** IDirect3DDevice methods ***/ - STDMETHOD(Initialize) (THIS_ LPDIRECT3D, LPGUID, LPD3DDEVICEDESC) PURE; - STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE; - STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE, LPDIRECT3DTEXTURE) PURE; - STDMETHOD(CreateExecuteBuffer) (THIS_ LPD3DEXECUTEBUFFERDESC, LPDIRECT3DEXECUTEBUFFER*, IUnknown*) PURE; - STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE; - STDMETHOD(Execute) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD) PURE; - STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE; - STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE; - STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT, LPDIRECT3DVIEWPORT*, DWORD) PURE; - STDMETHOD(Pick) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD, LPD3DRECT) PURE; - STDMETHOD(GetPickRecords)(THIS_ LPDWORD, LPD3DPICKRECORD) PURE; - STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE; - STDMETHOD(CreateMatrix) (THIS_ LPD3DMATRIXHANDLE) PURE; - STDMETHOD(SetMatrix) (THIS_ D3DMATRIXHANDLE, const LPD3DMATRIX) PURE; - STDMETHOD(GetMatrix) (THIS_ D3DMATRIXHANDLE, LPD3DMATRIX) PURE; - STDMETHOD(DeleteMatrix) (THIS_ D3DMATRIXHANDLE) PURE; - STDMETHOD_(HRESULT, BeginScene) (THIS) PURE; - STDMETHOD_(HRESULT, EndScene) (THIS) PURE; - STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D*) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DDevice_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirect3DDevice_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DDevice_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DDevice_Initialize(p, a, b, c) (p)->lpVtbl->Initialize(p, a, b, c) -#define IDirect3DDevice_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) -#define IDirect3DDevice_SwapTextureHandles(p, a, b) (p)->lpVtbl->SwapTextureHandles(p, a, b) -#define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->lpVtbl->CreateExecuteBuffer(p, a, b, c) -#define IDirect3DDevice_GetStats(p, a) (p)->lpVtbl->GetStats(p, a) -#define IDirect3DDevice_Execute(p, a, b, c) (p)->lpVtbl->Execute(p, a, b, c) -#define IDirect3DDevice_AddViewport(p, a) (p)->lpVtbl->AddViewport(p, a) -#define IDirect3DDevice_DeleteViewport(p, a) (p)->lpVtbl->DeleteViewport(p, a) -#define IDirect3DDevice_NextViewport(p, a, b) (p)->lpVtbl->NextViewport(p, a, b) -#define IDirect3DDevice_Pick(p, a, b, c, d) (p)->lpVtbl->Pick(p, a, b, c, d) -#define IDirect3DDevice_GetPickRecords(p, a, b) (p)->lpVtbl->GetPickRecords(p, a, b) -#define IDirect3DDevice_EnumTextureFormats(p, a, b) (p)->lpVtbl->EnumTextureFormats(p, a, b) -#define IDirect3DDevice_CreateMatrix(p, a) (p)->lpVtbl->CreateMatrix(p, a) -#define IDirect3DDevice_SetMatrix(p, a, b) (p)->lpVtbl->SetMatrix(p, a, b) -#define IDirect3DDevice_GetMatrix(p, a, b) (p)->lpVtbl->GetMatrix(p, a, b) -#define IDirect3DDevice_DeleteMatrix(p, a) (p)->lpVtbl->DeleteMatrix(p, a) -#define IDirect3DDevice_BeginScene(p) (p)->lpVtbl->BeginScene(p) -#define IDirect3DDevice_EndScene(p) (p)->lpVtbl->EndScene(p) -#define IDirect3DDevice_GetDirect3D(p, a) (p)->lpVtbl->GetDirect3D(p, a) -#else -#define IDirect3DDevice_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirect3DDevice_AddRef(p) (p)->AddRef() -#define IDirect3DDevice_Release(p) (p)->Release() -#define IDirect3DDevice_Initialize(p, a, b, c) (p)->Initialize(a, b, c) -#define IDirect3DDevice_GetCaps(p, a, b) (p)->GetCaps(a, b) -#define IDirect3DDevice_SwapTextureHandles(p, a, b) (p)->SwapTextureHandles(a, b) -#define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->CreateExecuteBuffer(a, b, c) -#define IDirect3DDevice_GetStats(p, a) (p)->GetStats(a) -#define IDirect3DDevice_Execute(p, a, b, c) (p)->Execute(a, b, c) -#define IDirect3DDevice_AddViewport(p, a) (p)->AddViewport(a) -#define IDirect3DDevice_DeleteViewport(p, a) (p)->DeleteViewport(a) -#define IDirect3DDevice_NextViewport(p, a, b) (p)->NextViewport(a, b) -#define IDirect3DDevice_Pick(p, a, b, c, d) (p)->Pick(a, b, c, d) -#define IDirect3DDevice_GetPickRecords(p, a, b) (p)->GetPickRecords(a, b) -#define IDirect3DDevice_EnumTextureFormats(p, a, b) (p)->EnumTextureFormats(a, b) -#define IDirect3DDevice_CreateMatrix(p, a) (p)->CreateMatrix(a) -#define IDirect3DDevice_SetMatrix(p, a, b) (p)->SetMatrix(a, b) -#define IDirect3DDevice_GetMatrix(p, a, b) (p)->GetMatrix(a, b) -#define IDirect3DDevice_DeleteMatrix(p, a) (p)->DeleteMatrix(a) -#define IDirect3DDevice_BeginScene(p) (p)->BeginScene() -#define IDirect3DDevice_EndScene(p) (p)->EndScene() -#define IDirect3DDevice_GetDirect3D(p, a) (p)->GetDirect3D(a) -#endif - -/* - * IDirect3DDevice2 - */ -#undef INTERFACE -#define INTERFACE IDirect3DDevice2 -DECLARE_INTERFACE_(IDirect3DDevice2, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef) (THIS) PURE; - STDMETHOD_(ULONG, Release) (THIS) PURE; - /*** IDirect3DDevice2 methods ***/ - STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE; - STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE2, LPDIRECT3DTEXTURE2) PURE; - STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE; - STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE; - STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE; - STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT2, LPDIRECT3DVIEWPORT2*, DWORD) PURE; - STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE; - STDMETHOD_(HRESULT, BeginScene) (THIS) PURE; - STDMETHOD_(HRESULT, EndScene) (THIS) PURE; - STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D2*) PURE; - - /*** DrawPrimitive API ***/ - STDMETHOD(SetCurrentViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE; - STDMETHOD(GetCurrentViewport) (THIS_ LPDIRECT3DVIEWPORT2 *) PURE; - - STDMETHOD(SetRenderTarget) (THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE; - STDMETHOD(GetRenderTarget) (THIS_ LPDIRECTDRAWSURFACE *) PURE; - - STDMETHOD(Begin) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, DWORD) PURE; - STDMETHOD(BeginIndexed) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, DWORD) PURE; - STDMETHOD(Vertex) (THIS_ LPVOID) PURE; - STDMETHOD(Index) (THIS_ WORD) PURE; - STDMETHOD(End) (THIS_ DWORD) PURE; - - STDMETHOD(GetRenderState) (THIS_ D3DRENDERSTATETYPE, LPDWORD) PURE; - STDMETHOD(SetRenderState) (THIS_ D3DRENDERSTATETYPE, DWORD) PURE; - STDMETHOD(GetLightState) (THIS_ D3DLIGHTSTATETYPE, LPDWORD) PURE; - STDMETHOD(SetLightState) (THIS_ D3DLIGHTSTATETYPE, DWORD) PURE; - STDMETHOD(SetTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE; - STDMETHOD(GetTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE; - STDMETHOD(MultiplyTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE; - - STDMETHOD(DrawPrimitive) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, DWORD) PURE; - STDMETHOD(DrawIndexedPrimitive) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, LPWORD, DWORD, DWORD) PURE; - - STDMETHOD(SetClipStatus) (THIS_ LPD3DCLIPSTATUS) PURE; - STDMETHOD(GetClipStatus) (THIS_ LPD3DCLIPSTATUS) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DDevice2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirect3DDevice2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DDevice2_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DDevice2_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) -#define IDirect3DDevice2_SwapTextureHandles(p, a, b) (p)->lpVtbl->SwapTextureHandles(p, a, b) -#define IDirect3DDevice2_GetStats(p, a) (p)->lpVtbl->CreateViewport(p, a) -#define IDirect3DDevice2_AddViewport(p, a) (p)->lpVtbl->AddViewport(p, a) -#define IDirect3DDevice2_DeleteViewport(p, a) (p)->lpVtbl->DeleteViewport(p, a) -#define IDirect3DDevice2_NextViewport(p, a, b) (p)->lpVtbl->NextViewport(p, a, b) -#define IDirect3DDevice2_EnumTextureFormats(p, a, b) (p)->lpVtbl->EnumTextureFormats(p, a, b) -#define IDirect3DDevice2_BeginScene(p) (p)->lpVtbl->BeginScene(p) -#define IDirect3DDevice2_EndScene(p) (p)->lpVtbl->EndScene(p) -#define IDirect3DDevice2_GetDirect3D(p, a) (p)->lpVtbl->GetDirect3D(p, a) - -#define IDirect3DDevice2_SetCurrentViewport(p, a) (p)->lpVtbl->SetCurrentViewport(p, a) -#define IDirect3DDevice2_GetCurrentViewport(p, a) (p)->lpVtbl->GetCurrentViewport(p, a) - -#define IDirect3DDevice2_SetRenderTarget(p, a, b) (p)->lpVtbl->SetRenderTarget(p, a, b) -#define IDirect3DDevice2_GetRenderTarget(p, a) (p)->lpVtbl->GetRenderTarget(p, a) - -#define IDirect3DDevice2_Begin(p, a, b, c) (p)->lpVtbl->Begin(p, a, b, c) -#define IDirect3DDevice2_BeginIndexed(p, a, b, c, d, e) (p)->lpVtbl->Begin(p, a, b, c, d, e) -#define IDirect3DDevice2_Vertex(p, a) (p)->lpVtbl->Vertex(p, a) -#define IDirect3DDevice2_Index(p, a) (p)->lpVtbl->Index(p, a) -#define IDirect3DDevice2_End(p, a) (p)->lpVtbl->End(p, a) - -#define IDirect3DDevice2_GetRenderState(p, a, b) (p)->lpVtbl->GetRenderState(p, a, b) -#define IDirect3DDevice2_SetRenderState(p, a, b) (p)->lpVtbl->SetRenderState(p, a, b) -#define IDirect3DDevice2_GetLightState(p, a, b) (p)->lpVtbl->GetLightState(p, a, b) -#define IDirect3DDevice2_SetLightState(p, a, b) (p)->lpVtbl->SetLightState(p, a, b) -#define IDirect3DDevice2_SetTransform(p, a, b) (p)->lpVtbl->SetTransform(p, a, b) -#define IDirect3DDevice2_GetTransform(p, a, b) (p)->lpVtbl->GetTransform(p, a, b) -#define IDirect3DDevice2_MultiplyTransform(p, a, b) (p)->lpVtbl->MultiplyTransform(p, a, b) - -#define IDirect3DDevice2_DrawPrimitive(p, a, b, c, d, e) (p)->lpVtbl->DrawPrimitive(p, a, b, c, d, e) -#define IDirect3DDevice2_DrawIndexedPrimitive(p, a, b, c, d, e, f, g) \ - (p)->lpVtbl->DrawIndexedPrimitive(p, a, b, c, d, e, f, g) -#define IDirect3DDevice2_SetClipStatus(p, a) (p)->lpVtbl->SetClipStatus(p, a) -#define IDirect3DDevice2_GetClipStatus(p, a) (p)->lpVtbl->GetClipStatus(p, a) -#else -#define IDirect3DDevice2_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirect3DDevice2_AddRef(p) (p)->AddRef() -#define IDirect3DDevice2_Release(p) (p)->Release() -#define IDirect3DDevice2_GetCaps(p, a, b) (p)->GetCaps(a, b) -#define IDirect3DDevice2_SwapTextureHandles(p, a, b) (p)->SwapTextureHandles(a, b) -#define IDirect3DDevice2_GetStats(p, a) (p)->CreateViewport(a) -#define IDirect3DDevice2_AddViewport(p, a) (p)->AddViewport(a) -#define IDirect3DDevice2_DeleteViewport(p, a) (p)->DeleteViewport(a) -#define IDirect3DDevice2_NextViewport(p, a, b) (p)->NextViewport(a, b) -#define IDirect3DDevice2_EnumTextureFormats(p, a, b) (p)->EnumTextureFormats(a, b) -#define IDirect3DDevice2_BeginScene(p) (p)->BeginScene() -#define IDirect3DDevice2_EndScene(p) (p)->EndScene() -#define IDirect3DDevice2_GetDirect3D(p, a) (p)->GetDirect3D(a) - -#define IDirect3DDevice2_SetCurrentViewport(p, a) (p)->SetCurrentViewport(a) -#define IDirect3DDevice2_GetCurrentViewport(p, a) (p)->GetCurrentViewport(a) - -#define IDirect3DDevice2_SetRenderTarget(p, a, b) (p)->SetRenderTarget(a, b) -#define IDirect3DDevice2_GetRenderTarget(p, a) (p)->GetRenderTarget(a) - -#define IDirect3DDevice2_Begin(p, a, b, c) (p)->Begin(a, b, c) -#define IDirect3DDevice2_BeginIndexed(p, a, b, c, d, e) (p)->Begin(a, b, c, d, e) -#define IDirect3DDevice2_Vertex(p, a) (p)->Vertex(a) -#define IDirect3DDevice2_Index(p, a) (p)->Index(a) -#define IDirect3DDevice2_End(p, a) (p)->End(a) - -#define IDirect3DDevice2_GetRenderState(p, a, b) (p)->GetRenderState(a, b) -#define IDirect3DDevice2_SetRenderState(p, a, b) (p)->SetRenderState(a, b) -#define IDirect3DDevice2_GetLightState(p, a, b) (p)->GetLightState(a, b) -#define IDirect3DDevice2_SetLightState(p, a, b) (p)->SetLightState(a, b) -#define IDirect3DDevice2_SetTransform(p, a, b) (p)->SetTransform(a, b) -#define IDirect3DDevice2_GetTransform(p, a, b) (p)->GetTransform(a, b) -#define IDirect3DDevice2_MultiplyTransform(p, a, b) (p)->MultiplyTransform(a, b) - -#define IDirect3DDevice2_DrawPrimitive(p, a, b, c, d, e) (p)->DrawPrimitive(a, b, c, d, e) -#define IDirect3DDevice2_DrawIndexedPrimitive(p, a, b, c, d, e, f, g) \ - (p)->DrawIndexedPrimitive(a, b, c, d, e, f, g) -#define IDirect3DDevice2_SetClipStatus(p, a) (p)->SetClipStatus(a) -#define IDirect3DDevice2_GetClipStatus(p, a) (p)->GetClipStatus(a) - -#endif - -/* - * IDirect3DExecuteBuffer - */ -#undef INTERFACE -#define INTERFACE IDirect3DExecuteBuffer -DECLARE_INTERFACE_(IDirect3DExecuteBuffer, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef) (THIS) PURE; - STDMETHOD_(ULONG, Release) (THIS) PURE; - /*** IDirect3DExecuteBuffer methods ***/ - STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPD3DEXECUTEBUFFERDESC) PURE; - STDMETHOD(Lock) (THIS_ LPD3DEXECUTEBUFFERDESC) PURE; - STDMETHOD_(HRESULT, Unlock) (THIS) PURE; - STDMETHOD(SetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE; - STDMETHOD(GetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE; - STDMETHOD(Validate) (THIS_ LPDWORD, LPD3DVALIDATECALLBACK, LPVOID, DWORD) PURE; - STDMETHOD(Optimize) (THIS_ DWORD) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirect3DExecuteBuffer_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DExecuteBuffer_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DExecuteBuffer_Initialize(p, a, b) (p)->lpVtbl->Initialize(p, a, b) -#define IDirect3DExecuteBuffer_Lock(p, a) (p)->lpVtbl->Lock(p, a) -#define IDirect3DExecuteBuffer_Unlock(p) (p)->lpVtbl->Unlock(p) -#define IDirect3DExecuteBuffer_SetExecuteData(p, a) (p)->lpVtbl->SetExecuteData(p, a) -#define IDirect3DExecuteBuffer_GetExecuteData(p, a) (p)->lpVtbl->GetExecuteData(p, a) -#define IDirect3DExecuteBuffer_Validate(p, a, b, c, d) (p)->lpVtbl->Validate(p, a, b, c, d) -#define IDirect3DExecuteBuffer_Optimize(p, a) (p)->lpVtbl->Optimize(p, a) -#else -#define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirect3DExecuteBuffer_AddRef(p) (p)->AddRef() -#define IDirect3DExecuteBuffer_Release(p) (p)->Release() -#define IDirect3DExecuteBuffer_Initialize(p, a, b) (p)->Initialize(a, b) -#define IDirect3DExecuteBuffer_Lock(p, a) (p)->Lock(a) -#define IDirect3DExecuteBuffer_Unlock(p) (p)->Unlock() -#define IDirect3DExecuteBuffer_SetExecuteData(p, a) (p)->SetExecuteData(a) -#define IDirect3DExecuteBuffer_GetExecuteData(p, a) (p)->GetExecuteData(a) -#define IDirect3DExecuteBuffer_Validate(p, a, b, c, d) (p)->Validate(a, b, c, d) -#define IDirect3DExecuteBuffer_Optimize(p, a) (p)->Optimize(a) -#endif - -/* - * IDirect3DLight - */ -#undef INTERFACE -#define INTERFACE IDirect3DLight -DECLARE_INTERFACE_(IDirect3DLight, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef) (THIS) PURE; - STDMETHOD_(ULONG, Release) (THIS) PURE; - /*** IDirect3DLight methods ***/ - STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE; - STDMETHOD(SetLight) (THIS_ LPD3DLIGHT) PURE; - STDMETHOD(GetLight) (THIS_ LPD3DLIGHT) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DLight_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirect3DLight_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DLight_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DLight_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirect3DLight_SetLight(p, a) (p)->lpVtbl->SetLight(p, a) -#define IDirect3DLight_GetLight(p, a) (p)->lpVtbl->GetLight(p, a) -#else -#define IDirect3DLight_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirect3DLight_AddRef(p) (p)->AddRef() -#define IDirect3DLight_Release(p) (p)->Release() -#define IDirect3DLight_Initialize(p, a) (p)->Initialize(a) -#define IDirect3DLight_SetLight(p, a) (p)->SetLight(a) -#define IDirect3DLight_GetLight(p, a) (p)->GetLight(a) -#endif - -/* - * IDirect3DMaterial - */ -#undef INTERFACE -#define INTERFACE IDirect3DMaterial -DECLARE_INTERFACE_(IDirect3DMaterial, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef) (THIS) PURE; - STDMETHOD_(ULONG, Release) (THIS) PURE; - /*** IDirect3DMaterial methods ***/ - STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE; - STDMETHOD(SetMaterial) (THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetMaterial) (THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DMATERIALHANDLE) PURE; - STDMETHOD_(HRESULT, Reserve) (THIS) PURE; - STDMETHOD_(HRESULT, Unreserve) (THIS) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DMaterial_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirect3DMaterial_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DMaterial_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DMaterial_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirect3DMaterial_SetMaterial(p, a) (p)->lpVtbl->SetMaterial(p, a) -#define IDirect3DMaterial_GetMaterial(p, a) (p)->lpVtbl->GetMaterial(p, a) -#define IDirect3DMaterial_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b) -#define IDirect3DMaterial_Reserve(p) (p)->lpVtbl->Reserve(p) -#define IDirect3DMaterial_Unreserve(p) (p)->lpVtbl->Unreserve(p) -#else -#define IDirect3DMaterial_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirect3DMaterial_AddRef(p) (p)->AddRef() -#define IDirect3DMaterial_Release(p) (p)->Release() -#define IDirect3DMaterial_Initialize(p, a) (p)->Initialize(a) -#define IDirect3DMaterial_SetMaterial(p, a) (p)->SetMaterial(a) -#define IDirect3DMaterial_GetMaterial(p, a) (p)->GetMaterial(a) -#define IDirect3DMaterial_GetHandle(p, a, b) (p)->GetHandle(a, b) -#define IDirect3DMaterial_Reserve(p) (p)->Reserve() -#define IDirect3DMaterial_Unreserve(p) (p)->Unreserve() -#endif - -/* - * IDirect3DMaterial2 - */ -#undef INTERFACE -#define INTERFACE IDirect3DMaterial2 -DECLARE_INTERFACE_(IDirect3DMaterial2, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef) (THIS) PURE; - STDMETHOD_(ULONG, Release) (THIS) PURE; - /*** IDirect3DMaterial2 methods ***/ - STDMETHOD(SetMaterial) (THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetMaterial) (THIS_ LPD3DMATERIAL) PURE; - STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE2, LPD3DMATERIALHANDLE) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DMaterial2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirect3DMaterial2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DMaterial2_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DMaterial2_SetMaterial(p, a) (p)->lpVtbl->SetMaterial(p, a) -#define IDirect3DMaterial2_GetMaterial(p, a) (p)->lpVtbl->GetMaterial(p, a) -#define IDirect3DMaterial2_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b) -#else -#define IDirect3DMaterial2_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirect3DMaterial2_AddRef(p) (p)->AddRef() -#define IDirect3DMaterial2_Release(p) (p)->Release() -#define IDirect3DMaterial2_SetMaterial(p, a) (p)->SetMaterial(a) -#define IDirect3DMaterial2_GetMaterial(p, a) (p)->GetMaterial(a) -#define IDirect3DMaterial2_GetHandle(p, a, b) (p)->GetHandle(a, b) -#endif - -/* - * IDirect3DTexture - */ -#undef INTERFACE -#define INTERFACE IDirect3DTexture -DECLARE_INTERFACE_(IDirect3DTexture, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef) (THIS) PURE; - STDMETHOD_(ULONG, Release) (THIS) PURE; - /*** IDirect3DTexture methods ***/ - STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DTEXTUREHANDLE) PURE; - STDMETHOD(PaletteChanged) (THIS_ DWORD, DWORD) PURE; - STDMETHOD(Load) (THIS_ LPDIRECT3DTEXTURE) PURE; - STDMETHOD_(HRESULT, Unload) (THIS) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DTexture_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirect3DTexture_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DTexture_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DTexture_Initialize(p, a, b) (p)->lpVtbl->Initialize(p, a, b) -#define IDirect3DTexture_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b) -#define IDirect3DTexture_PaletteChanged(p, a, b) (p)->lpVtbl->PaletteChanged(p, a, b) -#define IDirect3DTexture_Load(p, a) (p)->lpVtbl->Load(p, a) -#define IDirect3DTexture_Unload(p) (p)->lpVtbl->Unload(p) -#else -#define IDirect3DTexture_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirect3DTexture_AddRef(p) (p)->AddRef() -#define IDirect3DTexture_Release(p) (p)->Release() -#define IDirect3DTexture_Initialize(p, a, b) (p)->Initialize(a, b) -#define IDirect3DTexture_GetHandle(p, a, b) (p)->GetHandle(a, b) -#define IDirect3DTexture_PaletteChanged(p, a, b) (p)->PaletteChanged(a, b) -#define IDirect3DTexture_Load(p, a) (p)->Load(a) -#define IDirect3DTexture_Unload(p) (p)->Unload() -#endif - -/* - * IDirect3DTexture2 - */ -#undef INTERFACE -#define INTERFACE IDirect3DTexture2 -DECLARE_INTERFACE_(IDirect3DTexture2, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef) (THIS) PURE; - STDMETHOD_(ULONG, Release) (THIS) PURE; - /*** IDirect3DTexture2 methods ***/ - STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE2, LPD3DTEXTUREHANDLE) PURE; - STDMETHOD(PaletteChanged) (THIS_ DWORD, DWORD) PURE; - STDMETHOD(Load) (THIS_ LPDIRECT3DTEXTURE2) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DTexture2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirect3DTexture2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DTexture2_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DTexture2_GetHandle(p, a, b) (p)->lpVtbl->GetHandle(p, a, b) -#define IDirect3DTexture2_PaletteChanged(p, a, b) (p)->lpVtbl->PaletteChanged(p, a, b) -#define IDirect3DTexture2_Load(p, a) (p)->lpVtbl->Load(p, a) -#else -#define IDirect3DTexture2_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirect3DTexture2_AddRef(p) (p)->AddRef() -#define IDirect3DTexture2_Release(p) (p)->Release() -#define IDirect3DTexture2_GetHandle(p, a, b) (p)->GetHandle(a, b) -#define IDirect3DTexture2_PaletteChanged(p, a, b) (p)->PaletteChanged(a, b) -#define IDirect3DTexture2_Load(p, a) (p)->Load(a) -#endif - -/* - * IDirect3DViewport - */ -#undef INTERFACE -#define INTERFACE IDirect3DViewport -DECLARE_INTERFACE_(IDirect3DViewport, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef) (THIS) PURE; - STDMETHOD_(ULONG, Release) (THIS) PURE; - /*** IDirect3DViewport methods ***/ - STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE; - STDMETHOD(GetViewport) (THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(SetViewport) (THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(TransformVertices) (THIS_ DWORD, LPD3DTRANSFORMDATA, DWORD, LPDWORD) PURE; - STDMETHOD(LightElements) (THIS_ DWORD, LPD3DLIGHTDATA) PURE; - STDMETHOD(SetBackground) (THIS_ D3DMATERIALHANDLE) PURE; - STDMETHOD(GetBackground) (THIS_ LPD3DMATERIALHANDLE, LPBOOL) PURE; - STDMETHOD(SetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(GetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE*, LPBOOL) PURE; - STDMETHOD(Clear) (THIS_ DWORD, LPD3DRECT, DWORD) PURE; - STDMETHOD(AddLight) (THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(DeleteLight) (THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(NextLight) (THIS_ LPDIRECT3DLIGHT, LPDIRECT3DLIGHT*, DWORD) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DViewport_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirect3DViewport_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DViewport_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DViewport_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirect3DViewport_GetViewport(p, a) (p)->lpVtbl->GetViewport(p, a) -#define IDirect3DViewport_SetViewport(p, a) (p)->lpVtbl->SetViewport(p, a) -#define IDirect3DViewport_TransformVertices(p, a, b, c, d) (p)->lpVtbl->TransformVertices(p, a, b, c, d) -#define IDirect3DViewport_LightElements(p, a, b) (p)->lpVtbl->LightElements(p, a, b) -#define IDirect3DViewport_SetBackground(p, a) (p)->lpVtbl->SetBackground(p, a) -#define IDirect3DViewport_GetBackground(p, a, b) (p)->lpVtbl->GetBackground(p, a, b) -#define IDirect3DViewport_SetBackgroundDepth(p, a) (p)->lpVtbl->SetBackgroundDepth(p, a) -#define IDirect3DViewport_GetBackgroundDepth(p, a, b) (p)->lpVtbl->GetBackgroundDepth(p, a, b) -#define IDirect3DViewport_Clear(p, a, b, c) (p)->lpVtbl->Clear(p, a, b, c) -#define IDirect3DViewport_AddLight(p, a) (p)->lpVtbl->AddLight(p, a) -#define IDirect3DViewport_DeleteLight(p, a) (p)->lpVtbl->DeleteLight(p, a) -#define IDirect3DViewport_NextLight(p, a, b, c) (p)->lpVtbl->NextLight(p, a, b, c) -#else -#define IDirect3DViewport_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirect3DViewport_AddRef(p) (p)->AddRef() -#define IDirect3DViewport_Release(p) (p)->Release() -#define IDirect3DViewport_Initialize(p, a) (p)->Initialize(a) -#define IDirect3DViewport_GetViewport(p, a) (p)->GetViewport(a) -#define IDirect3DViewport_SetViewport(p, a) (p)->SetViewport(a) -#define IDirect3DViewport_TransformVertices(p, a, b, c, d) (p)->TransformVertices(a, b, c, d) -#define IDirect3DViewport_LightElements(p, a, b) (p)->LightElements(a, b) -#define IDirect3DViewport_SetBackground(p, a) (p)->SetBackground(a) -#define IDirect3DViewport_GetBackground(p, a, b) (p)->GetBackground(a, b) -#define IDirect3DViewport_SetBackgroundDepth(p, a) (p)->SetBackgroundDepth(a) -#define IDirect3DViewport_GetBackgroundDepth(p, a, b) (p)->GetBackgroundDepth(a, b) -#define IDirect3DViewport_Clear(p, a, b, c) (p)->Clear(a, b, c) -#define IDirect3DViewport_AddLight(p, a) (p)->AddLight(a) -#define IDirect3DViewport_DeleteLight(p, a) (p)->DeleteLight(a) -#define IDirect3DViewport_NextLight(p, a, b, c) (p)->NextLight(a, b, c) -#endif - -/* - * IDirect3DViewport2 - */ -#undef INTERFACE -#define INTERFACE IDirect3DViewport2 -DECLARE_INTERFACE_(IDirect3DViewport2, IDirect3DViewport) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef) (THIS) PURE; - STDMETHOD_(ULONG, Release) (THIS) PURE; - /*** IDirect3DViewport methods ***/ - STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE; - STDMETHOD(GetViewport) (THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(SetViewport) (THIS_ LPD3DVIEWPORT) PURE; - STDMETHOD(TransformVertices) (THIS_ DWORD, LPD3DTRANSFORMDATA, DWORD, LPDWORD) PURE; - STDMETHOD(LightElements) (THIS_ DWORD, LPD3DLIGHTDATA) PURE; - STDMETHOD(SetBackground) (THIS_ D3DMATERIALHANDLE) PURE; - STDMETHOD(GetBackground) (THIS_ LPD3DMATERIALHANDLE, LPBOOL) PURE; - STDMETHOD(SetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(GetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE*, LPBOOL) PURE; - STDMETHOD(Clear) (THIS_ DWORD, LPD3DRECT, DWORD) PURE; - STDMETHOD(AddLight) (THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(DeleteLight) (THIS_ LPDIRECT3DLIGHT) PURE; - STDMETHOD(NextLight) (THIS_ LPDIRECT3DLIGHT, LPDIRECT3DLIGHT*, DWORD) PURE; - /*** IDirect3DViewport2 methods ***/ - STDMETHOD(GetViewport2) (THIS_ LPD3DVIEWPORT2) PURE; - STDMETHOD(SetViewport2) (THIS_ LPD3DVIEWPORT2) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirect3DViewport2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirect3DViewport2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirect3DViewport2_Release(p) (p)->lpVtbl->Release(p) -#define IDirect3DViewport2_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirect3DViewport2_GetViewport(p, a) (p)->lpVtbl->GetViewport(p, a) -#define IDirect3DViewport2_SetViewport(p, a) (p)->lpVtbl->SetViewport(p, a) -#define IDirect3DViewport2_TransformVertices(p, a, b, c, d) (p)->lpVtbl->TransformVertices(p, a, b, c, d) -#define IDirect3DViewport2_LightElements(p, a, b) (p)->lpVtbl->LightElements(p, a, b) -#define IDirect3DViewport2_SetBackground(p, a) (p)->lpVtbl->SetBackground(p, a) -#define IDirect3DViewport2_GetBackground(p, a, b) (p)->lpVtbl->GetBackground(p, a, b) -#define IDirect3DViewport2_SetBackgroundDepth(p, a) (p)->lpVtbl->SetBackgroundDepth(p, a) -#define IDirect3DViewport2_GetBackgroundDepth(p, a, b) (p)->lpVtbl->GetBackgroundDepth(p, a, b) -#define IDirect3DViewport2_Clear(p, a, b, c) (p)->lpVtbl->Clear(p, a, b, c) -#define IDirect3DViewport2_AddLight(p, a) (p)->lpVtbl->AddLight(p, a) -#define IDirect3DViewport2_DeleteLight(p, a) (p)->lpVtbl->DeleteLight(p, a) -#define IDirect3DViewport2_NextLight(p, a, b, c) (p)->lpVtbl->NextLight(p, a, b, c) -#define IDirect3DViewport2_GetViewport2(p, a) (p)->lpVtbl->GetViewport2(p, a) -#define IDirect3DViewport2_SetViewport2(p, a) (p)->lpVtbl->SetViewport2(p, a) -#else -#define IDirect3DViewport2_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirect3DViewport2_AddRef(p) (p)->AddRef() -#define IDirect3DViewport2_Release(p) (p)->Release() -#define IDirect3DViewport2_Initialize(p, a) (p)->Initialize(a) -#define IDirect3DViewport2_GetViewport(p, a) (p)->GetViewport(a) -#define IDirect3DViewport2_SetViewport(p, a) (p)->SetViewport(a) -#define IDirect3DViewport2_TransformVertices(p, a, b, c, d) (p)->TransformVertices(a, b, c, d) -#define IDirect3DViewport2_LightElements(p, a, b) (p)->LightElements(a, b) -#define IDirect3DViewport2_SetBackground(p, a) (p)->SetBackground(a) -#define IDirect3DViewport2_GetBackground(p, a, b) (p)->GetBackground(a, b) -#define IDirect3DViewport2_SetBackgroundDepth(p, a) (p)->SetBackgroundDepth(a) -#define IDirect3DViewport2_GetBackgroundDepth(p, a, b) (p)->GetBackgroundDepth(a, b) -#define IDirect3DViewport2_Clear(p, a, b, c) (p)->Clear(a, b, c) -#define IDirect3DViewport2_AddLight(p, a) (p)->AddLight(a) -#define IDirect3DViewport2_DeleteLight(p, a) (p)->DeleteLight(a) -#define IDirect3DViewport2_NextLight(p, a, b, c) (p)->NextLight(a, b, c) -#define IDirect3DViewport2_GetViewport2(p, a) (p)->GetViewport2(a) -#define IDirect3DViewport2_SetViewport2(p, a) (p)->SetViewport2(a) -#endif - - -/**************************************************************************** - * - * Flags for IDirect3DDevice::NextViewport - * - ****************************************************************************/ - -/* - * Return the next viewport - */ -#define D3DNEXT_NEXT 0x00000001l - -/* - * Return the first viewport - */ -#define D3DNEXT_HEAD 0x00000002l - -/* - * Return the last viewport - */ -#define D3DNEXT_TAIL 0x00000004l - - -/**************************************************************************** - * - * Flags for DrawPrimitive/DrawIndexedPrimitive - * Also valid for Begin/BeginIndexed - * - ****************************************************************************/ - -/* - * Wait until the device is ready to draw the primitive - * This will cause DP to not return DDERR_WASSTILLDRAWING - */ -#define D3DDP_WAIT 0x00000001l - - -/* - * Hint that the primitives have been clipped by the application. - */ -#define D3DDP_DONOTCLIP 0x00000004l - -/* - * Hint that the extents need not be updated. - */ -#define D3DDP_DONOTUPDATEEXTENTS 0x00000008l - -/* - * Direct3D Errors - * DirectDraw error codes are used when errors not specified here. - */ -#define D3D_OK DD_OK -#define D3DERR_BADMAJORVERSION MAKE_DDHRESULT(700) -#define D3DERR_BADMINORVERSION MAKE_DDHRESULT(701) - -/* - * An invalid device was requested by the application. - */ -#define D3DERR_INVALID_DEVICE MAKE_DDHRESULT(705) -#define D3DERR_INITFAILED MAKE_DDHRESULT(706) - -/* - * SetRenderTarget attempted on a device that was - * QI'd off the render target. - */ -#define D3DERR_DEVICEAGGREGATED MAKE_DDHRESULT(707) - -#define D3DERR_EXECUTE_CREATE_FAILED MAKE_DDHRESULT(710) -#define D3DERR_EXECUTE_DESTROY_FAILED MAKE_DDHRESULT(711) -#define D3DERR_EXECUTE_LOCK_FAILED MAKE_DDHRESULT(712) -#define D3DERR_EXECUTE_UNLOCK_FAILED MAKE_DDHRESULT(713) -#define D3DERR_EXECUTE_LOCKED MAKE_DDHRESULT(714) -#define D3DERR_EXECUTE_NOT_LOCKED MAKE_DDHRESULT(715) - -#define D3DERR_EXECUTE_FAILED MAKE_DDHRESULT(716) -#define D3DERR_EXECUTE_CLIPPED_FAILED MAKE_DDHRESULT(717) - -#define D3DERR_TEXTURE_NO_SUPPORT MAKE_DDHRESULT(720) -#define D3DERR_TEXTURE_CREATE_FAILED MAKE_DDHRESULT(721) -#define D3DERR_TEXTURE_DESTROY_FAILED MAKE_DDHRESULT(722) -#define D3DERR_TEXTURE_LOCK_FAILED MAKE_DDHRESULT(723) -#define D3DERR_TEXTURE_UNLOCK_FAILED MAKE_DDHRESULT(724) -#define D3DERR_TEXTURE_LOAD_FAILED MAKE_DDHRESULT(725) -#define D3DERR_TEXTURE_SWAP_FAILED MAKE_DDHRESULT(726) -#define D3DERR_TEXTURE_LOCKED MAKE_DDHRESULT(727) -#define D3DERR_TEXTURE_NOT_LOCKED MAKE_DDHRESULT(728) -#define D3DERR_TEXTURE_GETSURF_FAILED MAKE_DDHRESULT(729) - -#define D3DERR_MATRIX_CREATE_FAILED MAKE_DDHRESULT(730) -#define D3DERR_MATRIX_DESTROY_FAILED MAKE_DDHRESULT(731) -#define D3DERR_MATRIX_SETDATA_FAILED MAKE_DDHRESULT(732) -#define D3DERR_MATRIX_GETDATA_FAILED MAKE_DDHRESULT(733) -#define D3DERR_SETVIEWPORTDATA_FAILED MAKE_DDHRESULT(734) - -#define D3DERR_INVALIDCURRENTVIEWPORT MAKE_DDHRESULT(735) -#define D3DERR_INVALIDPRIMITIVETYPE MAKE_DDHRESULT(736) -#define D3DERR_INVALIDVERTEXTYPE MAKE_DDHRESULT(737) -#define D3DERR_TEXTURE_BADSIZE MAKE_DDHRESULT(738) -#define D3DERR_INVALIDRAMPTEXTURE MAKE_DDHRESULT(739) - -#define D3DERR_MATERIAL_CREATE_FAILED MAKE_DDHRESULT(740) -#define D3DERR_MATERIAL_DESTROY_FAILED MAKE_DDHRESULT(741) -#define D3DERR_MATERIAL_SETDATA_FAILED MAKE_DDHRESULT(742) -#define D3DERR_MATERIAL_GETDATA_FAILED MAKE_DDHRESULT(743) -#define D3DERR_INVALIDPALETTE MAKE_DDHRESULT(744) - -#define D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY MAKE_DDHRESULT(745) -#define D3DERR_ZBUFF_NEEDS_VIDEOMEMORY MAKE_DDHRESULT(746) -#define D3DERR_SURFACENOTINVIDMEM MAKE_DDHRESULT(747) - -#define D3DERR_LIGHT_SET_FAILED MAKE_DDHRESULT(750) -#define D3DERR_LIGHTHASVIEWPORT MAKE_DDHRESULT(751) -#define D3DERR_LIGHTNOTINTHISVIEWPORT MAKE_DDHRESULT(752) - -#define D3DERR_SCENE_IN_SCENE MAKE_DDHRESULT(760) -#define D3DERR_SCENE_NOT_IN_SCENE MAKE_DDHRESULT(761) -#define D3DERR_SCENE_BEGIN_FAILED MAKE_DDHRESULT(762) -#define D3DERR_SCENE_END_FAILED MAKE_DDHRESULT(763) - -#define D3DERR_INBEGIN MAKE_DDHRESULT(770) -#define D3DERR_NOTINBEGIN MAKE_DDHRESULT(771) -#define D3DERR_NOVIEWPORTS MAKE_DDHRESULT(772) -#define D3DERR_VIEWPORTDATANOTSET MAKE_DDHRESULT(773) -#define D3DERR_VIEWPORTHASNODEVICE MAKE_DDHRESULT(774) -#define D3DERR_NOCURRENTVIEWPORT MAKE_DDHRESULT(775) - -#ifdef __cplusplus -}; -#endif - -#endif /* _D3D_H_ */ - diff --git a/include/vd3dcaps.h b/include/vd3dcaps.h deleted file mode 100644 index 660aabb..0000000 --- a/include/vd3dcaps.h +++ /dev/null @@ -1,314 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. - * - * File: d3dcaps.h - * Content: Direct3D capabilities include file - * - ***************************************************************************/ - -#ifndef _D3DCAPS_H -#define _D3DCAPS_H - -/* - * Pull in DirectDraw include file automatically: - */ -#include "vddraw.h" - -#pragma pack(4) - -/* Description of capabilities of transform */ - -typedef struct _D3DTRANSFORMCAPS { - DWORD dwSize; - DWORD dwCaps; -} D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS; - -#define D3DTRANSFORMCAPS_CLIP 0x00000001L /* Will clip whilst transforming */ - -/* Description of capabilities of lighting */ - -typedef struct _D3DLIGHTINGCAPS { - DWORD dwSize; - DWORD dwCaps; /* Lighting caps */ - DWORD dwLightingModel; /* Lighting model - RGB or mono */ - DWORD dwNumLights; /* Number of lights that can be handled */ -} D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS; - -#define D3DLIGHTINGMODEL_RGB 0x00000001L -#define D3DLIGHTINGMODEL_MONO 0x00000002L - -#define D3DLIGHTCAPS_POINT 0x00000001L /* Point lights supported */ -#define D3DLIGHTCAPS_SPOT 0x00000002L /* Spot lights supported */ -#define D3DLIGHTCAPS_DIRECTIONAL 0x00000004L /* Directional lights supported */ -#define D3DLIGHTCAPS_PARALLELPOINT 0x00000008L /* Parallel point lights supported */ - -/* Description of capabilities for each primitive type */ - -typedef struct _D3DPrimCaps { - DWORD dwSize; - DWORD dwMiscCaps; /* Capability flags */ - DWORD dwRasterCaps; - DWORD dwZCmpCaps; - DWORD dwSrcBlendCaps; - DWORD dwDestBlendCaps; - DWORD dwAlphaCmpCaps; - DWORD dwShadeCaps; - DWORD dwTextureCaps; - DWORD dwTextureFilterCaps; - DWORD dwTextureBlendCaps; - DWORD dwTextureAddressCaps; - DWORD dwStippleWidth; /* maximum width and height of */ - DWORD dwStippleHeight; /* of supported stipple (up to 32x32) */ -} D3DPRIMCAPS, *LPD3DPRIMCAPS; - -/* D3DPRIMCAPS dwMiscCaps */ - -#define D3DPMISCCAPS_MASKPLANES 0x00000001L -#define D3DPMISCCAPS_MASKZ 0x00000002L -#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L -#define D3DPMISCCAPS_CONFORMANT 0x00000008L -#define D3DPMISCCAPS_CULLNONE 0x00000010L -#define D3DPMISCCAPS_CULLCW 0x00000020L -#define D3DPMISCCAPS_CULLCCW 0x00000040L - -/* D3DPRIMCAPS dwRasterCaps */ - -#define D3DPRASTERCAPS_DITHER 0x00000001L -#define D3DPRASTERCAPS_ROP2 0x00000002L -#define D3DPRASTERCAPS_XOR 0x00000004L -#define D3DPRASTERCAPS_PAT 0x00000008L -#define D3DPRASTERCAPS_ZTEST 0x00000010L -#define D3DPRASTERCAPS_SUBPIXEL 0x00000020L -#define D3DPRASTERCAPS_SUBPIXELX 0x00000040L -#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L -#define D3DPRASTERCAPS_FOGTABLE 0x00000100L -#define D3DPRASTERCAPS_STIPPLE 0x00000200L -#define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT 0x00000400L -#define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800L -#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L -#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L -#define D3DPRASTERCAPS_ZBIAS 0x00004000L -#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L -#define D3DPRASTERCAPS_FOGRANGE 0x00010000L -#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L - -/* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */ - -#define D3DPCMPCAPS_NEVER 0x00000001L -#define D3DPCMPCAPS_LESS 0x00000002L -#define D3DPCMPCAPS_EQUAL 0x00000004L -#define D3DPCMPCAPS_LESSEQUAL 0x00000008L -#define D3DPCMPCAPS_GREATER 0x00000010L -#define D3DPCMPCAPS_NOTEQUAL 0x00000020L -#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L -#define D3DPCMPCAPS_ALWAYS 0x00000080L - -/* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */ - -#define D3DPBLENDCAPS_ZERO 0x00000001L -#define D3DPBLENDCAPS_ONE 0x00000002L -#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L -#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L -#define D3DPBLENDCAPS_SRCALPHA 0x00000010L -#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L -#define D3DPBLENDCAPS_DESTALPHA 0x00000040L -#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L -#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L -#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L -#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L -#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L -#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L - -/* D3DPRIMCAPS dwShadeCaps */ - -#define D3DPSHADECAPS_COLORFLATMONO 0x00000001L -#define D3DPSHADECAPS_COLORFLATRGB 0x00000002L -#define D3DPSHADECAPS_COLORGOURAUDMONO 0x00000004L -#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L -#define D3DPSHADECAPS_COLORPHONGMONO 0x00000010L -#define D3DPSHADECAPS_COLORPHONGRGB 0x00000020L - -#define D3DPSHADECAPS_SPECULARFLATMONO 0x00000040L -#define D3DPSHADECAPS_SPECULARFLATRGB 0x00000080L -#define D3DPSHADECAPS_SPECULARGOURAUDMONO 0x00000100L -#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L -#define D3DPSHADECAPS_SPECULARPHONGMONO 0x00000400L -#define D3DPSHADECAPS_SPECULARPHONGRGB 0x00000800L - -#define D3DPSHADECAPS_ALPHAFLATBLEND 0x00001000L -#define D3DPSHADECAPS_ALPHAFLATSTIPPLED 0x00002000L -#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L -#define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED 0x00008000L -#define D3DPSHADECAPS_ALPHAPHONGBLEND 0x00010000L -#define D3DPSHADECAPS_ALPHAPHONGSTIPPLED 0x00020000L - -#define D3DPSHADECAPS_FOGFLAT 0x00040000L -#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L -#define D3DPSHADECAPS_FOGPHONG 0x00100000L - -/* D3DPRIMCAPS dwTextureCaps */ - -#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L -#define D3DPTEXTURECAPS_POW2 0x00000002L -#define D3DPTEXTURECAPS_ALPHA 0x00000004L -#define D3DPTEXTURECAPS_TRANSPARENCY 0x00000008L -#define D3DPTEXTURECAPS_BORDER 0x00000010L -#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L - -/* D3DPRIMCAPS dwTextureFilterCaps */ - -#define D3DPTFILTERCAPS_NEAREST 0x00000001L -#define D3DPTFILTERCAPS_LINEAR 0x00000002L -#define D3DPTFILTERCAPS_MIPNEAREST 0x00000004L -#define D3DPTFILTERCAPS_MIPLINEAR 0x00000008L -#define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L -#define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L - -/* D3DPRIMCAPS dwTextureBlendCaps */ - -#define D3DPTBLENDCAPS_DECAL 0x00000001L -#define D3DPTBLENDCAPS_MODULATE 0x00000002L -#define D3DPTBLENDCAPS_DECALALPHA 0x00000004L -#define D3DPTBLENDCAPS_MODULATEALPHA 0x00000008L -#define D3DPTBLENDCAPS_DECALMASK 0x00000010L -#define D3DPTBLENDCAPS_MODULATEMASK 0x00000020L -#define D3DPTBLENDCAPS_COPY 0x00000040L -#define D3DPTBLENDCAPS_ADD 0x00000080L - -/* D3DPRIMCAPS dwTextureAddressCaps */ -#define D3DPTADDRESSCAPS_WRAP 0x00000001L -#define D3DPTADDRESSCAPS_MIRROR 0x00000002L -#define D3DPTADDRESSCAPS_CLAMP 0x00000004L -#define D3DPTADDRESSCAPS_BORDER 0x00000008L -#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L - -/* - * Description for a device. - * This is used to describe a device that is to be created or to query - * the current device. - */ -typedef struct _D3DDeviceDesc { - DWORD dwSize; /* Size of D3DDEVICEDESC structure */ - DWORD dwFlags; /* Indicates which fields have valid data */ - D3DCOLORMODEL dcmColorModel; /* Color model of device */ - DWORD dwDevCaps; /* Capabilities of device */ - D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */ - BOOL bClipping; /* Device can do 3D clipping */ - D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */ - D3DPRIMCAPS dpcLineCaps; - D3DPRIMCAPS dpcTriCaps; - DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */ - DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */ - DWORD dwMaxBufferSize; /* Maximum execute buffer size */ - DWORD dwMaxVertexCount; /* Maximum vertex count */ - // *** New fields for DX5 *** // - - // Width and height caps are 0 for legacy HALs. - DWORD dwMinTextureWidth, dwMinTextureHeight; - DWORD dwMaxTextureWidth, dwMaxTextureHeight; - DWORD dwMinStippleWidth, dwMaxStippleWidth; - DWORD dwMinStippleHeight, dwMaxStippleHeight; -} D3DDEVICEDESC, *LPD3DDEVICEDESC; - -#define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC)) - -typedef HRESULT (FAR PASCAL * LPD3DENUMDEVICESCALLBACK)(LPGUID lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID); - -/* D3DDEVICEDESC dwFlags indicating valid fields */ - -#define D3DDD_COLORMODEL 0x00000001L /* dcmColorModel is valid */ -#define D3DDD_DEVCAPS 0x00000002L /* dwDevCaps is valid */ -#define D3DDD_TRANSFORMCAPS 0x00000004L /* dtcTransformCaps is valid */ -#define D3DDD_LIGHTINGCAPS 0x00000008L /* dlcLightingCaps is valid */ -#define D3DDD_BCLIPPING 0x00000010L /* bClipping is valid */ -#define D3DDD_LINECAPS 0x00000020L /* dpcLineCaps is valid */ -#define D3DDD_TRICAPS 0x00000040L /* dpcTriCaps is valid */ -#define D3DDD_DEVICERENDERBITDEPTH 0x00000080L /* dwDeviceRenderBitDepth is valid */ -#define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */ -#define D3DDD_MAXBUFFERSIZE 0x00000200L /* dwMaxBufferSize is valid */ -#define D3DDD_MAXVERTEXCOUNT 0x00000400L /* dwMaxVertexCount is valid */ - -/* D3DDEVICEDESC dwDevCaps flags */ - -#define D3DDEVCAPS_FLOATTLVERTEX 0x00000001L /* Device accepts floating point */ - /* for post-transform vertex data */ -#define D3DDEVCAPS_SORTINCREASINGZ 0x00000002L /* Device needs data sorted for increasing Z*/ -#define D3DDEVCAPS_SORTDECREASINGZ 0X00000004L /* Device needs data sorted for decreasing Z*/ -#define D3DDEVCAPS_SORTEXACT 0x00000008L /* Device needs data sorted exactly */ - -#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */ -#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */ -#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */ -#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */ -#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */ -#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */ -#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */ -#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */ -#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */ - -#define D3DFDS_COLORMODEL 0x00000001L /* Match color model */ -#define D3DFDS_GUID 0x00000002L /* Match guid */ -#define D3DFDS_HARDWARE 0x00000004L /* Match hardware/software */ -#define D3DFDS_TRIANGLES 0x00000008L /* Match in triCaps */ -#define D3DFDS_LINES 0x00000010L /* Match in lineCaps */ -#define D3DFDS_MISCCAPS 0x00000020L /* Match primCaps.dwMiscCaps */ -#define D3DFDS_RASTERCAPS 0x00000040L /* Match primCaps.dwRasterCaps */ -#define D3DFDS_ZCMPCAPS 0x00000080L /* Match primCaps.dwZCmpCaps */ -#define D3DFDS_ALPHACMPCAPS 0x00000100L /* Match primCaps.dwAlphaCmpCaps */ -#define D3DFDS_SRCBLENDCAPS 0x00000200L /* Match primCaps.dwSourceBlendCaps */ -#define D3DFDS_DSTBLENDCAPS 0x00000400L /* Match primCaps.dwDestBlendCaps */ -#define D3DFDS_SHADECAPS 0x00000800L /* Match primCaps.dwShadeCaps */ -#define D3DFDS_TEXTURECAPS 0x00001000L /* Match primCaps.dwTextureCaps */ -#define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */ -#define D3DFDS_TEXTUREBLENDCAPS 0x00004000L /* Match primCaps.dwTextureBlendCaps */ -#define D3DFDS_TEXTUREADDRESSCAPS 0x00008000L /* Match primCaps.dwTextureBlendCaps */ - -/* - * FindDevice arguments - */ -typedef struct _D3DFINDDEVICESEARCH { - DWORD dwSize; - DWORD dwFlags; - BOOL bHardware; - D3DCOLORMODEL dcmColorModel; - GUID guid; - DWORD dwCaps; - D3DPRIMCAPS dpcPrimCaps; -} D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH; - -typedef struct _D3DFINDDEVICERESULT { - DWORD dwSize; - GUID guid; /* guid which matched */ - D3DDEVICEDESC ddHwDesc; /* hardware D3DDEVICEDESC */ - D3DDEVICEDESC ddSwDesc; /* software D3DDEVICEDESC */ -} D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT; - - -/* - * Description of execute buffer. - */ -typedef struct _D3DExecuteBufferDesc { - DWORD dwSize; /* size of this structure */ - DWORD dwFlags; /* flags indicating which fields are valid */ - DWORD dwCaps; /* capabilities of execute buffer */ - DWORD dwBufferSize; /* size of execute buffer data */ - LPVOID lpData; /* pointer to actual data */ -} D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC; - -/* D3DEXECUTEBUFFER dwFlags indicating valid fields */ - -#define D3DDEB_BUFSIZE 0x00000001l /* buffer size valid */ -#define D3DDEB_CAPS 0x00000002l /* caps valid */ -#define D3DDEB_LPDATA 0x00000004l /* lpData valid */ - -/* D3DEXECUTEBUFFER dwCaps */ - -#define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l /* buffer in system memory */ -#define D3DDEBCAPS_VIDEOMEMORY 0x00000002l /* buffer in device memory */ -#define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY) - -#pragma pack() - -#endif /* _D3DCAPS_H_ */ - diff --git a/include/vd3di.h b/include/vd3di.h deleted file mode 100644 index cf5601a..0000000 --- a/include/vd3di.h +++ /dev/null @@ -1,794 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. - * - * File: d3di.h - * Content: Direct3D internal include file - *@@BEGIN_MSINTERNAL - * - * $Id$ - * - * History: - * Date By Reason - * ==== == ====== - * 05/11/95 stevela Initial rev with this header. - * 11/11/95 stevela Light code changed. - * 21/11/95 colinmc Made Direct3D aggregatable - * (so it can be QI'd off DirectDraw). - * 23/11/95 colinmc Made Direct3D textures and devices aggregatable - * (QI'd off DirectDrawSurfaces). - * 07/12/95 stevela Merged in Colin's changes. - * 10/12/95 stevela Removed AGGREGATE_D3D. - * Removed Validate macros from here. Now in d3dpr.h - * 02/03/96 colinmc Minor build fix - * 17/04/96 stevela Use ddraw.h externally and ddrawp.h internally - *@@END_MSINTERNAL - * - ***************************************************************************/ - -#ifndef _D3DI_H -#define _D3DI_H - -//@@BEGIN_MSINTERNAL -#include "vddrawp.h" -#if 0 -//@@END_MSINTERNAL -#include "vddraw.h" -//@@BEGIN_MSINTERNAL -#endif -//@@END_MSINTERNAL -#include "vd3d.h" - -// @@BEGIN_MSINTERNAL -#if !defined(BUILD_RLAPI) && !defined(BUILD_DDDDK) -#include "vddrawi.h" - -#include "rlreg.h" -#include "lists.h" -#include "object.h" - - -/* - INDEX_BATCH_SCALE is the constant which is used by DrawIndexedPrim - to deterimine if the number of primitives being drawn is small - relative to the number of vertices being passed. If it is then - the prims are dereferenced in batches and sent to DrawPrim. -*/ -#define INDEX_BATCH_SCALE 2 - -/* -typedef D3DCOLORMODEL D3DCOLORMODEL; - -#define D3DCOLOR_RAMP D3DCOLOR_RAMP -#define D3DCOLOR_RGB D3DCOLOR_RGB -#define D3D_COLORMODEL D3D_COLORMODEL -*/ -#endif /* !BUILD_RLAPI */ -// @@END_MSINTERNAL - -typedef DWORD D3DI_BUFFERHANDLE, *LPD3DI_BUFFERHANDLE; - -/* - * Internal version of executedata - */ -typedef struct _D3DI_ExecuteData { - DWORD dwSize; - D3DI_BUFFERHANDLE dwHandle; /* Handle allocated by driver */ - DWORD dwVertexOffset; - DWORD dwVertexCount; - DWORD dwInstructionOffset; - DWORD dwInstructionLength; - DWORD dwHVertexOffset; - D3DSTATUS dsStatus; /* Status after execute */ -} D3DI_EXECUTEDATA, *LPD3DI_EXECUTEDATA; - -/* - * Internal version of lightdata and constants for flags - */ - -#define D3DLIGHTI_ATT0_IS_NONZERO (0x00010000) -#define D3DLIGHTI_ATT1_IS_NONZERO (0x00020000) -#define D3DLIGHTI_ATT2_IS_NONZERO (0x00040000) -#define D3DLIGHTI_LINEAR_FALLOFF (0x00080000) -#define D3DLIGHTI_UNIT_SCALE (0x00100000) -#define D3DLIGHTI_LIGHT_AT_EYE (0x00200000) - -typedef struct _D3DI_LIGHT { - D3DLIGHTTYPE type; - DWORD version; /* matches number on D3DLIGHT struct */ - BOOL valid; - D3DVALUE red, green, blue, shade; - D3DVECTOR position; - D3DVECTOR model_position; - D3DVECTOR direction; - D3DVECTOR model_direction; - D3DVECTOR halfway; - D3DVECTOR model_eye; /* direction from eye in model space */ - D3DVECTOR model_scale; /* model scale for proper range computations */ - D3DVALUE range; - D3DVALUE range_squared; - D3DVALUE falloff; - D3DVALUE attenuation0; - D3DVALUE attenuation1; - D3DVALUE attenuation2; - D3DVALUE cos_theta_by_2; - D3DVALUE cos_phi_by_2; - DWORD flags; -} D3DI_LIGHT, *LPD3DI_LIGHT; - -// @@BEGIN_MSINTERNAL -#if !defined(BUILD_RLAPI) && !defined(BUILD_DDDDK) -#ifndef BUILD_HEL -#ifdef BUILD_D3D_LAYER -#include "driver.h" -#endif - -typedef struct IUnknownVtbl D3DUNKNOWNCALLBACKS, *LPD3DUNKNOWNCALLBACKS; -typedef struct ID3DObjectVtbl D3DOBJECTVTBL, *LPD3DOBJECTVTBL; -typedef struct IDirect3DVtbl DIRECT3DCALLBACKS, *LPDIRECT3DCALLBACKS; -typedef struct IDirect3D2Vtbl DIRECT3D2CALLBACKS, *LPDIRECT3D2CALLBACKS; -typedef struct IDirect3DDeviceVtbl DIRECT3DDEVICECALLBACKS, *LPDIRECT3DDEVICECALLBACKS; -typedef struct IDirect3DDevice2Vtbl DIRECT3DDEVICE2CALLBACKS, *LPDIRECT3DDEVICE2CALLBACKS; -typedef struct IDirect3DExecuteBufferVtbl DIRECT3DEXECUTEBUFFERCALLBACKS, *LPDIRECT3DEXECUTEBUFFERCALLBACKS; -typedef struct IDirect3DLightVtbl DIRECT3DLIGHTCALLBACKS, *LPDIRECT3DLIGHTCALLBACKS; -typedef struct IDirect3DMaterialVtbl DIRECT3DMATERIALCALLBACKS, *LPDIRECT3DMATERIALCALLBACKS; -typedef struct IDirect3DMaterial2Vtbl DIRECT3DMATERIAL2CALLBACKS, *LPDIRECT3DMATERIAL2CALLBACKS; -typedef struct IDirect3DTextureVtbl DIRECT3DTEXTURECALLBACKS, *LPDIRECT3DTEXTURECALLBACKS; -typedef struct IDirect3DTexture2Vtbl DIRECT3DTEXTURE2CALLBACKS, *LPDIRECT3DTEXTURE2CALLBACKS; -typedef struct IDirect3DViewport2Vtbl DIRECT3DVIEWPORT2CALLBACKS, *LPDIRECT3DVIEWPORT2CALLBACKS; - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct _DIRECT3DI *LPDIRECT3DI; -typedef struct _DIRECT3DDEVICEI *LPDIRECT3DDEVICEI; -typedef struct _DIRECT3DEXECUTEBUFFERI *LPDIRECT3DEXECUTEBUFFERI; -typedef struct _DIRECT3DLIGHTI *LPDIRECT3DLIGHTI; -typedef struct _DIRECT3DMATERIALI *LPDIRECT3DMATERIALI; -typedef struct _DIRECT3DTEXTUREI *LPDIRECT3DTEXTUREI; -typedef struct _DIRECT3DVIEWPORTI *LPDIRECT3DVIEWPORTI; - -/* - * If we have an aggregate Direct3D we need a structure to - * represent an interface distinct from the underlying - * object. This is that structure. None of this would be necessary - * in C++ - */ -typedef struct _DIRECT3DUNKNOWNI -{ - LPD3DUNKNOWNCALLBACKS lpVtbl; - LPDIRECT3DI lpObj; -} DIRECT3DUNKNOWNI; -typedef struct _DIRECT3DUNKNOWNI *LPDIRECT3DUNKNOWNI; - -typedef struct _DIRECT3DOLDI -{ - LPDIRECT3DCALLBACKS lpVtbl; - LPDIRECT3DI lpObj; -} DIRECT3DOLDI; -typedef struct _DIRECT3DOLDI *LPDIRECT3DOLDI; - -/* - * Internal version of Direct3D object; it has data after the vtable - */ -typedef struct _DIRECT3DI -{ - /*** Object Interface ***/ - LPDIRECT3D2CALLBACKS lpVtbl; /* Pointer to callbacks */ - int refCnt; /* Reference count object */ - - /*** Object Relations ***/ - /* Devices */ - int numDevs;/* Number of devices */ - LIST_ROOT(_devices, _DIRECT3DDEVICEI) devices; - /* Associated IDirect3DDevices */ - - /* Viewports */ - int numViewports; /* Number of viewports */ - LIST_ROOT(_viewports, _DIRECT3DVIEWPORTI) viewports; - /* Created IDirect3DViewports */ - - /* Lights */ - int numLights; /* Number of lights */ - LIST_ROOT(_lights, _DIRECT3DLIGHTI) lights; - /* Created IDirect3DLights */ - - /* Materials */ - int numMaterials; /* Number of materials */ - LIST_ROOT(_materials, _DIRECT3DMATERIALI) materials; - /* Created IDirect3DMaterials */ - - /*** Object Data ***/ - unsigned long v_next; /* id of next viewport to be created */ - RLDDIRegistry* lpReg; /* Registry */ - - /* - * DirectDraw Interface - */ - LPDDRAWI_DIRECTDRAW_INT lpDDInt; - - /* - * The special IUnknown interface for the aggregate that does - * not punt to the parent object. - */ - LPUNKNOWN lpOwningIUnknown; /* The owning IUnknown */ - DIRECT3DUNKNOWNI lpThisIUnknown; /* Our IUnknown interface */ - DIRECT3DOLDI lpThisIDirect3D; /* Our IDirect3D interface */ - - DWORD dwVersion; /* 1 for legacy D3D, 2 for D3D2 */ -} DIRECT3DI; - -/* - * If we have an aggreate Direct3DDevice we need a structure to - * represent an interface distinct from the underlying - * object. This is that structure. - */ -typedef struct _DIRECT3DDEVICEUNKNOWNI -{ - LPDIRECT3DDEVICE2CALLBACKS lpVtbl; - LPDIRECT3DDEVICEI lpObj; -} DIRECT3DDEVICEUNKNOWNI; -typedef struct _DIRECT3DDEVICEUNKNOWNI *LPDIRECT3DDEVICEUNKNOWNI; - -typedef struct _DIRECT3DDEVICEOLDI -{ - LPDIRECT3DDEVICECALLBACKS lpVtbl; - LPDIRECT3DDEVICEI lpObj; -} DIRECT3DDEVICEOLDI; -typedef struct _DIRECT3DDEVICEOLDI *LPDIRECT3DDEVICEOLDI; - -/* - * Internal version of Direct3DDevice object; it has data after the vtable - */ - -#include "vd3dhal.h" - -typedef RLDDIDriver* (*RLDDIDDrawCreateDriverFn)( - LPDDRAWI_DIRECTDRAW_INT lpDDInt, - LPDIRECTDRAWSURFACE lpDDS, - LPDIRECTDRAWSURFACE lpZ, - LPDIRECTDRAWPALETTE lpPal, - LPDIRECT3DDEVICEI); - -typedef HRESULT (*RLDDIGetCapsFn)(LPD3DDEVICEDESC*, LPD3DDEVICEDESC*); -typedef void (*RLDDIInitFn)(RLDDIMallocFn, RLDDIReallocFn, RLDDIFreeFn, RLDDIRaiseFn, RLDDIValue**, int, int); -typedef void (*RLDDIPushDriverFn)(RLDDIDriverStack*, RLDDIDriver*); -typedef void (*RLDDIPopDriverFn)(RLDDIDriverStack*); - -struct _RLDDIGenRasDriver; -typedef struct _RLDDIGenRasDriver* LPRLDDIGENRASDRIVER; -struct _RLDDIDDrawDriver; -typedef struct _RLDDIDDrawDriver* LPRLDDIDDRAWDRIVER; - -struct _RLDDITransformDriver; -typedef struct _RLDDITransformDriver* LPRLDDITRANSFORMDRIVER; - -typedef HRESULT (*PFNLOCKTEXTURE)(LPRLDDIGENRASDRIVER driver); -typedef void (*PFNUNLOCKTEXTURE)(LPRLDDIGENRASDRIVER driver); -typedef int (*PFNSETFILLPARAMS)(LPRLDDIGENRASDRIVER driver, D3DSTATE* in_params, - int count); -typedef HRESULT (*PFNREALLOCALIGNED)(void** p_inout, size_t size); -typedef HRESULT (*PFNMALLOCALIGNED)(void** p_inout, size_t size); -typedef HRESULT (*PFNFREEALIGNED)(void* p_inout); -typedef HRESULT (*PFNDRVSETRENDERTARGET)(LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE, - LPDIRECTDRAWPALETTE, LPDIRECT3DDEVICEI); -typedef HRESULT (*PFNDOFLUSHBEGINEND)(LPDIRECT3DDEVICE2, DWORD); -typedef HRESULT (*PFNDRAWPRIMITIVES)(LPDIRECT3DDEVICEI, LPD3DTLVERTEX, LPVOID, LPD3DINSTRUCTION, DWORD); - - -typedef struct _D3DI_TEXTUREBLOCK -{ - LIST_MEMBER(_D3DI_TEXTUREBLOCK) list; - /* Next block in IDirect3DTexture */ - LIST_MEMBER(_D3DI_TEXTUREBLOCK) devList; - /* Next block in IDirect3DDevice */ - LPDIRECT3DDEVICEI lpD3DDeviceI; - LPDIRECT3DTEXTUREI lpD3DTextureI; - D3DTEXTUREHANDLE hTex; - /* texture handle */ -} D3DI_TEXTUREBLOCK; -typedef struct _D3DI_TEXTUREBLOCK *LPD3DI_TEXTUREBLOCK; - -typedef struct _D3DI_MATERIALBLOCK -{ - LIST_MEMBER(_D3DI_MATERIALBLOCK) list; - /* Next block in IDirect3DMaterial */ - LIST_MEMBER(_D3DI_MATERIALBLOCK) devList; - /* Next block in IDirect3DDevice */ - LPDIRECT3DDEVICEI lpD3DDeviceI; - LPDIRECT3DMATERIALI lpD3DMaterialI; - D3DMATERIALHANDLE hMat; - /* material handle */ -} D3DI_MATERIALBLOCK; -typedef struct _D3DI_MATERIALBLOCK *LPD3DI_MATERIALBLOCK; - -#define D3D_RSTATEBUF_SIZE 128 -#define D3D_MAX_RSTATES 96 /* Last render state ID + 1 */ -#define D3D_MAX_MMX_VERTICES 1024 - -extern DWORD dwD3DTriBatchSize, dwTriBatchSize, dwLineBatchSize; -extern DWORD dwHWBufferSize, dwHWMaxTris; -extern DWORD dwHWFewVertices; - -typedef struct _D3DHAL_DRAWPRIMCOUNTS *LPD3DHAL_DRAWPRIMCOUNTS; - -// Legacy HAL batching is done with these structs. -typedef struct _D3DI_HWCOUNTS { - WORD wNumStateChanges; // Number of state changes batched - WORD wNumVertices; // Number of vertices in tri list - WORD wNumTriangles; // Number of triangles in tri list -} D3DI_HWCOUNTS, *LPD3DI_HWCOUNTS; - -typedef struct _DIRECT3DDEVICEI -{ - /*** Object Interface ***/ - LPDIRECT3DDEVICE2CALLBACKS lpVtbl; /* Pointer to callbacks */ - int refCnt; /* Reference count */ - - /*** Object Relations ***/ - LPDIRECT3DI lpDirect3DI; /* parent */ - LIST_MEMBER(_DIRECT3DDEVICEI)list; /* Next device IDirect3D */ - - /* Textures */ - LIST_ROOT(_textures, _D3DI_TEXTUREBLOCK) texBlocks; - /* Ref to created IDirect3DTextures */ - - /* Execute buffers */ - LIST_ROOT(_buffers, _DIRECT3DEXECUTEBUFFERI) buffers; - /* Created IDirect3DExecuteBuffers */ - - /* Viewports */ - int numViewports; - CIRCLE_QUEUE_ROOT(_dviewports, _DIRECT3DVIEWPORTI) viewports; - /* Associated IDirect3DViewports */ - LPDIRECT3DVIEWPORT2 lpCurrentViewport; - - /* Materials */ - LIST_ROOT(_dmmaterials, _D3DI_MATERIALBLOCK) matBlocks; - /* Ref to associated IDirect3DMaterials */ - - /*** Object Data ***/ - /* Private interfaces */ - LPD3DOBJECTVTBL lpClassVtbl; /* Private Vtbl */ - LPD3DOBJECTVTBL lpObjVtbl; /* Private Vtbl */ - - LPD3DHAL_CALLBACKS lpD3DHALCallbacks; /* HW specific */ - LPD3DHAL_GLOBALDRIVERDATA lpD3DHALGlobalDriverData; /* HW specific */ - - /* Viewports */ - unsigned long v_id; /* ID of last viewport rendered */ - - /* Lights */ - int numLights; - /* This indicates the maximum number - of lights that have been set in - the device. */ - - /* Device characteristics */ - int age; - int width; - int height; - int depth; - unsigned long red_mask, green_mask, blue_mask; - - int dither; - int ramp_size; /* SW specific */ - D3DCOLORMODEL color_model; - int wireframe_options; - D3DTEXTUREFILTER texture_quality; - D3DVALUE gamma; - unsigned char gamma_table[256]; - int aspectx, aspecty; - D3DVALUE perspective_tolerance; - - /* Library information */ -#ifdef WIN32 - HINSTANCE hDrvDll; - char dllname[MAXPATH]; - char base[256]; -#endif -#ifdef SHLIB - void* so; -#endif - - /* Are we in a scene? */ - BOOL bInScene; - - /* Our Device type */ - GUID guid; - - /* GetCaps function from the library */ - RLDDIGetCapsFn GetCapsFn; - - /* Functions required to build driver */ - RLDDIInitFn RLDDIInit; - RLDDIPushDriverFn RLDDIPushDriver; - RLDDIPopDriverFn RLDDIPopDriver; - RLDDIDDrawCreateDriverFn RLDDIDDrawCreateDriver; - - /* Device description */ - D3DDEVICEDESC d3dHWDevDesc; - D3DDEVICEDESC d3dHELDevDesc; - - /* Driver stack */ - RLDDIDriverStack* stack; - - /* - * The special IUnknown interface for the aggregate that does - * not punt to the parent object. - */ - LPUNKNOWN lpOwningIUnknown; /* The owning IUnknown */ - DIRECT3DDEVICEUNKNOWNI lpThisIUnknown; /* Our IUnknown interface */ - DIRECT3DDEVICEOLDI lpThisID3DDev; /* Our IDirect3DDevice interface */ - - LPD3DHAL_CALLBACKS2 lpD3DHALCallbacks2; /* HW specific */ - - /* - * Renderstate cache for DrawPrimitive - */ - WORD wRStateBufLevel; - D3DSTATE renStateBuf[D3D_RSTATEBUF_SIZE]; - - /* Pointers to drivers used by DrawPrimitive */ - LPRLDDIGENRASDRIVER rasDriver; /* SW specific */ - LPRLDDITRANSFORMDRIVER xfmDriver; /* Assumed to be NULL for HW */ - LPRLDDIDDRAWDRIVER drawDriver; /* Assumed to be NULL for HW */ - - /* - * Pointers to functions used by DrawPrim&Begin/End - */ - - PFNLOCKTEXTURE pfnLockTexture; /* SW specific */ - PFNUNLOCKTEXTURE pfnUnlockTexture; /* SW specific */ - PFNSETFILLPARAMS pfnSetFillParams; /* SW specific */ - PFNREALLOCALIGNED pfnReallocAligned; /* SW specific */ - PFNDRVSETRENDERTARGET pfnDrvSetRenderTarget; /* SW specific */ - HRESULT (*pfnFlushStates)(struct _DIRECT3DDEVICEI*); - PFNDOFLUSHBEGINEND pfnDoFlushBeginEnd; - PFNDRAWPRIMITIVES pfnDrawPrimitives; - - /* Are we between Begin/End? */ - BOOL bInBegin; - D3DVERTEXTYPE vtVertexType; - D3DPRIMITIVETYPE ptPrimitiveType; - CRITICAL_SECTION BeginEndCSect; - - // max number of vertices - #define BEGIN_DATA_BLOCK_SIZE 256 - - LPVOID lpvVertexBatch; - WORD *lpIndexBatch; - - // lpvVertexData is non-NULL if we are InBegin and indexed. - LPVOID lpvVertexData; - DWORD dwNumVertices; - DWORD dwMaxVertexCount; // current number of vertices there is space for - WORD *lpVertexIndices; - DWORD dwNumIndices; - DWORD dwMaxIndexCount; // current number of indices there is space for - - DWORD dwFlags; - WORD wFlushed; - - /* - * DrawPrimitives batching - */ - - - // Buffer to put DrawPrimitives stuff into - // Used for both legacy and DrawPrimitive HALs - WORD *lpwDPBuffer; - WORD *lpwDPBufferAlloced; - - /* Legacy HALs */ - // pointer to current prim counts struct - LPD3DHAL_DRAWPRIMCOUNTS lpDPPrimCounts; - - // Buffer of counts structures that keep track of the - // number of render states and vertices buffered - LPD3DI_HWCOUNTS lpHWCounts; - - // Buffer of triangle structures. - LPD3DTRIANGLE lpHWTris; - - // Buffer of interleaved render states and primitives. - LPD3DTLVERTEX lpHWVertices; - - // Byte offset into lpHWVertices. This gets incremented - // by 8 when a render state is batched and by 32*dwNumVertices - // when a primitive is batched. - DWORD dwHWOffset; - - // Max value of dwHWOffset. Used to decide whether to flush. - DWORD dwHWMaxOffset; - - // Index into lpHWTris. - DWORD dwHWTriIndex; - - // Number of counts structures used so far. This actually - // gives the number of primitives batched and the index of - // the counts structure to batch render states into. - DWORD dwHWNumCounts; - - /* DrawPrimitive-aware HALs */ - - // Byte offset into buffer (we are currently - // using the device's wTriIndex) - DWORD dwDPOffset; - - // Maximum offset. If dwDPOffset exceeds this, it is - // time to flush. - DWORD dwDPMaxOffset; - - WORD *wTriIndex; - - // buffers for TL and H vertices - LPD3DTLVERTEX lpTLVbuf; - LPD3DHVERTEX lpHVbuf; - DWORD dwVbufSize; - - LPD3DHAL_D3DEXTENDEDCAPS lpD3DExtendedCaps; /* HW specific */ - -} DIRECT3DDEVICEI; - -/* - * Internal version of Direct3DExecuteBuffer object; - * it has data after the vtable - */ -typedef struct _DIRECT3DEXECUTEBUFFERI -{ - /*** Object Interface ***/ - LPDIRECT3DEXECUTEBUFFERCALLBACKS lpVtbl; /* Pointer to callbacks */ - int refCnt; /* Reference count */ - - /*** Object Relations ***/ - LPDIRECT3DDEVICEI lpD3DDeviceI; /* Parent */ - LIST_MEMBER(_DIRECT3DEXECUTEBUFFERI)list; - /* Next buffer in IDirect3D */ - - /*** Object Data ***/ - DWORD pid; /* Process locking execute buffer */ - D3DEXECUTEBUFFERDESC debDesc; - /* Description of the buffer */ - D3DEXECUTEDATA exData; /* Execute Data */ - BOOL locked; /* Is the buffer locked */ - - D3DI_BUFFERHANDLE hBuf; - /* Execute buffer handle */ -} DIRECT3DEXECUTEBUFFERI; - -/* - * Internal version of Direct3DLight object; - * it has data after the vtable - */ -typedef struct _DIRECT3DLIGHTI -{ - /*** Object Interface ***/ - LPDIRECT3DLIGHTCALLBACKS lpVtbl; /* Pointer to callbacks */ - int refCnt; /* Reference count */ - - /*** Object Relations ***/ - LPDIRECT3DI lpDirect3DI; /* Parent */ - LIST_MEMBER(_DIRECT3DLIGHTI)list; - /* Next light in IDirect3D */ - - LPDIRECT3DVIEWPORTI lpD3DViewportI; /* Guardian */ - CIRCLE_QUEUE_MEMBER(_DIRECT3DLIGHTI)light_list; - /* Next light in IDirect3DViewport */ - - /*** Object Data ***/ - D3DLIGHT2 dlLight;/* Data describing light */ - D3DI_LIGHT diLightData; - /* Internal representation of light */ -} DIRECT3DLIGHTI; - -typedef struct _DIRECT3DMATERIALOLDI -{ - LPDIRECT3DMATERIALCALLBACKS lpVtbl; - LPDIRECT3DMATERIALI lpObj; -} DIRECT3DMATERIALOLDI, *LPDIRECT3DMATERIALOLDI; - -/* - * Internal version of Direct3DMaterial object; - * it has data after the vtable - */ -typedef struct _DIRECT3DMATERIALI -{ - /*** Object Interface ***/ - LPDIRECT3DMATERIAL2CALLBACKS lpVtbl; /* Pointer to callbacks */ - int refCnt; /* Reference count */ - - /*** Object Relations ***/ - LPDIRECT3DI lpDirect3DI; /* Parent */ - DIRECT3DMATERIALOLDI lpThisID3DMat; /* Our IDirect3DMaterial interface */ - LIST_MEMBER(_DIRECT3DMATERIALI)list; - /* Next MATERIAL in IDirect3D */ - - LIST_ROOT(_mblocks, _D3DI_MATERIALBLOCK)blocks; - /* devices we're associated with */ - - /*** Object Data ***/ - D3DMATERIAL dmMaterial; /* Data describing material */ - BOOL bRes; /* Is this material reserved in the driver */ -} DIRECT3DMATERIALI; - -/* - * If we have an aggreate Direct3DTexture we need a structure - * to represent an unknown interface distinct from the underlying - * object. This is that structure. - */ -typedef struct _DIRECT3DTEXTUREUNKNOWNI -{ - LPDIRECT3DTEXTURECALLBACKS lpVtbl; - LPDIRECT3DTEXTUREI lpObj; -} DIRECT3DTEXTUREUNKNOWNI; -typedef struct _DIRECT3DTEXTUREUNKNOWNI *LPDIRECT3DTEXTUREUNKNOWNI; - -typedef struct _DIRECT3DTEXTUREOLDI -{ - LPDIRECT3DTEXTURECALLBACKS lpVtbl; - LPDIRECT3DTEXTUREI lpObj; -} DIRECT3DTEXTUREOLDI, *LPDIRECT3DTEXTUREOLDI; - -/* - * Internal version of Direct3DTexture object; it has data after the vtable - */ -typedef struct _DIRECT3DTEXTUREI -{ - /*** Object Interface ***/ - LPDIRECT3DTEXTURE2CALLBACKS lpVtbl; /* Pointer to callbacks */ - int refCnt; /* Reference count */ - - - /*** Object Relations ***/ - LIST_ROOT(_blocks, _D3DI_TEXTUREBLOCK) blocks; - /* Devices we're associated with */ - - /*** Object Data ***/ - LPDIRECTDRAWSURFACE lpDDS; - - /* - * The special IUnknown interface for the aggregate that does - * not punt to the parent object. - */ - LPUNKNOWN lpOwningIUnknown; /* The owning IUnknown */ - DIRECT3DTEXTUREUNKNOWNI lpThisIUnknown; /* Our IUnknown interface */ - DIRECT3DTEXTUREOLDI lpThisID3DTex; /* Our IDirect3DTexture interface */ - BOOL bIsPalettized; - -} DIRECT3DTEXTUREI; - -/* - * Internal version of Direct3DViewport object; it has data after the vtable - */ -typedef struct _DIRECT3DVIEWPORTI -{ - /*** Object Interface ***/ - LPDIRECT3DVIEWPORT2CALLBACKS lpVtbl; /* Pointer to callbacks */ - int refCnt; /* Reference count */ - - /*** Object Relations */ - LPDIRECT3DI lpDirect3DI; /* Parent */ - LIST_MEMBER(_DIRECT3DVIEWPORTI)list; - /* Next viewport in IDirect3D */ - - LPDIRECT3DDEVICEI lpD3DDeviceI; /* Guardian */ - CIRCLE_QUEUE_MEMBER(_DIRECT3DVIEWPORTI)vw_list; - /* Next viewport in IDirect3DDevice */ - - /* Lights */ - int numLights; - CIRCLE_QUEUE_ROOT(_dlights, _DIRECT3DLIGHTI) lights; - /* Associated IDirect3DLights */ - - /*** Object Data ***/ - unsigned long v_id; /* Id for this viewport */ - D3DVIEWPORT2 v_data; - BOOL v_data_is_set; - - BOOL have_background; - D3DMATERIALHANDLE background; - /* Background material */ - BOOL have_depth; - LPDIRECTDRAWSURFACE depth; /* Background depth */ - - BOOL bLightsChanged; - /* Have the lights changed since they - were last collected? */ - DWORD clrCount; /* Number of rects allocated */ - LPD3DRECT clrRects; /* Rects used for clearing */ -} DIRECT3DVIEWPORTI; - -/* - * Picking stuff. - */ -typedef struct _D3DI_PICKDATA { - D3DI_EXECUTEDATA* exe; - D3DPICKRECORD* records; - int pick_count; - D3DRECT pick; -} D3DI_PICKDATA, *LPD3DI_PICKDATA; - -/* - * Direct3D memory allocation - */ - -/* - * Register a set of functions to be used in place of malloc, realloc - * and free for memory allocation. The functions D3DMalloc, D3DRealloc - * and D3DFree will use these functions. The default is to use the - * ANSI C library routines malloc, realloc and free. - */ -typedef LPVOID (*D3DMALLOCFUNCTION)(size_t); -typedef LPVOID (*D3DREALLOCFUNCTION)(LPVOID, size_t); -typedef VOID (*D3DFREEFUNCTION)(LPVOID); - -/* - * Allocate size bytes of memory and return a pointer to it in *p_return. - * Returns D3DERR_BADALLOC with *p_return unchanged if the allocation fails. - */ -extern __declspec (dllexport) HRESULT D3DAPI D3DMalloc(LPVOID* p_return, size_t size); - -/* - * Change the size of an allocated block of memory. A pointer to the - * block is passed in in *p_inout. If *p_inout is NULL then a new - * block is allocated. If the reallocation is successful, *p_inout is - * changed to point to the new block. If the allocation fails, - * *p_inout is unchanged and D3DERR_BADALLOC is returned. - */ -HRESULT D3DAPI D3DRealloc(LPVOID* p_inout, size_t size); - -/* - * Free a block of memory previously allocated with D3DMalloc or - * D3DRealloc. - */ -extern __declspec (dllexport) VOID D3DAPI D3DFree(LPVOID p); - -/* - * Used for raising errors from the driver. - */ -HRESULT D3DAPI D3DRaise(HRESULT); - -/* - * Convert RLDDI error codes to D3D error codes - */ -#define RLDDITOD3DERR(_errcode) (RLDDIToD3DErrors[_errcode]) -extern HRESULT RLDDIToD3DErrors[]; - -/* - * maths - */ -#if 1 /* defined(STACK_CALL) && defined(__WATCOMC__) */ -D3DVALUE D3DIPow(D3DVALUE, D3DVALUE); -#else -#define D3DIPow(v,p) DTOVAL(pow(VALTOD(v), VALTOD(p))) -#endif - -/* - * Light utils - */ -void D3DI_DeviceMarkLightEnd(LPDIRECT3DDEVICEI, int); -void D3DI_UpdateLightInternal(LPDIRECT3DLIGHTI); -void D3DI_VectorNormalise12(LPD3DVECTOR v); -D3DTEXTUREHANDLE D3DI_FindTextureHandle(LPDIRECT3DTEXTUREI, LPDIRECT3DDEVICEI); -void D3DI_SetTextureHandle(LPDIRECT3DTEXTUREI, LPDIRECT3DDEVICEI, D3DTEXTUREHANDLE); -void D3DI_RemoveTextureBlock(LPD3DI_TEXTUREBLOCK); -void D3DI_RemoveMaterialBlock(LPD3DI_MATERIALBLOCK); - -extern BOOL D3DI_isHALValid(LPD3DHAL_CALLBACKS); - -#ifdef BUILD_D3D_LAYER -extern RLDDIValue* RLDDIFInvSqrtTable; -#endif - -#ifdef __cplusplus -}; -#endif - -#endif /* BUILD_HEL */ -#endif /* !BUILD_RLAPI */ -// @@END_MSINTERNAL - -#endif /* _D3DI_H */ - diff --git a/include/vd3drm.h b/include/vd3drm.h deleted file mode 100644 index 4b5cc82..0000000 --- a/include/vd3drm.h +++ /dev/null @@ -1,229 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. - * - * File: d3drm.h - * Content: Direct3DRM include file - * - ***************************************************************************/ - -#ifndef __D3DRM_H__ -#define __D3DRM_H__ - -#include "vddraw.h" -#include "vd3drmobj.h" - -#ifdef __cplusplus -extern "C" { -struct IDirect3DRM; -#endif - - -DEFINE_GUID(IID_IDirect3DRM, 0x2bc49361, 0x8327, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRM2, 0x4516ecc8, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); -WIN_TYPES(IDirect3DRM, DIRECT3DRM); -WIN_TYPES(IDirect3DRM2, DIRECT3DRM2); - - -/* Create a Direct3DRM API */ -STDAPI Direct3DRMCreate(LPDIRECT3DRM FAR *lplpDirect3DRM); - -#undef INTERFACE -#define INTERFACE IDirect3DRM - -DECLARE_INTERFACE_(IDirect3DRM, IUnknown) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD(CreateObject) - (THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE; - STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME *) PURE; - STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE; - STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER *) PURE; - STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE *) PURE; - STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION *) PURE; - STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE; - STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE *) PURE; - STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE; - STDMETHOD(CreateLightRGB) - (THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE; - STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE; - STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE *) PURE; - - /* Create a Windows Device using DirectDraw surfaces */ - STDMETHOD(CreateDeviceFromSurface) - ( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD, - LPDIRECTDRAWSURFACE lpDDSBack, LPDIRECT3DRMDEVICE * - ) PURE; - - /* Create a Windows Device using D3D objects */ - STDMETHOD(CreateDeviceFromD3D) - ( THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev, - LPDIRECT3DRMDEVICE * - ) PURE; - - STDMETHOD(CreateDeviceFromClipper) - ( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, - int width, int height, LPDIRECT3DRMDEVICE *) PURE; - - STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE *) PURE; - - STDMETHOD(CreateShadow) - ( THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT, - D3DVALUE px, D3DVALUE py, D3DVALUE pz, - D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, - LPDIRECT3DRMVISUAL * - ) PURE; - STDMETHOD(CreateViewport) - ( THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD, - DWORD, DWORD, LPDIRECT3DRMVIEWPORT * - ) PURE; - STDMETHOD(CreateWrap) - ( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME, - D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, - D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, - D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, - D3DVALUE ou, D3DVALUE ov, - D3DVALUE su, D3DVALUE sv, - LPDIRECT3DRMWRAP * - ) PURE; - STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE; - STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE *) PURE; - STDMETHOD(LoadTextureFromResource) (THIS_ HRSRC rs, LPDIRECT3DRMTEXTURE *) PURE; - - STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE; - STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE; - STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE; - STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE; - STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE; - - STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE; - STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE; - - STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE; - - STDMETHOD(Load) - ( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS, - D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURECALLBACK, LPVOID, - LPDIRECT3DRMFRAME - ) PURE; - STDMETHOD(Tick) (THIS_ D3DVALUE) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRM2 - -DECLARE_INTERFACE_(IDirect3DRM2, IUnknown) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD(CreateObject) - (THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE; - STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME2 *) PURE; - STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE; - STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER2 *) PURE; - STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE *) PURE; - STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION *) PURE; - STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE; - STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE2 *) PURE; - STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE; - STDMETHOD(CreateLightRGB) - (THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE; - STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE; - STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE2 *) PURE; - - /* Create a Windows Device using DirectDraw surfaces */ - STDMETHOD(CreateDeviceFromSurface) - ( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD, - LPDIRECTDRAWSURFACE lpDDSBack, LPDIRECT3DRMDEVICE2 * - ) PURE; - - /* Create a Windows Device using D3D objects */ - STDMETHOD(CreateDeviceFromD3D) - ( THIS_ LPDIRECT3D2 lpD3D, LPDIRECT3DDEVICE2 lpD3DDev, - LPDIRECT3DRMDEVICE2 * - ) PURE; - - STDMETHOD(CreateDeviceFromClipper) - ( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, - int width, int height, LPDIRECT3DRMDEVICE2 *) PURE; - - STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE2 *) PURE; - - STDMETHOD(CreateShadow) - ( THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT, - D3DVALUE px, D3DVALUE py, D3DVALUE pz, - D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, - LPDIRECT3DRMVISUAL * - ) PURE; - STDMETHOD(CreateViewport) - ( THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD, - DWORD, DWORD, LPDIRECT3DRMVIEWPORT * - ) PURE; - STDMETHOD(CreateWrap) - ( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME, - D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, - D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, - D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, - D3DVALUE ou, D3DVALUE ov, - D3DVALUE su, D3DVALUE sv, - LPDIRECT3DRMWRAP * - ) PURE; - STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE; - STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE2 *) PURE; - STDMETHOD(LoadTextureFromResource) (THIS_ HMODULE hModule, LPCTSTR strName, LPCTSTR strType, LPDIRECT3DRMTEXTURE2 *) PURE; - - STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE; - STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE; - STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE; - STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE; - STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE; - - STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE; - STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE; - - STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE; - - STDMETHOD(Load) - ( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS, - D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURECALLBACK, LPVOID, - LPDIRECT3DRMFRAME - ) PURE; - STDMETHOD(Tick) (THIS_ D3DVALUE) PURE; - - STDMETHOD(CreateProgressiveMesh)(THIS_ LPDIRECT3DRMPROGRESSIVEMESH *) PURE; -}; - -#define D3DRM_OK DD_OK -#define D3DRMERR_BADOBJECT MAKE_DDHRESULT(781) -#define D3DRMERR_BADTYPE MAKE_DDHRESULT(782) -#define D3DRMERR_BADALLOC MAKE_DDHRESULT(783) -#define D3DRMERR_FACEUSED MAKE_DDHRESULT(784) -#define D3DRMERR_NOTFOUND MAKE_DDHRESULT(785) -#define D3DRMERR_NOTDONEYET MAKE_DDHRESULT(786) -#define D3DRMERR_FILENOTFOUND MAKE_DDHRESULT(787) -#define D3DRMERR_BADFILE MAKE_DDHRESULT(788) -#define D3DRMERR_BADDEVICE MAKE_DDHRESULT(789) -#define D3DRMERR_BADVALUE MAKE_DDHRESULT(790) -#define D3DRMERR_BADMAJORVERSION MAKE_DDHRESULT(791) -#define D3DRMERR_BADMINORVERSION MAKE_DDHRESULT(792) -#define D3DRMERR_UNABLETOEXECUTE MAKE_DDHRESULT(793) -#define D3DRMERR_LIBRARYNOTFOUND MAKE_DDHRESULT(794) -#define D3DRMERR_INVALIDLIBRARY MAKE_DDHRESULT(795) -#define D3DRMERR_PENDING MAKE_DDHRESULT(796) -#define D3DRMERR_NOTENOUGHDATA MAKE_DDHRESULT(797) -#define D3DRMERR_REQUESTTOOLARGE MAKE_DDHRESULT(798) -#define D3DRMERR_REQUESTTOOSMALL MAKE_DDHRESULT(799) -#define D3DRMERR_CONNECTIONLOST MAKE_DDHRESULT(800) -#define D3DRMERR_LOADABORTED MAKE_DDHRESULT(801) -#define D3DRMERR_NOINTERNET MAKE_DDHRESULT(802) -#define D3DRMERR_BADCACHEFILE MAKE_DDHRESULT(803) -#define D3DRMERR_BOXNOTSET MAKE_DDHRESULT(804) -#define D3DRMERR_BADPMDATA MAKE_DDHRESULT(805) - -#ifdef __cplusplus -}; -#endif - -#endif /* _D3DRMAPI_H_ */ - diff --git a/include/vd3drmdef.h b/include/vd3drmdef.h deleted file mode 100644 index e4f7ae3..0000000 --- a/include/vd3drmdef.h +++ /dev/null @@ -1,473 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. - * - * File: d3drm.h - * Content: Direct3DRM include file - * - ***************************************************************************/ - -#ifndef __D3DRMDEFS_H__ -#define __D3DRMDEFS_H__ - -#include -#include "vd3dtypes.h" - -#ifdef WIN32 -#define D3DRMAPI __stdcall -#else -#define D3DRMAPI -#endif - -#if defined(__cplusplus) -extern "C" { -#endif - -#ifndef TRUE -#define FALSE 0 -#define TRUE 1 -#endif - -typedef struct _D3DRMVECTOR4D -{ D3DVALUE x, y, z, w; -} D3DRMVECTOR4D, *LPD3DRMVECTOR4D; - -typedef D3DVALUE D3DRMMATRIX4D[4][4]; - -typedef struct _D3DRMQUATERNION -{ D3DVALUE s; - D3DVECTOR v; -} D3DRMQUATERNION, *LPD3DRMQUATERNION; - -typedef struct _D3DRMRAY -{ D3DVECTOR dvDir; - D3DVECTOR dvPos; -} D3DRMRAY, *LPD3DRMRAY; - -typedef struct _D3DRMBOX -{ D3DVECTOR min, max; -} D3DRMBOX, *LPD3DRMBOX; - -typedef void (*D3DRMWRAPCALLBACK) - (LPD3DVECTOR, int* u, int* v, LPD3DVECTOR a, LPD3DVECTOR b, LPVOID); - -typedef enum _D3DRMLIGHTTYPE -{ D3DRMLIGHT_AMBIENT, - D3DRMLIGHT_POINT, - D3DRMLIGHT_SPOT, - D3DRMLIGHT_DIRECTIONAL, - D3DRMLIGHT_PARALLELPOINT -} D3DRMLIGHTTYPE, *LPD3DRMLIGHTTYPE; - -typedef enum _D3DRMSHADEMODE { - D3DRMSHADE_FLAT = 0, - D3DRMSHADE_GOURAUD = 1, - D3DRMSHADE_PHONG = 2, - - D3DRMSHADE_MASK = 7, - D3DRMSHADE_MAX = 8 -} D3DRMSHADEMODE, *LPD3DRMSHADEMODE; - -typedef enum _D3DRMLIGHTMODE { - D3DRMLIGHT_OFF = 0 * D3DRMSHADE_MAX, - D3DRMLIGHT_ON = 1 * D3DRMSHADE_MAX, - - D3DRMLIGHT_MASK = 7 * D3DRMSHADE_MAX, - D3DRMLIGHT_MAX = 8 * D3DRMSHADE_MAX -} D3DRMLIGHTMODE, *LPD3DRMLIGHTMODE; - -typedef enum _D3DRMFILLMODE { - D3DRMFILL_POINTS = 0 * D3DRMLIGHT_MAX, - D3DRMFILL_WIREFRAME = 1 * D3DRMLIGHT_MAX, - D3DRMFILL_SOLID = 2 * D3DRMLIGHT_MAX, - - D3DRMFILL_MASK = 7 * D3DRMLIGHT_MAX, - D3DRMFILL_MAX = 8 * D3DRMLIGHT_MAX -} D3DRMFILLMODE, *LPD3DRMFILLMODE; - -typedef DWORD D3DRMRENDERQUALITY, *LPD3DRMRENDERQUALITY; - -#define D3DRMRENDER_WIREFRAME (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_WIREFRAME) -#define D3DRMRENDER_UNLITFLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_SOLID) -#define D3DRMRENDER_FLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_ON+D3DRMFILL_SOLID) -#define D3DRMRENDER_GOURAUD (D3DRMSHADE_GOURAUD+D3DRMLIGHT_ON+D3DRMFILL_SOLID) -#define D3DRMRENDER_PHONG (D3DRMSHADE_PHONG+D3DRMLIGHT_ON+D3DRMFILL_SOLID) - -#define D3DRMRENDERMODE_BLENDEDTRANSPARENCY 1 -#define D3DRMRENDERMODE_SORTEDTRANSPARENCY 2 - -typedef enum _D3DRMTEXTUREQUALITY -{ D3DRMTEXTURE_NEAREST, /* choose nearest texel */ - D3DRMTEXTURE_LINEAR, /* interpolate 4 texels */ - D3DRMTEXTURE_MIPNEAREST, /* nearest texel in nearest mipmap */ - D3DRMTEXTURE_MIPLINEAR, /* interpolate 2 texels from 2 mipmaps */ - D3DRMTEXTURE_LINEARMIPNEAREST, /* interpolate 4 texels in nearest mipmap */ - D3DRMTEXTURE_LINEARMIPLINEAR /* interpolate 8 texels from 2 mipmaps */ -} D3DRMTEXTUREQUALITY, *LPD3DRMTEXTUREQUALITY; - -typedef enum _D3DRMCOMBINETYPE -{ D3DRMCOMBINE_REPLACE, - D3DRMCOMBINE_BEFORE, - D3DRMCOMBINE_AFTER -} D3DRMCOMBINETYPE, *LPD3DRMCOMBINETYPE; - -typedef D3DCOLORMODEL D3DRMCOLORMODEL, *LPD3DRMCOLORMODEL; - -typedef enum _D3DRMPALETTEFLAGS -{ D3DRMPALETTE_FREE, /* renderer may use this entry freely */ - D3DRMPALETTE_READONLY, /* fixed but may be used by renderer */ - D3DRMPALETTE_RESERVED /* may not be used by renderer */ -} D3DRMPALETTEFLAGS, *LPD3DRMPALETTEFLAGS; - -typedef struct _D3DRMPALETTEENTRY -{ unsigned char red; /* 0 .. 255 */ - unsigned char green; /* 0 .. 255 */ - unsigned char blue; /* 0 .. 255 */ - unsigned char flags; /* one of D3DRMPALETTEFLAGS */ -} D3DRMPALETTEENTRY, *LPD3DRMPALETTEENTRY; - -typedef struct _D3DRMIMAGE -{ int width, height; /* width and height in pixels */ - int aspectx, aspecty; /* aspect ratio for non-square pixels */ - int depth; /* bits per pixel */ - int rgb; /* if false, pixels are indices into a - palette otherwise, pixels encode - RGB values. */ - int bytes_per_line; /* number of bytes of memory for a - scanline. This must be a multiple - of 4. */ - void* buffer1; /* memory to render into (first buffer). */ - void* buffer2; /* second rendering buffer for double - buffering, set to NULL for single - buffering. */ - unsigned long red_mask; - unsigned long green_mask; - unsigned long blue_mask; - unsigned long alpha_mask; /* if rgb is true, these are masks for - the red, green and blue parts of a - pixel. Otherwise, these are masks - for the significant bits of the - red, green and blue elements in the - palette. For instance, most SVGA - displays use 64 intensities of red, - green and blue, so the masks should - all be set to 0xfc. */ - int palette_size; /* number of entries in palette */ - D3DRMPALETTEENTRY* palette; /* description of the palette (only if - rgb is false). Must be (1< /* Use Windows header files */ -#define VIRTUAL - -#include "vd3drmdef.h" -#include "vd3d.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The methods for IUnknown - */ -#define IUNKNOWN_METHODS(kind) \ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) kind; \ - STDMETHOD_(ULONG, AddRef) (THIS) kind; \ - STDMETHOD_(ULONG, Release) (THIS) kind - -/* - * The methods for IDirect3DRMObject - */ -#define IDIRECT3DRMOBJECT_METHODS(kind) \ - STDMETHOD(Clone) (THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) kind; \ - STDMETHOD(AddDestroyCallback) (THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) kind; \ - STDMETHOD(DeleteDestroyCallback) (THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) kind; \ - STDMETHOD(SetAppData) (THIS_ DWORD data) kind; \ - STDMETHOD_(DWORD, GetAppData) (THIS) kind; \ - STDMETHOD(SetName) (THIS_ LPCSTR) kind; \ - STDMETHOD(GetName) (THIS_ LPDWORD lpdwSize, LPSTR lpName) kind; \ - STDMETHOD(GetClassName) (THIS_ LPDWORD lpdwSize, LPSTR lpName) kind - - -#define WIN_TYPES(itype, ptype) \ - typedef interface itype FAR *LP##ptype, FAR **LPLP##ptype - -WIN_TYPES(IDirect3DRMObject, DIRECT3DRMOBJECT); -WIN_TYPES(IDirect3DRMDevice, DIRECT3DRMDEVICE); -WIN_TYPES(IDirect3DRMDevice2, DIRECT3DRMDEVICE2); -WIN_TYPES(IDirect3DRMViewport, DIRECT3DRMVIEWPORT); -WIN_TYPES(IDirect3DRMFrame, DIRECT3DRMFRAME); -WIN_TYPES(IDirect3DRMFrame2, DIRECT3DRMFRAME2); -WIN_TYPES(IDirect3DRMVisual, DIRECT3DRMVISUAL); -WIN_TYPES(IDirect3DRMMesh, DIRECT3DRMMESH); -WIN_TYPES(IDirect3DRMMeshBuilder, DIRECT3DRMMESHBUILDER); -WIN_TYPES(IDirect3DRMMeshBuilder2, DIRECT3DRMMESHBUILDER2); -WIN_TYPES(IDirect3DRMFace, DIRECT3DRMFACE); -WIN_TYPES(IDirect3DRMLight, DIRECT3DRMLIGHT); -WIN_TYPES(IDirect3DRMTexture, DIRECT3DRMTEXTURE); -WIN_TYPES(IDirect3DRMTexture2, DIRECT3DRMTEXTURE2); -WIN_TYPES(IDirect3DRMWrap, DIRECT3DRMWRAP); -WIN_TYPES(IDirect3DRMMaterial, DIRECT3DRMMATERIAL); -WIN_TYPES(IDirect3DRMInterpolator, DIRECT3DRMINTERPOLATOR); -WIN_TYPES(IDirect3DRMAnimation, DIRECT3DRMANIMATION); -WIN_TYPES(IDirect3DRMAnimationSet, DIRECT3DRMANIMATIONSET); -WIN_TYPES(IDirect3DRMUserVisual, DIRECT3DRMUSERVISUAL); -WIN_TYPES(IDirect3DRMShadow, DIRECT3DRMSHADOW); -WIN_TYPES(IDirect3DRMArray, DIRECT3DRMARRAY); -WIN_TYPES(IDirect3DRMObjectArray, DIRECT3DRMOBJECTARRAY); -WIN_TYPES(IDirect3DRMDeviceArray, DIRECT3DRMDEVICEARRAY); -WIN_TYPES(IDirect3DRMFaceArray, DIRECT3DRMFACEARRAY); -WIN_TYPES(IDirect3DRMViewportArray, DIRECT3DRMVIEWPORTARRAY); -WIN_TYPES(IDirect3DRMFrameArray, DIRECT3DRMFRAMEARRAY); -WIN_TYPES(IDirect3DRMVisualArray, DIRECT3DRMVISUALARRAY); -WIN_TYPES(IDirect3DRMPickedArray, DIRECT3DRMPICKEDARRAY); -WIN_TYPES(IDirect3DRMPicked2Array, DIRECT3DRMPICKED2ARRAY); -WIN_TYPES(IDirect3DRMLightArray, DIRECT3DRMLIGHTARRAY); -WIN_TYPES(IDirect3DRMProgressiveMesh, DIRECT3DRMPROGRESSIVEMESH); - -/* - * Direct3DRM Object classes - */ -DEFINE_GUID(CLSID_CDirect3DRMDevice, 0x4fa3568e, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMViewport, 0x4fa3568f, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMFrame, 0x4fa35690, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMMesh, 0x4fa35691, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMMeshBuilder, 0x4fa35692, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMFace, 0x4fa35693, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMLight, 0x4fa35694, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMTexture, 0x4fa35695, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMWrap, 0x4fa35696, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMMaterial, 0x4fa35697, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMAnimation, 0x4fa35698, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMAnimationSet, 0x4fa35699, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMUserVisual, 0x4fa3569a, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMShadow, 0x4fa3569b, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(CLSID_CDirect3DRMViewportInterpolator, -0xde9eaa1, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(CLSID_CDirect3DRMFrameInterpolator, -0xde9eaa2, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(CLSID_CDirect3DRMMeshInterpolator, -0xde9eaa3, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(CLSID_CDirect3DRMLightInterpolator, -0xde9eaa6, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(CLSID_CDirect3DRMMaterialInterpolator, -0xde9eaa7, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(CLSID_CDirect3DRMTextureInterpolator, -0xde9eaa8, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(CLSID_CDirect3DRMProgressiveMesh, 0x4516ec40, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); - - -/* - * Direct3DRM Object interfaces - */ -DEFINE_GUID(IID_IDirect3DRMObject, 0xeb16cb00, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMDevice, 0xe9e19280, 0x6e05, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMDevice2, 0x4516ec78, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(IID_IDirect3DRMViewport, 0xeb16cb02, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMFrame, 0xeb16cb03, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMFrame2, 0xc3dfbd60, 0x3988, 0x11d0, 0x9e, 0xc2, 0x0, 0x0, 0xc0, 0x29, 0x1a, 0xc3); -DEFINE_GUID(IID_IDirect3DRMVisual, 0xeb16cb04, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMMesh, 0xa3a80d01, 0x6e12, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMMeshBuilder, 0xa3a80d02, 0x6e12, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMMeshBuilder2, 0x4516ec77, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(IID_IDirect3DRMFace, 0xeb16cb07, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMLight, 0xeb16cb08, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMTexture, 0xeb16cb09, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMTexture2, 0x120f30c0, 0x1629, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b); -DEFINE_GUID(IID_IDirect3DRMWrap, 0xeb16cb0a, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMMaterial, 0xeb16cb0b, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMAnimation, 0xeb16cb0d, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMAnimationSet, 0xeb16cb0e, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMObjectArray, 0x242f6bc2, 0x3849, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(IID_IDirect3DRMDeviceArray, 0xeb16cb10, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMViewportArray, 0xeb16cb11, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMFrameArray, 0xeb16cb12, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMVisualArray, 0xeb16cb13, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMLightArray, 0xeb16cb14, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMPickedArray, 0xeb16cb16, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMFaceArray, 0xeb16cb17, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMUserVisual, 0x59163de0, 0x6d43, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMShadow, 0xaf359780, 0x6ba3, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); -DEFINE_GUID(IID_IDirect3DRMInterpolator, 0x242f6bc1, 0x3849, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(IID_IDirect3DRMProgressiveMesh, 0x4516ec79, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); -DEFINE_GUID(IID_IDirect3DRMPicked2Array, 0x4516ec7b, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); - - -typedef void (CDECL *D3DRMOBJECTCALLBACK)(LPDIRECT3DRMOBJECT obj, LPVOID arg); -typedef void (CDECL *D3DRMFRAMEMOVECALLBACK)(LPDIRECT3DRMFRAME obj, LPVOID arg, D3DVALUE delta); -typedef void (CDECL *D3DRMUPDATECALLBACK)(LPDIRECT3DRMDEVICE obj, LPVOID arg, int, LPD3DRECT); -typedef int (CDECL *D3DRMUSERVISUALCALLBACK) - ( LPDIRECT3DRMUSERVISUAL obj, LPVOID arg, D3DRMUSERVISUALREASON reason, - LPDIRECT3DRMDEVICE dev, LPDIRECT3DRMVIEWPORT view - ); -typedef HRESULT (CDECL *D3DRMLOADTEXTURECALLBACK) - (char *tex_name, void *arg, LPDIRECT3DRMTEXTURE *); -typedef void (CDECL *D3DRMLOADCALLBACK) - (LPDIRECT3DRMOBJECT object, REFIID objectguid, LPVOID arg); - - -typedef struct _D3DRMPICKDESC -{ - ULONG ulFaceIdx; - LONG lGroupIdx; - D3DVECTOR vPosition; - -} D3DRMPICKDESC, *LPD3DRMPICKDESC; - -typedef struct _D3DRMPICKDESC2 -{ - ULONG ulFaceIdx; - LONG lGroupIdx; - D3DVECTOR dvPosition; - D3DVALUE tu; - D3DVALUE tv; - D3DVECTOR dvNormal; - D3DCOLOR dcColor; - -} D3DRMPICKDESC2, *LPD3DRMPICKDESC2; - -#undef INTERFACE -#define INTERFACE IDirect3DRMObject - -/* - * Base class - */ -DECLARE_INTERFACE_(IDirect3DRMObject, IUnknown) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMVisual - -DECLARE_INTERFACE_(IDirect3DRMVisual, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMDevice - -DECLARE_INTERFACE_(IDirect3DRMDevice, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMDevice methods - */ - STDMETHOD(Init)(THIS_ ULONG width, ULONG height) PURE; - STDMETHOD(InitFromD3D)(THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev) PURE; - STDMETHOD(InitFromClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, int width, int height) PURE; - - STDMETHOD(Update)(THIS) PURE; - STDMETHOD(AddUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE; - STDMETHOD(DeleteUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE; - STDMETHOD(SetBufferCount)(THIS_ DWORD) PURE; - STDMETHOD_(DWORD, GetBufferCount)(THIS) PURE; - - STDMETHOD(SetDither)(THIS_ BOOL) PURE; - STDMETHOD(SetShades)(THIS_ DWORD) PURE; - STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; - STDMETHOD(SetTextureQuality)(THIS_ D3DRMTEXTUREQUALITY) PURE; - - STDMETHOD(GetViewports)(THIS_ LPDIRECT3DRMVIEWPORTARRAY *return_views) PURE; - - STDMETHOD_(BOOL, GetDither)(THIS) PURE; - STDMETHOD_(DWORD, GetShades)(THIS) PURE; - STDMETHOD_(DWORD, GetHeight)(THIS) PURE; - STDMETHOD_(DWORD, GetWidth)(THIS) PURE; - STDMETHOD_(DWORD, GetTrianglesDrawn)(THIS) PURE; - STDMETHOD_(DWORD, GetWireframeOptions)(THIS) PURE; - STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; - STDMETHOD_(D3DCOLORMODEL, GetColorModel)(THIS) PURE; - STDMETHOD_(D3DRMTEXTUREQUALITY, GetTextureQuality)(THIS) PURE; - STDMETHOD(GetDirect3DDevice)(THIS_ LPDIRECT3DDEVICE *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMDevice2 - -DECLARE_INTERFACE_(IDirect3DRMDevice2, IDirect3DRMDevice) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMDevice methods - */ - STDMETHOD(Init)(THIS_ ULONG width, ULONG height) PURE; - STDMETHOD(InitFromD3D)(THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev) PURE; - STDMETHOD(InitFromClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, int width, int height) PURE; - - STDMETHOD(Update)(THIS) PURE; - STDMETHOD(AddUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE; - STDMETHOD(DeleteUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE; - STDMETHOD(SetBufferCount)(THIS_ DWORD) PURE; - STDMETHOD_(DWORD, GetBufferCount)(THIS) PURE; - - STDMETHOD(SetDither)(THIS_ BOOL) PURE; - STDMETHOD(SetShades)(THIS_ DWORD) PURE; - STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; - STDMETHOD(SetTextureQuality)(THIS_ D3DRMTEXTUREQUALITY) PURE; - - STDMETHOD(GetViewports)(THIS_ LPDIRECT3DRMVIEWPORTARRAY *return_views) PURE; - - STDMETHOD_(BOOL, GetDither)(THIS) PURE; - STDMETHOD_(DWORD, GetShades)(THIS) PURE; - STDMETHOD_(DWORD, GetHeight)(THIS) PURE; - STDMETHOD_(DWORD, GetWidth)(THIS) PURE; - STDMETHOD_(DWORD, GetTrianglesDrawn)(THIS) PURE; - STDMETHOD_(DWORD, GetWireframeOptions)(THIS) PURE; - STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; - STDMETHOD_(D3DCOLORMODEL, GetColorModel)(THIS) PURE; - STDMETHOD_(D3DRMTEXTUREQUALITY, GetTextureQuality)(THIS) PURE; - STDMETHOD(GetDirect3DDevice)(THIS_ LPDIRECT3DDEVICE *) PURE; - - /* - * IDirect3DRMDevice2 methods - */ - STDMETHOD(InitFromD3D2)(THIS_ LPDIRECT3D2 lpD3D, LPDIRECT3DDEVICE2 lpD3DDev) PURE; - STDMETHOD(InitFromSurface)(THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD, LPDIRECTDRAWSURFACE lpDDSBack) PURE; - STDMETHOD(SetRenderMode)(THIS_ DWORD dwFlags) PURE; - STDMETHOD_(DWORD, GetRenderMode)(THIS) PURE; - STDMETHOD(GetDirect3DDevice2)(THIS_ LPDIRECT3DDEVICE2 *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMViewport - -DECLARE_INTERFACE_(IDirect3DRMViewport, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMViewport methods - */ - STDMETHOD(Init) - ( THIS_ LPDIRECT3DRMDEVICE dev, LPDIRECT3DRMFRAME camera, - DWORD xpos, DWORD ypos, DWORD width, DWORD height - ) PURE; - STDMETHOD(Clear)(THIS) PURE; - STDMETHOD(Render)(THIS_ LPDIRECT3DRMFRAME) PURE; - - STDMETHOD(SetFront)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetBack)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetField)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetUniformScaling)(THIS_ BOOL) PURE; - STDMETHOD(SetCamera)(THIS_ LPDIRECT3DRMFRAME) PURE; - STDMETHOD(SetProjection)(THIS_ D3DRMPROJECTIONTYPE) PURE; - STDMETHOD(Transform)(THIS_ D3DRMVECTOR4D *d, D3DVECTOR *s) PURE; - STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DRMVECTOR4D *s) PURE; - STDMETHOD(Configure)(THIS_ LONG x, LONG y, DWORD width, DWORD height) PURE; - STDMETHOD(ForceUpdate)(THIS_ DWORD x1, DWORD y1, DWORD x2, DWORD y2) PURE; - STDMETHOD(SetPlane)(THIS_ D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top) PURE; - - STDMETHOD(GetCamera)(THIS_ LPDIRECT3DRMFRAME *) PURE; - STDMETHOD(GetDevice)(THIS_ LPDIRECT3DRMDEVICE *) PURE; - STDMETHOD(GetPlane)(THIS_ D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top) PURE; - STDMETHOD(Pick)(THIS_ LONG x, LONG y, LPDIRECT3DRMPICKEDARRAY *return_visuals) PURE; - - STDMETHOD_(BOOL, GetUniformScaling)(THIS) PURE; - STDMETHOD_(LONG, GetX)(THIS) PURE; - STDMETHOD_(LONG, GetY)(THIS) PURE; - STDMETHOD_(DWORD, GetWidth)(THIS) PURE; - STDMETHOD_(DWORD, GetHeight)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetField)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetBack)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetFront)(THIS) PURE; - STDMETHOD_(D3DRMPROJECTIONTYPE, GetProjection)(THIS) PURE; - STDMETHOD(GetDirect3DViewport)(THIS_ LPDIRECT3DVIEWPORT *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMFrame - -DECLARE_INTERFACE_(IDirect3DRMFrame, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMFrame methods - */ - STDMETHOD(AddChild)(THIS_ LPDIRECT3DRMFRAME child) PURE; - STDMETHOD(AddLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; - STDMETHOD(AddMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE; - STDMETHOD(AddTransform)(THIS_ D3DRMCOMBINETYPE, D3DRMMATRIX4D) PURE; - STDMETHOD(AddTranslation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(AddScale)(THIS_ D3DRMCOMBINETYPE, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; - STDMETHOD(AddRotation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; - STDMETHOD(AddVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE; - STDMETHOD(GetChildren)(THIS_ LPDIRECT3DRMFRAMEARRAY *children) PURE; - STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; - STDMETHOD(GetLights)(THIS_ LPDIRECT3DRMLIGHTARRAY *lights) PURE; - STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE; - STDMETHOD(GetParent)(THIS_ LPDIRECT3DRMFRAME *) PURE; - STDMETHOD(GetPosition)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_position) PURE; - STDMETHOD(GetRotation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR axis, LPD3DVALUE return_theta) PURE; - STDMETHOD(GetScene)(THIS_ LPDIRECT3DRMFRAME *) PURE; - STDMETHOD_(D3DRMSORTMODE, GetSortMode)(THIS) PURE; - STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE *) PURE; - STDMETHOD(GetTransform)(THIS_ D3DRMMATRIX4D return_matrix) PURE; - STDMETHOD(GetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_velocity, BOOL with_rotation) PURE; - STDMETHOD(GetOrientation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR dir, LPD3DVECTOR up) PURE; - STDMETHOD(GetVisuals)(THIS_ LPDIRECT3DRMVISUALARRAY *visuals) PURE; - STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; - STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; - STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg)PURE; - STDMETHOD(LookAt)(THIS_ LPDIRECT3DRMFRAME target, LPDIRECT3DRMFRAME reference, D3DRMFRAMECONSTRAINT) PURE; - STDMETHOD(Move)(THIS_ D3DVALUE delta) PURE; - STDMETHOD(DeleteChild)(THIS_ LPDIRECT3DRMFRAME) PURE; - STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; - STDMETHOD(DeleteMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE; - STDMETHOD(DeleteVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE; - STDMETHOD_(D3DCOLOR, GetSceneBackground)(THIS) PURE; - STDMETHOD(GetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE *) PURE; - STDMETHOD_(D3DCOLOR, GetSceneFogColor)(THIS) PURE; - STDMETHOD_(BOOL, GetSceneFogEnable)(THIS) PURE; - STDMETHOD_(D3DRMFOGMODE, GetSceneFogMode)(THIS) PURE; - STDMETHOD(GetSceneFogParams)(THIS_ D3DVALUE *return_start, D3DVALUE *return_end, D3DVALUE *return_density) PURE; - STDMETHOD(SetSceneBackground)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetSceneBackgroundRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD(SetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(SetSceneBackgroundImage)(THIS_ LPDIRECT3DRMTEXTURE) PURE; - STDMETHOD(SetSceneFogEnable)(THIS_ BOOL) PURE; - STDMETHOD(SetSceneFogColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetSceneFogMode)(THIS_ D3DRMFOGMODE) PURE; - STDMETHOD(SetSceneFogParams)(THIS_ D3DVALUE start, D3DVALUE end, D3DVALUE density) PURE; - STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD_(D3DRMZBUFFERMODE, GetZbufferMode)(THIS) PURE; - STDMETHOD(SetMaterialMode)(THIS_ D3DRMMATERIALMODE) PURE; - STDMETHOD(SetOrientation) - ( THIS_ LPDIRECT3DRMFRAME reference, - D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, - D3DVALUE ux, D3DVALUE uy, D3DVALUE uz - ) PURE; - STDMETHOD(SetPosition)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(SetRotation)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; - STDMETHOD(SetSortMode)(THIS_ D3DRMSORTMODE) PURE; - STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; - STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; - STDMETHOD(SetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) PURE; - STDMETHOD(SetZbufferMode)(THIS_ D3DRMZBUFFERMODE) PURE; - STDMETHOD(Transform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMFrame2 - -DECLARE_INTERFACE_(IDirect3DRMFrame2, IDirect3DRMFrame) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMFrame methods - */ - STDMETHOD(AddChild)(THIS_ LPDIRECT3DRMFRAME child) PURE; - STDMETHOD(AddLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; - STDMETHOD(AddMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE; - STDMETHOD(AddTransform)(THIS_ D3DRMCOMBINETYPE, D3DRMMATRIX4D) PURE; - STDMETHOD(AddTranslation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(AddScale)(THIS_ D3DRMCOMBINETYPE, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; - STDMETHOD(AddRotation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; - STDMETHOD(AddVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE; - STDMETHOD(GetChildren)(THIS_ LPDIRECT3DRMFRAMEARRAY *children) PURE; - STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; - STDMETHOD(GetLights)(THIS_ LPDIRECT3DRMLIGHTARRAY *lights) PURE; - STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE; - STDMETHOD(GetParent)(THIS_ LPDIRECT3DRMFRAME *) PURE; - STDMETHOD(GetPosition)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_position) PURE; - STDMETHOD(GetRotation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR axis, LPD3DVALUE return_theta) PURE; - STDMETHOD(GetScene)(THIS_ LPDIRECT3DRMFRAME *) PURE; - STDMETHOD_(D3DRMSORTMODE, GetSortMode)(THIS) PURE; - STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE *) PURE; - STDMETHOD(GetTransform)(THIS_ D3DRMMATRIX4D return_matrix) PURE; - STDMETHOD(GetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_velocity, BOOL with_rotation) PURE; - STDMETHOD(GetOrientation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR dir, LPD3DVECTOR up) PURE; - STDMETHOD(GetVisuals)(THIS_ LPDIRECT3DRMVISUALARRAY *visuals) PURE; - STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; - STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; - STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg)PURE; - STDMETHOD(LookAt)(THIS_ LPDIRECT3DRMFRAME target, LPDIRECT3DRMFRAME reference, D3DRMFRAMECONSTRAINT) PURE; - STDMETHOD(Move)(THIS_ D3DVALUE delta) PURE; - STDMETHOD(DeleteChild)(THIS_ LPDIRECT3DRMFRAME) PURE; - STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; - STDMETHOD(DeleteMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE; - STDMETHOD(DeleteVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE; - STDMETHOD_(D3DCOLOR, GetSceneBackground)(THIS) PURE; - STDMETHOD(GetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE *) PURE; - STDMETHOD_(D3DCOLOR, GetSceneFogColor)(THIS) PURE; - STDMETHOD_(BOOL, GetSceneFogEnable)(THIS) PURE; - STDMETHOD_(D3DRMFOGMODE, GetSceneFogMode)(THIS) PURE; - STDMETHOD(GetSceneFogParams)(THIS_ D3DVALUE *return_start, D3DVALUE *return_end, D3DVALUE *return_density) PURE; - STDMETHOD(SetSceneBackground)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetSceneBackgroundRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD(SetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(SetSceneBackgroundImage)(THIS_ LPDIRECT3DRMTEXTURE) PURE; - STDMETHOD(SetSceneFogEnable)(THIS_ BOOL) PURE; - STDMETHOD(SetSceneFogColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetSceneFogMode)(THIS_ D3DRMFOGMODE) PURE; - STDMETHOD(SetSceneFogParams)(THIS_ D3DVALUE start, D3DVALUE end, D3DVALUE density) PURE; - STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD_(D3DRMZBUFFERMODE, GetZbufferMode)(THIS) PURE; - STDMETHOD(SetMaterialMode)(THIS_ D3DRMMATERIALMODE) PURE; - STDMETHOD(SetOrientation) - ( THIS_ LPDIRECT3DRMFRAME reference, - D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, - D3DVALUE ux, D3DVALUE uy, D3DVALUE uz - ) PURE; - STDMETHOD(SetPosition)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(SetRotation)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; - STDMETHOD(SetSortMode)(THIS_ D3DRMSORTMODE) PURE; - STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; - STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; - STDMETHOD(SetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) PURE; - STDMETHOD(SetZbufferMode)(THIS_ D3DRMZBUFFERMODE) PURE; - STDMETHOD(Transform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; - - /* - * IDirect3DRMFrame2 methods - */ - STDMETHOD(AddMoveCallback2)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg, DWORD dwFlags) PURE; - STDMETHOD(GetBox)(THIS_ LPD3DRMBOX) PURE; - STDMETHOD_(BOOL, GetBoxEnable)(THIS) PURE; - STDMETHOD(GetAxes)(THIS_ LPD3DVECTOR dir, LPD3DVECTOR up); - STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL *) PURE; - STDMETHOD_(BOOL, GetInheritAxes)(THIS); - STDMETHOD(GetHierarchyBox)(THIS_ LPD3DRMBOX) PURE; - - STDMETHOD(SetBox)(THIS_ LPD3DRMBOX) PURE; - STDMETHOD(SetBoxEnable)(THIS_ BOOL) PURE; - STDMETHOD(SetAxes)(THIS_ D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, - D3DVALUE ux, D3DVALUE uy, D3DVALUE uz); - STDMETHOD(SetInheritAxes)(THIS_ BOOL inherit_from_parent); - STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE; - STDMETHOD(SetQuaternion)(THIS_ LPDIRECT3DRMFRAME reference, D3DRMQUATERNION *q) PURE; - - STDMETHOD(RayPick)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DRMRAY ray, DWORD dwFlags, LPDIRECT3DRMPICKED2ARRAY *return_visuals) PURE; - STDMETHOD(Save)(THIS_ LPCSTR filename, D3DRMXOFFORMAT d3dFormat, - D3DRMSAVEOPTIONS d3dSaveFlags); -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMMesh - -DECLARE_INTERFACE_(IDirect3DRMMesh, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMMesh methods - */ - STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; - STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; - STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; - STDMETHOD(AddGroup)(THIS_ unsigned vCount, unsigned fCount, unsigned vPerFace, unsigned *fData, D3DRMGROUPINDEX *returnId) PURE; - STDMETHOD(SetVertices)(THIS_ D3DRMGROUPINDEX id, unsigned index, unsigned count, D3DRMVERTEX *values) PURE; - STDMETHOD(SetGroupColor)(THIS_ D3DRMGROUPINDEX id, D3DCOLOR value) PURE; - STDMETHOD(SetGroupColorRGB)(THIS_ D3DRMGROUPINDEX id, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD(SetGroupMapping)(THIS_ D3DRMGROUPINDEX id, D3DRMMAPPING value) PURE; - STDMETHOD(SetGroupQuality)(THIS_ D3DRMGROUPINDEX id, D3DRMRENDERQUALITY value) PURE; - STDMETHOD(SetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL value) PURE; - STDMETHOD(SetGroupTexture)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMTEXTURE value) PURE; - - STDMETHOD_(unsigned, GetGroupCount)(THIS) PURE; - STDMETHOD(GetGroup)(THIS_ D3DRMGROUPINDEX id, unsigned *vCount, unsigned *fCount, unsigned *vPerFace, DWORD *fDataSize, unsigned *fData) PURE; - STDMETHOD(GetVertices)(THIS_ D3DRMGROUPINDEX id, DWORD index, DWORD count, D3DRMVERTEX *returnPtr) PURE; - STDMETHOD_(D3DCOLOR, GetGroupColor)(THIS_ D3DRMGROUPINDEX id) PURE; - STDMETHOD_(D3DRMMAPPING, GetGroupMapping)(THIS_ D3DRMGROUPINDEX id) PURE; - STDMETHOD_(D3DRMRENDERQUALITY, GetGroupQuality)(THIS_ D3DRMGROUPINDEX id) PURE; - STDMETHOD(GetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL *returnPtr) PURE; - STDMETHOD(GetGroupTexture)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMTEXTURE *returnPtr) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMProgressiveMesh - -DECLARE_INTERFACE_(IDirect3DRMProgressiveMesh, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMProgressiveMesh methods - */ - STDMETHOD(Load) (THIS_ LPVOID lpObjLocation, LPVOID lpObjId, - D3DRMLOADOPTIONS dloLoadflags, D3DRMLOADTEXTURECALLBACK lpCallback, - LPVOID lpArg) PURE; - STDMETHOD(GetLoadStatus) (THIS_ LPD3DRMPMESHLOADSTATUS lpStatus) PURE; - STDMETHOD(SetMinRenderDetail) (THIS_ D3DVALUE d3dVal) PURE; - STDMETHOD(Abort) (THIS_ DWORD dwFlags) PURE; - - STDMETHOD(GetFaceDetail) (THIS_ LPDWORD lpdwCount) PURE; - STDMETHOD(GetVertexDetail) (THIS_ LPDWORD lpdwCount) PURE; - STDMETHOD(SetFaceDetail) (THIS_ DWORD dwCount) PURE; - STDMETHOD(SetVertexDetail) (THIS_ DWORD dwCount) PURE; - STDMETHOD(GetFaceDetailRange) (THIS_ LPDWORD lpdwMin, LPDWORD lpdwMax) PURE; - STDMETHOD(GetVertexDetailRange) (THIS_ LPDWORD lpdwMin, LPDWORD lpdwMax) PURE; - STDMETHOD(GetDetail) (THIS_ D3DVALUE *lpdvVal) PURE; - STDMETHOD(SetDetail) (THIS_ D3DVALUE d3dVal) PURE; - - STDMETHOD(RegisterEvents) (THIS_ HANDLE hEvent, DWORD dwFlags, DWORD dwReserved) PURE; - STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *lplpD3DRMMesh) PURE; - STDMETHOD(Duplicate) (THIS_ LPDIRECT3DRMPROGRESSIVEMESH *lplpD3DRMPMesh) PURE; - STDMETHOD(GetBox) (THIS_ LPD3DRMBOX lpBBox) PURE; - STDMETHOD(SetQuality) (THIS_ D3DRMRENDERQUALITY) PURE; - STDMETHOD(GetQuality) (THIS_ LPD3DRMRENDERQUALITY lpdwquality) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMShadow - -DECLARE_INTERFACE_(IDirect3DRMShadow, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMShadow methods - */ - STDMETHOD(Init) - ( THIS_ LPDIRECT3DRMVISUAL visual, LPDIRECT3DRMLIGHT light, - D3DVALUE px, D3DVALUE py, D3DVALUE pz, - D3DVALUE nx, D3DVALUE ny, D3DVALUE nz - ) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMFace - -DECLARE_INTERFACE_(IDirect3DRMFace, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMFace methods - */ - STDMETHOD(AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(AddVertexAndNormalIndexed)(THIS_ DWORD vertex, DWORD normal) PURE; - STDMETHOD(SetColorRGB)(THIS_ D3DVALUE, D3DVALUE, D3DVALUE) PURE; - STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; - STDMETHOD(SetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE u, D3DVALUE v) PURE; - STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE; - STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; - - STDMETHOD(GetVertex)(THIS_ DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal) PURE; - STDMETHOD(GetVertices)(THIS_ DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals); - STDMETHOD(GetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE *u, D3DVALUE *v) PURE; - STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; - STDMETHOD(GetNormal)(THIS_ D3DVECTOR *) PURE; - STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE *) PURE; - STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL *) PURE; - - STDMETHOD_(int, GetVertexCount)(THIS) PURE; - STDMETHOD_(int, GetVertexIndex)(THIS_ DWORD which) PURE; - STDMETHOD_(int, GetTextureCoordinateIndex)(THIS_ DWORD which) PURE; - STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMMeshBuilder - -DECLARE_INTERFACE_(IDirect3DRMMeshBuilder, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMMeshBuilder methods - */ - STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg) PURE; - STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT, D3DRMSAVEOPTIONS save) PURE; - STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; - STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; - STDMETHOD(SetColorSource)(THIS_ D3DRMCOLORSOURCE) PURE; - STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; - STDMETHOD(GenerateNormals)(THIS) PURE; - STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE; - - STDMETHOD(AddMesh)(THIS_ LPDIRECT3DRMMESH) PURE; - STDMETHOD(AddMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER) PURE; - STDMETHOD(AddFrame)(THIS_ LPDIRECT3DRMFRAME) PURE; - STDMETHOD(AddFace)(THIS_ LPDIRECT3DRMFACE) PURE; - STDMETHOD(AddFaces) - ( THIS_ DWORD vcount, D3DVECTOR *vertices, DWORD ncount, D3DVECTOR *normals, - DWORD *data, LPDIRECT3DRMFACEARRAY* - ) PURE; - STDMETHOD(ReserveSpace)(THIS_ DWORD vertex_Count, DWORD normal_count, DWORD face_count) PURE; - STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; - STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE; - STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; - STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; - STDMETHOD(SetPerspective)(THIS_ BOOL) PURE; - STDMETHOD(SetVertex)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(SetNormal)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(SetTextureCoordinates)(THIS_ DWORD index, D3DVALUE u, D3DVALUE v) PURE; - STDMETHOD(SetVertexColor)(THIS_ DWORD index, D3DCOLOR) PURE; - STDMETHOD(SetVertexColorRGB)(THIS_ DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - - STDMETHOD(GetFaces)(THIS_ LPDIRECT3DRMFACEARRAY*) PURE; - STDMETHOD(GetVertices) - ( THIS_ DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals, DWORD *face_data_size, DWORD *face_data - ) PURE; - STDMETHOD(GetTextureCoordinates)(THIS_ DWORD index, D3DVALUE *u, D3DVALUE *v) PURE; - - STDMETHOD_(int, AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD_(int, AddNormal)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE*) PURE; - STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; - STDMETHOD_(BOOL, GetPerspective)(THIS) PURE; - STDMETHOD_(int, GetFaceCount)(THIS) PURE; - STDMETHOD_(int, GetVertexCount)(THIS) PURE; - STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE; - - STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH*) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMMeshBuilder2 - -DECLARE_INTERFACE_(IDirect3DRMMeshBuilder2, IDirect3DRMMeshBuilder) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMMeshBuilder methods - */ - STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg) PURE; - STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT, D3DRMSAVEOPTIONS save) PURE; - STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; - STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; - STDMETHOD(SetColorSource)(THIS_ D3DRMCOLORSOURCE) PURE; - STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; - STDMETHOD(GenerateNormals)(THIS) PURE; - STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE; - - STDMETHOD(AddMesh)(THIS_ LPDIRECT3DRMMESH) PURE; - STDMETHOD(AddMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER) PURE; - STDMETHOD(AddFrame)(THIS_ LPDIRECT3DRMFRAME) PURE; - STDMETHOD(AddFace)(THIS_ LPDIRECT3DRMFACE) PURE; - STDMETHOD(AddFaces) - ( THIS_ DWORD vcount, D3DVECTOR *vertices, DWORD ncount, D3DVECTOR *normals, - DWORD *data, LPDIRECT3DRMFACEARRAY* - ) PURE; - STDMETHOD(ReserveSpace)(THIS_ DWORD vertex_Count, DWORD normal_count, DWORD face_count) PURE; - STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; - STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE; - STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; - STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; - STDMETHOD(SetPerspective)(THIS_ BOOL) PURE; - STDMETHOD(SetVertex)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(SetNormal)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(SetTextureCoordinates)(THIS_ DWORD index, D3DVALUE u, D3DVALUE v) PURE; - STDMETHOD(SetVertexColor)(THIS_ DWORD index, D3DCOLOR) PURE; - STDMETHOD(SetVertexColorRGB)(THIS_ DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - - STDMETHOD(GetFaces)(THIS_ LPDIRECT3DRMFACEARRAY*) PURE; - STDMETHOD(GetVertices) - ( THIS_ DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals, DWORD *face_data_size, DWORD *face_data - ) PURE; - STDMETHOD(GetTextureCoordinates)(THIS_ DWORD index, D3DVALUE *u, D3DVALUE *v) PURE; - - STDMETHOD_(int, AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD_(int, AddNormal)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE*) PURE; - STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; - STDMETHOD_(BOOL, GetPerspective)(THIS) PURE; - STDMETHOD_(int, GetFaceCount)(THIS) PURE; - STDMETHOD_(int, GetVertexCount)(THIS) PURE; - STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE; - - STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH*) PURE; - - /* - * IDirect3DRMMeshBuilder2 methods - */ - STDMETHOD(GenerateNormals2)(THIS_ D3DVALUE crease, DWORD dwFlags) PURE; - STDMETHOD(GetFace)(THIS_ DWORD index, LPDIRECT3DRMFACE*) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMLight - -DECLARE_INTERFACE_(IDirect3DRMLight, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMLight methods - */ - STDMETHOD(SetType)(THIS_ D3DRMLIGHTTYPE) PURE; - STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; - STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; - STDMETHOD(SetRange)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetUmbra)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetPenumbra)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetConstantAttenuation)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetLinearAttenuation)(THIS_ D3DVALUE) PURE; - STDMETHOD(SetQuadraticAttenuation)(THIS_ D3DVALUE) PURE; - - STDMETHOD_(D3DVALUE, GetRange)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetUmbra)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetPenumbra)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetConstantAttenuation)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetLinearAttenuation)(THIS) PURE; - STDMETHOD_(D3DVALUE, GetQuadraticAttenuation)(THIS) PURE; - STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; - STDMETHOD_(D3DRMLIGHTTYPE, GetType)(THIS) PURE; - - STDMETHOD(SetEnableFrame)(THIS_ LPDIRECT3DRMFRAME) PURE; - STDMETHOD(GetEnableFrame)(THIS_ LPDIRECT3DRMFRAME*) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMTexture - -DECLARE_INTERFACE_(IDirect3DRMTexture, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMTexture methods - */ - STDMETHOD(InitFromFile)(THIS_ const char *filename) PURE; - STDMETHOD(InitFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS) PURE; - STDMETHOD(InitFromResource)(THIS_ HRSRC) PURE; - STDMETHOD(Changed)(THIS_ BOOL pixels, BOOL palette) PURE; - - STDMETHOD(SetColors)(THIS_ DWORD) PURE; - STDMETHOD(SetShades)(THIS_ DWORD) PURE; - STDMETHOD(SetDecalSize)(THIS_ D3DVALUE width, D3DVALUE height) PURE; - STDMETHOD(SetDecalOrigin)(THIS_ LONG x, LONG y) PURE; - STDMETHOD(SetDecalScale)(THIS_ DWORD) PURE; - STDMETHOD(SetDecalTransparency)(THIS_ BOOL) PURE; - STDMETHOD(SetDecalTransparentColor)(THIS_ D3DCOLOR) PURE; - - STDMETHOD(GetDecalSize)(THIS_ D3DVALUE *width_return, D3DVALUE *height_return) PURE; - STDMETHOD(GetDecalOrigin)(THIS_ LONG *x_return, LONG *y_return) PURE; - - STDMETHOD_(D3DRMIMAGE *, GetImage)(THIS) PURE; - STDMETHOD_(DWORD, GetShades)(THIS) PURE; - STDMETHOD_(DWORD, GetColors)(THIS) PURE; - STDMETHOD_(DWORD, GetDecalScale)(THIS) PURE; - STDMETHOD_(BOOL, GetDecalTransparency)(THIS) PURE; - STDMETHOD_(D3DCOLOR, GetDecalTransparentColor)(THIS) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMTexture2 - -DECLARE_INTERFACE_(IDirect3DRMTexture2, IDirect3DRMTexture) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMTexture methods - */ - STDMETHOD(InitFromFile)(THIS_ const char *filename) PURE; - STDMETHOD(InitFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS) PURE; - STDMETHOD(InitFromResource)(THIS_ HRSRC) PURE; - STDMETHOD(Changed)(THIS_ BOOL pixels, BOOL palette) PURE; - - STDMETHOD(SetColors)(THIS_ DWORD) PURE; - STDMETHOD(SetShades)(THIS_ DWORD) PURE; - STDMETHOD(SetDecalSize)(THIS_ D3DVALUE width, D3DVALUE height) PURE; - STDMETHOD(SetDecalOrigin)(THIS_ LONG x, LONG y) PURE; - STDMETHOD(SetDecalScale)(THIS_ DWORD) PURE; - STDMETHOD(SetDecalTransparency)(THIS_ BOOL) PURE; - STDMETHOD(SetDecalTransparentColor)(THIS_ D3DCOLOR) PURE; - - STDMETHOD(GetDecalSize)(THIS_ D3DVALUE *width_return, D3DVALUE *height_return) PURE; - STDMETHOD(GetDecalOrigin)(THIS_ LONG *x_return, LONG *y_return) PURE; - - STDMETHOD_(D3DRMIMAGE *, GetImage)(THIS) PURE; - STDMETHOD_(DWORD, GetShades)(THIS) PURE; - STDMETHOD_(DWORD, GetColors)(THIS) PURE; - STDMETHOD_(DWORD, GetDecalScale)(THIS) PURE; - STDMETHOD_(BOOL, GetDecalTransparency)(THIS) PURE; - STDMETHOD_(D3DCOLOR, GetDecalTransparentColor)(THIS) PURE; - - /* - * IDirect3DRMTexture2 methods - */ - STDMETHOD(InitFromImage)(THIS_ LPD3DRMIMAGE) PURE; - STDMETHOD(InitFromResource2)(THIS_ HMODULE hModule, LPCTSTR strName, LPCTSTR strType) PURE; - STDMETHOD(GenerateMIPMap)(THIS_ DWORD) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMWrap - -DECLARE_INTERFACE_(IDirect3DRMWrap, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMWrap methods - */ - STDMETHOD(Init) - ( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME ref, - D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, - D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, - D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, - D3DVALUE ou, D3DVALUE ov, - D3DVALUE su, D3DVALUE sv - ) PURE; - STDMETHOD(Apply)(THIS_ LPDIRECT3DRMOBJECT) PURE; - STDMETHOD(ApplyRelative)(THIS_ LPDIRECT3DRMFRAME frame, LPDIRECT3DRMOBJECT) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMMaterial - -DECLARE_INTERFACE_(IDirect3DRMMaterial, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMMaterial methods - */ - STDMETHOD(SetPower)(THIS_ D3DVALUE power) PURE; - STDMETHOD(SetSpecular)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; - STDMETHOD(SetEmissive)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; - - STDMETHOD_(D3DVALUE, GetPower)(THIS) PURE; - STDMETHOD(GetSpecular)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; - STDMETHOD(GetEmissive)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMAnimation - -DECLARE_INTERFACE_(IDirect3DRMAnimation, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMAnimation methods - */ - STDMETHOD(SetOptions)(THIS_ D3DRMANIMATIONOPTIONS flags) PURE; - STDMETHOD(AddRotateKey)(THIS_ D3DVALUE time, D3DRMQUATERNION *q) PURE; - STDMETHOD(AddPositionKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(AddScaleKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; - STDMETHOD(DeleteKey)(THIS_ D3DVALUE time) PURE; - STDMETHOD(SetFrame)(THIS_ LPDIRECT3DRMFRAME frame) PURE; - STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; - - STDMETHOD_(D3DRMANIMATIONOPTIONS, GetOptions)(THIS) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMAnimationSet - -DECLARE_INTERFACE_(IDirect3DRMAnimationSet, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMAnimationSet methods - */ - STDMETHOD(AddAnimation)(THIS_ LPDIRECT3DRMANIMATION aid) PURE; - STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg, LPDIRECT3DRMFRAME parent)PURE; - STDMETHOD(DeleteAnimation)(THIS_ LPDIRECT3DRMANIMATION aid) PURE; - STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMUserVisual - -DECLARE_INTERFACE_(IDirect3DRMUserVisual, IDirect3DRMVisual) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMUserVisual methods - */ - STDMETHOD(Init)(THIS_ D3DRMUSERVISUALCALLBACK fn, void *arg) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMArray - -DECLARE_INTERFACE_(IDirect3DRMArray, IUnknown) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - /* No GetElement method as it would get overloaded - * in derived classes, and overloading is - * a no-no in COM - */ -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMObjectArray - -DECLARE_INTERFACE_(IDirect3DRMObjectArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMOBJECT *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMDeviceArray - -DECLARE_INTERFACE_(IDirect3DRMDeviceArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMDEVICE *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMFrameArray - -DECLARE_INTERFACE_(IDirect3DRMFrameArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMFRAME *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMViewportArray - -DECLARE_INTERFACE_(IDirect3DRMViewportArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMVIEWPORT *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMVisualArray - -DECLARE_INTERFACE_(IDirect3DRMVisualArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMVISUAL *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMPickedArray - -DECLARE_INTERFACE_(IDirect3DRMPickedArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetPick)(THIS_ DWORD index, LPDIRECT3DRMVISUAL *, LPDIRECT3DRMFRAMEARRAY *, LPD3DRMPICKDESC) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMLightArray - -DECLARE_INTERFACE_(IDirect3DRMLightArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMLIGHT *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMFaceArray - -DECLARE_INTERFACE_(IDirect3DRMFaceArray, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMFACE *) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMPicked2Array - -DECLARE_INTERFACE_(IDirect3DRMPicked2Array, IDirect3DRMArray) -{ - IUNKNOWN_METHODS(PURE); - - STDMETHOD_(DWORD, GetSize)(THIS) PURE; - STDMETHOD(GetPick)(THIS_ DWORD index, LPDIRECT3DRMVISUAL *, LPDIRECT3DRMFRAMEARRAY *, LPD3DRMPICKDESC2) PURE; -}; - -#undef INTERFACE -#define INTERFACE IDirect3DRMInterpolator - -DECLARE_INTERFACE_(IDirect3DRMInterpolator, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMInterpolator methods - */ - STDMETHOD(AttachObject)(THIS_ LPDIRECT3DRMOBJECT) PURE; - STDMETHOD(GetAttachedObjects)(THIS_ LPDIRECT3DRMOBJECTARRAY *) PURE; - STDMETHOD(DetachObject)(THIS_ LPDIRECT3DRMOBJECT) PURE; - STDMETHOD(SetIndex)(THIS_ D3DVALUE) PURE; - STDMETHOD_(D3DVALUE, GetIndex)(THIS) PURE; - STDMETHOD(Interpolate)(THIS_ D3DVALUE, LPDIRECT3DRMOBJECT, D3DRMINTERPOLATIONOPTIONS) PURE; -}; - -#ifdef __cplusplus -}; -#endif -#endif /* _D3DRMOBJ_H_ */ - diff --git a/include/vd3drmwin.h b/include/vd3drmwin.h deleted file mode 100644 index 3391ef1..0000000 --- a/include/vd3drmwin.h +++ /dev/null @@ -1,49 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. - * - * File: d3drm.h - * Content: Direct3DRM include file - * - ***************************************************************************/ - -#ifndef __D3DRMWIN_H__ -#define __D3DRMWIN_H__ - -#ifndef WIN32 -#define WIN32 -#endif - -#include "vd3drm.h" -#include "vddraw.h" -#include "vd3d.h" - -/* - * GUIDS used by Direct3DRM Windows interface - */ -DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xc5016cc0, 0xd273, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); - -WIN_TYPES(IDirect3DRMWinDevice, DIRECT3DRMWINDEVICE); - -#undef INTERFACE -#define INTERFACE IDirect3DRMWinDevice - -DECLARE_INTERFACE_(IDirect3DRMWinDevice, IDirect3DRMObject) -{ - IUNKNOWN_METHODS(PURE); - IDIRECT3DRMOBJECT_METHODS(PURE); - - /* - * IDirect3DRMWinDevice methods - */ - - /* Repaint the window with the last frame which was rendered. */ - STDMETHOD(HandlePaint)(THIS_ HDC hdc) PURE; - - /* Respond to a WM_ACTIVATE message. */ - STDMETHOD(HandleActivate)(THIS_ WORD wparam) PURE; -}; - - -#endif - diff --git a/include/vd3dtypes.h b/include/vd3dtypes.h deleted file mode 100644 index 0e1302b..0000000 --- a/include/vd3dtypes.h +++ /dev/null @@ -1,1202 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. - * - * File: d3dtypes.h - * Content: Direct3D types include file - * - ***************************************************************************/ - -#ifndef _D3DTYPES_H_ -#define _D3DTYPES_H_ - -#if (! defined WIN32) && (! defined WIN95) -#include "subwtype.h" -#else -#include -#endif - -#include -#include "vddraw.h" - -#pragma pack(4) - -/* D3DVALUE is the fundamental Direct3D fractional data type */ - -#define D3DVALP(val, prec) ((float)(val)) -#define D3DVAL(val) ((float)(val)) -typedef float D3DVALUE, *LPD3DVALUE; -#define D3DDivide(a, b) (float)((double) (a) / (double) (b)) -#define D3DMultiply(a, b) ((a) * (b)) - -typedef LONG D3DFIXED; - -#ifndef RGB_MAKE -/* - * Format of CI colors is - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | alpha | color index | fraction | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ -#define CI_GETALPHA(ci) ((ci) >> 24) -#define CI_GETINDEX(ci) (((ci) >> 8) & 0xffff) -#define CI_GETFRACTION(ci) ((ci) & 0xff) -#define CI_ROUNDINDEX(ci) CI_GETINDEX((ci) + 0x80) -#define CI_MASKALPHA(ci) ((ci) & 0xffffff) -#define CI_MAKE(a, i, f) (((a) << 24) | ((i) << 8) | (f)) - -/* - * Format of RGBA colors is - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | alpha | red | green | blue | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ -#define RGBA_GETALPHA(rgb) ((rgb) >> 24) -#define RGBA_GETRED(rgb) (((rgb) >> 16) & 0xff) -#define RGBA_GETGREEN(rgb) (((rgb) >> 8) & 0xff) -#define RGBA_GETBLUE(rgb) ((rgb) & 0xff) -#define RGBA_MAKE(r, g, b, a) ((D3DCOLOR) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))) - -/* D3DRGB and D3DRGBA may be used as initialisers for D3DCOLORs - * The float values must be in the range 0..1 - */ -#define D3DRGB(r, g, b) \ - (0xff000000L | ( ((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255)) -#define D3DRGBA(r, g, b, a) \ - ( (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16) \ - | (((long)((g) * 255)) << 8) | (long)((b) * 255) \ - ) - -/* - * Format of RGB colors is - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * | ignored | red | green | blue | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - */ -#define RGB_GETRED(rgb) (((rgb) >> 16) & 0xff) -#define RGB_GETGREEN(rgb) (((rgb) >> 8) & 0xff) -#define RGB_GETBLUE(rgb) ((rgb) & 0xff) -#define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff)) -#define RGB_MAKE(r, g, b) ((D3DCOLOR) (((r) << 16) | ((g) << 8) | (b))) -#define RGBA_TORGB(rgba) ((D3DCOLOR) ((rgba) & 0xffffff)) -#define RGB_TORGBA(rgb) ((D3DCOLOR) ((rgb) | 0xff000000)) - -#endif - -/* - * Flags for Enumerate functions - */ - -/* - * Stop the enumeration - */ -#define D3DENUMRET_CANCEL DDENUMRET_CANCEL - -/* - * Continue the enumeration - */ -#define D3DENUMRET_OK DDENUMRET_OK - -typedef HRESULT (WINAPI* LPD3DVALIDATECALLBACK)(LPVOID lpUserArg, DWORD dwOffset); -typedef HRESULT (WINAPI* LPD3DENUMTEXTUREFORMATSCALLBACK)(LPDDSURFACEDESC lpDdsd, LPVOID lpContext); - -typedef DWORD D3DCOLOR, *LPD3DCOLOR; - -typedef DWORD D3DMATERIALHANDLE, *LPD3DMATERIALHANDLE; -typedef DWORD D3DTEXTUREHANDLE, *LPD3DTEXTUREHANDLE; -typedef DWORD D3DMATRIXHANDLE, *LPD3DMATRIXHANDLE; - -typedef struct _D3DCOLORVALUE { - union { - D3DVALUE r; - D3DVALUE dvR; - }; - union { - D3DVALUE g; - D3DVALUE dvG; - }; - union { - D3DVALUE b; - D3DVALUE dvB; - }; - union { - D3DVALUE a; - D3DVALUE dvA; - }; -} D3DCOLORVALUE, *LPD3DCOLORVALUE; - -typedef struct _D3DRECT { - union { - LONG x1; - LONG lX1; - }; - union { - LONG y1; - LONG lY1; - }; - union { - LONG x2; - LONG lX2; - }; - union { - LONG y2; - LONG lY2; - }; -} D3DRECT, *LPD3DRECT; - -typedef struct _D3DVECTOR { - union { - D3DVALUE x; - D3DVALUE dvX; - }; - union { - D3DVALUE y; - D3DVALUE dvY; - }; - union { - D3DVALUE z; - D3DVALUE dvZ; - }; -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - -public: - - // ===================================== - // Constructors - // ===================================== - - _D3DVECTOR() { } - _D3DVECTOR(D3DVALUE f); - _D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z); - _D3DVECTOR(const D3DVALUE f[3]); - - // ===================================== - // Access grants - // ===================================== - - const D3DVALUE&operator[](int i) const; - D3DVALUE&operator[](int i); - - // ===================================== - // Assignment operators - // ===================================== - - _D3DVECTOR& operator += (const _D3DVECTOR& v); - _D3DVECTOR& operator -= (const _D3DVECTOR& v); - _D3DVECTOR& operator *= (const _D3DVECTOR& v); - _D3DVECTOR& operator /= (const _D3DVECTOR& v); - _D3DVECTOR& operator *= (D3DVALUE s); - _D3DVECTOR& operator /= (D3DVALUE s); - - // ===================================== - // Unary operators - // ===================================== - - friend _D3DVECTOR operator + (const _D3DVECTOR& v); - friend _D3DVECTOR operator - (const _D3DVECTOR& v); - - - // ===================================== - // Binary operators - // ===================================== - - // Addition and subtraction - friend _D3DVECTOR operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - friend _D3DVECTOR operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - // Scalar multiplication and division - friend _D3DVECTOR operator * (const _D3DVECTOR& v, D3DVALUE s); - friend _D3DVECTOR operator * (D3DVALUE s, const _D3DVECTOR& v); - friend _D3DVECTOR operator / (const _D3DVECTOR& v, D3DVALUE s); - // Memberwise multiplication and division - friend _D3DVECTOR operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - friend _D3DVECTOR operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - - // Vector dominance - friend int operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - friend int operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - - // Bitwise equality - friend int operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - - // Length-related functions - friend D3DVALUE SquareMagnitude (const _D3DVECTOR& v); - friend D3DVALUE Magnitude (const _D3DVECTOR& v); - - // Returns vector with same direction and unit length - friend _D3DVECTOR Normalize (const _D3DVECTOR& v); - - // Return min/max component of the input vector - friend D3DVALUE Min (const _D3DVECTOR& v); - friend D3DVALUE Max (const _D3DVECTOR& v); - - // Return memberwise min/max of input vectors - friend _D3DVECTOR Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - friend _D3DVECTOR Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - - // Dot and cross product - friend D3DVALUE DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - friend _D3DVECTOR CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2); - -#endif - -} D3DVECTOR, *LPD3DVECTOR; - -#if (defined __cplusplus) && (defined D3D_OVERLOADS) -#include "vd3dvec.inl" -#endif - -/* - * Vertex data types supported in an ExecuteBuffer. - */ - -/* - * Homogeneous vertices - */ - -typedef struct _D3DHVERTEX { - DWORD dwFlags; /* Homogeneous clipping flags */ - union { - D3DVALUE hx; - D3DVALUE dvHX; - }; - union { - D3DVALUE hy; - D3DVALUE dvHY; - }; - union { - D3DVALUE hz; - D3DVALUE dvHZ; - }; -} D3DHVERTEX, *LPD3DHVERTEX; - -/* - * Transformed/lit vertices - */ -typedef struct _D3DTLVERTEX { - union { - D3DVALUE sx; /* Screen coordinates */ - D3DVALUE dvSX; - }; - union { - D3DVALUE sy; - D3DVALUE dvSY; - }; - union { - D3DVALUE sz; - D3DVALUE dvSZ; - }; - union { - D3DVALUE rhw; /* Reciprocal of homogeneous w */ - D3DVALUE dvRHW; - }; - union { - D3DCOLOR color; /* Vertex color */ - D3DCOLOR dcColor; - }; - union { - D3DCOLOR specular; /* Specular component of vertex */ - D3DCOLOR dcSpecular; - }; - union { - D3DVALUE tu; /* Texture coordinates */ - D3DVALUE dvTU; - }; - union { - D3DVALUE tv; - D3DVALUE dvTV; - }; -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - _D3DTLVERTEX() { } - _D3DTLVERTEX(const D3DVECTOR& v, float _rhw, - D3DCOLOR _color, D3DCOLOR _specular, - float _tu, float _tv) - { sx = v.x; sy = v.y; sz = v.z; rhw = _rhw; - color = _color; specular = _specular; - tu = _tu; tv = _tv; - } -#endif -} D3DTLVERTEX, *LPD3DTLVERTEX; - -/* - * Untransformed/lit vertices - */ -typedef struct _D3DLVERTEX { - union { - D3DVALUE x; /* Homogeneous coordinates */ - D3DVALUE dvX; - }; - union { - D3DVALUE y; - D3DVALUE dvY; - }; - union { - D3DVALUE z; - D3DVALUE dvZ; - }; - DWORD dwReserved; - union { - D3DCOLOR color; /* Vertex color */ - D3DCOLOR dcColor; - }; - union { - D3DCOLOR specular; /* Specular component of vertex */ - D3DCOLOR dcSpecular; - }; - union { - D3DVALUE tu; /* Texture coordinates */ - D3DVALUE dvTU; - }; - union { - D3DVALUE tv; - D3DVALUE dvTV; - }; -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - _D3DLVERTEX() { } - _D3DLVERTEX(const D3DVECTOR& v, - D3DCOLOR _color, D3DCOLOR _specular, - float _tu, float _tv) - { x = v.x; y = v.y; z = v.z; dwReserved = 0; - color = _color; specular = _specular; - tu = _tu; tv = _tv; - } -#endif -} D3DLVERTEX, *LPD3DLVERTEX; - -/* - * Untransformed/unlit vertices - */ - -typedef struct _D3DVERTEX { - union { - D3DVALUE x; /* Homogeneous coordinates */ - D3DVALUE dvX; - }; - union { - D3DVALUE y; - D3DVALUE dvY; - }; - union { - D3DVALUE z; - D3DVALUE dvZ; - }; - union { - D3DVALUE nx; /* Normal */ - D3DVALUE dvNX; - }; - union { - D3DVALUE ny; - D3DVALUE dvNY; - }; - union { - D3DVALUE nz; - D3DVALUE dvNZ; - }; - union { - D3DVALUE tu; /* Texture coordinates */ - D3DVALUE dvTU; - }; - union { - D3DVALUE tv; - D3DVALUE dvTV; - }; -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - _D3DVERTEX() { } - _D3DVERTEX(const D3DVECTOR& v, const D3DVECTOR& n, float _tu, float _tv) - { x = v.x; y = v.y; z = v.z; - nx = n.x; ny = n.y; nz = n.z; - tu = _tu; tv = _tv; - } -#endif -} D3DVERTEX, *LPD3DVERTEX; - -/* - * Matrix, viewport, and tranformation structures and definitions. - */ - -typedef struct _D3DMATRIX { -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - union { - struct { -#endif - - D3DVALUE _11, _12, _13, _14; - D3DVALUE _21, _22, _23, _24; - D3DVALUE _31, _32, _33, _34; - D3DVALUE _41, _42, _43, _44; - -#if (defined __cplusplus) && (defined D3D_OVERLOADS) - }; - D3DVALUE m[4][4]; - }; - _D3DMATRIX() { } - _D3DMATRIX( D3DVALUE _m00, D3DVALUE _m01, D3DVALUE _m02, D3DVALUE _m03, - D3DVALUE _m10, D3DVALUE _m11, D3DVALUE _m12, D3DVALUE _m13, - D3DVALUE _m20, D3DVALUE _m21, D3DVALUE _m22, D3DVALUE _m23, - D3DVALUE _m30, D3DVALUE _m31, D3DVALUE _m32, D3DVALUE _m33 - ) - { - m[0][0] = _m00; m[0][1] = _m01; m[0][2] = _m02; m[0][3] = _m03; - m[1][0] = _m10; m[1][1] = _m11; m[1][2] = _m12; m[1][3] = _m13; - m[2][0] = _m20; m[2][1] = _m21; m[2][2] = _m22; m[2][3] = _m23; - m[3][0] = _m30; m[3][1] = _m31; m[3][2] = _m32; m[3][3] = _m33; - } - - D3DVALUE& operator()(int iRow, int iColumn) { return m[iRow][iColumn]; } - const D3DVALUE& operator()(int iRow, int iColumn) const { return m[iRow][iColumn]; } -#endif -} D3DMATRIX, *LPD3DMATRIX; - -typedef struct _D3DVIEWPORT { - DWORD dwSize; - DWORD dwX; - DWORD dwY; /* Top left */ - DWORD dwWidth; - DWORD dwHeight; /* Dimensions */ - D3DVALUE dvScaleX; /* Scale homogeneous to screen */ - D3DVALUE dvScaleY; /* Scale homogeneous to screen */ - D3DVALUE dvMaxX; /* Min/max homogeneous x coord */ - D3DVALUE dvMaxY; /* Min/max homogeneous y coord */ - D3DVALUE dvMinZ; - D3DVALUE dvMaxZ; /* Min/max homogeneous z coord */ -} D3DVIEWPORT, *LPD3DVIEWPORT; - -typedef struct _D3DVIEWPORT2 { - DWORD dwSize; - DWORD dwX; - DWORD dwY; /* Viewport Top left */ - DWORD dwWidth; - DWORD dwHeight; /* Viewport Dimensions */ - D3DVALUE dvClipX; /* Top left of clip volume */ - D3DVALUE dvClipY; - D3DVALUE dvClipWidth; /* Clip Volume Dimensions */ - D3DVALUE dvClipHeight; - D3DVALUE dvMinZ; /* Min/max of clip Volume */ - D3DVALUE dvMaxZ; -} D3DVIEWPORT2, *LPD3DVIEWPORT2; - -/* - * Values for clip fields. - */ -#define D3DCLIP_LEFT 0x00000001L -#define D3DCLIP_RIGHT 0x00000002L -#define D3DCLIP_TOP 0x00000004L -#define D3DCLIP_BOTTOM 0x00000008L -#define D3DCLIP_FRONT 0x00000010L -#define D3DCLIP_BACK 0x00000020L -#define D3DCLIP_GEN0 0x00000040L -#define D3DCLIP_GEN1 0x00000080L -#define D3DCLIP_GEN2 0x00000100L -#define D3DCLIP_GEN3 0x00000200L -#define D3DCLIP_GEN4 0x00000400L -#define D3DCLIP_GEN5 0x00000800L - -/* - * Values for d3d status. - */ -#define D3DSTATUS_CLIPUNIONLEFT D3DCLIP_LEFT -#define D3DSTATUS_CLIPUNIONRIGHT D3DCLIP_RIGHT -#define D3DSTATUS_CLIPUNIONTOP D3DCLIP_TOP -#define D3DSTATUS_CLIPUNIONBOTTOM D3DCLIP_BOTTOM -#define D3DSTATUS_CLIPUNIONFRONT D3DCLIP_FRONT -#define D3DSTATUS_CLIPUNIONBACK D3DCLIP_BACK -#define D3DSTATUS_CLIPUNIONGEN0 D3DCLIP_GEN0 -#define D3DSTATUS_CLIPUNIONGEN1 D3DCLIP_GEN1 -#define D3DSTATUS_CLIPUNIONGEN2 D3DCLIP_GEN2 -#define D3DSTATUS_CLIPUNIONGEN3 D3DCLIP_GEN3 -#define D3DSTATUS_CLIPUNIONGEN4 D3DCLIP_GEN4 -#define D3DSTATUS_CLIPUNIONGEN5 D3DCLIP_GEN5 - -#define D3DSTATUS_CLIPINTERSECTIONLEFT 0x00001000L -#define D3DSTATUS_CLIPINTERSECTIONRIGHT 0x00002000L -#define D3DSTATUS_CLIPINTERSECTIONTOP 0x00004000L -#define D3DSTATUS_CLIPINTERSECTIONBOTTOM 0x00008000L -#define D3DSTATUS_CLIPINTERSECTIONFRONT 0x00010000L -#define D3DSTATUS_CLIPINTERSECTIONBACK 0x00020000L -#define D3DSTATUS_CLIPINTERSECTIONGEN0 0x00040000L -#define D3DSTATUS_CLIPINTERSECTIONGEN1 0x00080000L -#define D3DSTATUS_CLIPINTERSECTIONGEN2 0x00100000L -#define D3DSTATUS_CLIPINTERSECTIONGEN3 0x00200000L -#define D3DSTATUS_CLIPINTERSECTIONGEN4 0x00400000L -#define D3DSTATUS_CLIPINTERSECTIONGEN5 0x00800000L -#define D3DSTATUS_ZNOTVISIBLE 0x01000000L -/* Do not use 0x80000000 for any status flags in future as it is reserved */ - -#define D3DSTATUS_CLIPUNIONALL ( \ - D3DSTATUS_CLIPUNIONLEFT | \ - D3DSTATUS_CLIPUNIONRIGHT | \ - D3DSTATUS_CLIPUNIONTOP | \ - D3DSTATUS_CLIPUNIONBOTTOM | \ - D3DSTATUS_CLIPUNIONFRONT | \ - D3DSTATUS_CLIPUNIONBACK | \ - D3DSTATUS_CLIPUNIONGEN0 | \ - D3DSTATUS_CLIPUNIONGEN1 | \ - D3DSTATUS_CLIPUNIONGEN2 | \ - D3DSTATUS_CLIPUNIONGEN3 | \ - D3DSTATUS_CLIPUNIONGEN4 | \ - D3DSTATUS_CLIPUNIONGEN5 \ - ) - -#define D3DSTATUS_CLIPINTERSECTIONALL ( \ - D3DSTATUS_CLIPINTERSECTIONLEFT | \ - D3DSTATUS_CLIPINTERSECTIONRIGHT | \ - D3DSTATUS_CLIPINTERSECTIONTOP | \ - D3DSTATUS_CLIPINTERSECTIONBOTTOM | \ - D3DSTATUS_CLIPINTERSECTIONFRONT | \ - D3DSTATUS_CLIPINTERSECTIONBACK | \ - D3DSTATUS_CLIPINTERSECTIONGEN0 | \ - D3DSTATUS_CLIPINTERSECTIONGEN1 | \ - D3DSTATUS_CLIPINTERSECTIONGEN2 | \ - D3DSTATUS_CLIPINTERSECTIONGEN3 | \ - D3DSTATUS_CLIPINTERSECTIONGEN4 | \ - D3DSTATUS_CLIPINTERSECTIONGEN5 \ - ) - -#define D3DSTATUS_DEFAULT ( \ - D3DSTATUS_CLIPINTERSECTIONALL | \ - D3DSTATUS_ZNOTVISIBLE) - - -/* - * Options for direct transform calls - */ -#define D3DTRANSFORM_CLIPPED 0x00000001l -#define D3DTRANSFORM_UNCLIPPED 0x00000002l - -typedef struct _D3DTRANSFORMDATA { - DWORD dwSize; - LPVOID lpIn; /* Input vertices */ - DWORD dwInSize; /* Stride of input vertices */ - LPVOID lpOut; /* Output vertices */ - DWORD dwOutSize; /* Stride of output vertices */ - LPD3DHVERTEX lpHOut; /* Output homogeneous vertices */ - DWORD dwClip; /* Clipping hint */ - DWORD dwClipIntersection; - DWORD dwClipUnion; /* Union of all clip flags */ - D3DRECT drExtent; /* Extent of transformed vertices */ -} D3DTRANSFORMDATA, *LPD3DTRANSFORMDATA; - -/* - * Structure defining position and direction properties for lighting. - */ -typedef struct _D3DLIGHTINGELEMENT { - D3DVECTOR dvPosition; /* Lightable point in model space */ - D3DVECTOR dvNormal; /* Normalised unit vector */ -} D3DLIGHTINGELEMENT, *LPD3DLIGHTINGELEMENT; - -/* - * Structure defining material properties for lighting. - */ -typedef struct _D3DMATERIAL { - DWORD dwSize; - union { - D3DCOLORVALUE diffuse; /* Diffuse color RGBA */ - D3DCOLORVALUE dcvDiffuse; - }; - union { - D3DCOLORVALUE ambient; /* Ambient color RGB */ - D3DCOLORVALUE dcvAmbient; - }; - union { - D3DCOLORVALUE specular; /* Specular 'shininess' */ - D3DCOLORVALUE dcvSpecular; - }; - union { - D3DCOLORVALUE emissive; /* Emissive color RGB */ - D3DCOLORVALUE dcvEmissive; - }; - union { - D3DVALUE power; /* Sharpness if specular highlight */ - D3DVALUE dvPower; - }; - D3DTEXTUREHANDLE hTexture; /* Handle to texture map */ - DWORD dwRampSize; -} D3DMATERIAL, *LPD3DMATERIAL; - -typedef enum _D3DLIGHTTYPE { - D3DLIGHT_POINT = 1, - D3DLIGHT_SPOT = 2, - D3DLIGHT_DIRECTIONAL = 3, - D3DLIGHT_PARALLELPOINT = 4, - D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DLIGHTTYPE; - -/* - * Structure defining a light source and its properties. - */ -typedef struct _D3DLIGHT { - DWORD dwSize; - D3DLIGHTTYPE dltType; /* Type of light source */ - D3DCOLORVALUE dcvColor; /* Color of light */ - D3DVECTOR dvPosition; /* Position in world space */ - D3DVECTOR dvDirection; /* Direction in world space */ - D3DVALUE dvRange; /* Cutoff range */ - D3DVALUE dvFalloff; /* Falloff */ - D3DVALUE dvAttenuation0; /* Constant attenuation */ - D3DVALUE dvAttenuation1; /* Linear attenuation */ - D3DVALUE dvAttenuation2; /* Quadratic attenuation */ - D3DVALUE dvTheta; /* Inner angle of spotlight cone */ - D3DVALUE dvPhi; /* Outer angle of spotlight cone */ -} D3DLIGHT, *LPD3DLIGHT; - -/* - * Structure defining a light source and its properties. - */ - -/* flags bits */ -#define D3DLIGHT_ACTIVE 0x00000001 -#define D3DLIGHT_NO_SPECULAR 0x00000002 - -/* maximum valid light range */ -#define D3DLIGHT_RANGE_MAX ((float)sqrt(FLT_MAX)) - -typedef struct _D3DLIGHT2 { - DWORD dwSize; - D3DLIGHTTYPE dltType; /* Type of light source */ - D3DCOLORVALUE dcvColor; /* Color of light */ - D3DVECTOR dvPosition; /* Position in world space */ - D3DVECTOR dvDirection; /* Direction in world space */ - D3DVALUE dvRange; /* Cutoff range */ - D3DVALUE dvFalloff; /* Falloff */ - D3DVALUE dvAttenuation0; /* Constant attenuation */ - D3DVALUE dvAttenuation1; /* Linear attenuation */ - D3DVALUE dvAttenuation2; /* Quadratic attenuation */ - D3DVALUE dvTheta; /* Inner angle of spotlight cone */ - D3DVALUE dvPhi; /* Outer angle of spotlight cone */ - DWORD dwFlags; -} D3DLIGHT2, *LPD3DLIGHT2; - -typedef struct _D3DLIGHTDATA { - DWORD dwSize; - LPD3DLIGHTINGELEMENT lpIn; /* Input positions and normals */ - DWORD dwInSize; /* Stride of input elements */ - LPD3DTLVERTEX lpOut; /* Output colors */ - DWORD dwOutSize; /* Stride of output colors */ -} D3DLIGHTDATA, *LPD3DLIGHTDATA; - -/* - * Before DX5, these values were in an enum called - * D3DCOLORMODEL. This was not correct, since they are - * bit flags. A driver can surface either or both flags - * in the dcmColorModel member of D3DDEVICEDESC. - */ -#define D3DCOLOR_MONO 1 -#define D3DCOLOR_RGB 2 - -typedef DWORD D3DCOLORMODEL; - -/* - * Options for clearing - */ -#define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */ -#define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */ - -/* - * Execute buffers are allocated via Direct3D. These buffers may then - * be filled by the application with instructions to execute along with - * vertex data. - */ - -/* - * Supported op codes for execute instructions. - */ -typedef enum _D3DOPCODE { - D3DOP_POINT = 1, - D3DOP_LINE = 2, - D3DOP_TRIANGLE = 3, - D3DOP_MATRIXLOAD = 4, - D3DOP_MATRIXMULTIPLY = 5, - D3DOP_STATETRANSFORM = 6, - D3DOP_STATELIGHT = 7, - D3DOP_STATERENDER = 8, - D3DOP_PROCESSVERTICES = 9, - D3DOP_TEXTURELOAD = 10, - D3DOP_EXIT = 11, - D3DOP_BRANCHFORWARD = 12, - D3DOP_SPAN = 13, - D3DOP_SETSTATUS = 14, - D3DOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DOPCODE; - -typedef struct _D3DINSTRUCTION { - BYTE bOpcode; /* Instruction opcode */ - BYTE bSize; /* Size of each instruction data unit */ - WORD wCount; /* Count of instruction data units to follow */ -} D3DINSTRUCTION, *LPD3DINSTRUCTION; - -/* - * Structure for texture loads - */ -typedef struct _D3DTEXTURELOAD { - D3DTEXTUREHANDLE hDestTexture; - D3DTEXTUREHANDLE hSrcTexture; -} D3DTEXTURELOAD, *LPD3DTEXTURELOAD; - -/* - * Structure for picking - */ -typedef struct _D3DPICKRECORD { - BYTE bOpcode; - BYTE bPad; - DWORD dwOffset; - D3DVALUE dvZ; -} D3DPICKRECORD, *LPD3DPICKRECORD; - -/* - * The following defines the rendering states which can be set in the - * execute buffer. - */ - -typedef enum _D3DSHADEMODE { - D3DSHADE_FLAT = 1, - D3DSHADE_GOURAUD = 2, - D3DSHADE_PHONG = 3, - D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DSHADEMODE; - -typedef enum _D3DFILLMODE { - D3DFILL_POINT = 1, - D3DFILL_WIREFRAME = 2, - D3DFILL_SOLID = 3, - D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DFILLMODE; - -typedef struct _D3DLINEPATTERN { - WORD wRepeatFactor; - WORD wLinePattern; -} D3DLINEPATTERN; - -typedef enum _D3DTEXTUREFILTER { - D3DFILTER_NEAREST = 1, - D3DFILTER_LINEAR = 2, - D3DFILTER_MIPNEAREST = 3, - D3DFILTER_MIPLINEAR = 4, - D3DFILTER_LINEARMIPNEAREST = 5, - D3DFILTER_LINEARMIPLINEAR = 6, - D3DFILTER_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DTEXTUREFILTER; - -typedef enum _D3DBLEND { - D3DBLEND_ZERO = 1, - D3DBLEND_ONE = 2, - D3DBLEND_SRCCOLOR = 3, - D3DBLEND_INVSRCCOLOR = 4, - D3DBLEND_SRCALPHA = 5, - D3DBLEND_INVSRCALPHA = 6, - D3DBLEND_DESTALPHA = 7, - D3DBLEND_INVDESTALPHA = 8, - D3DBLEND_DESTCOLOR = 9, - D3DBLEND_INVDESTCOLOR = 10, - D3DBLEND_SRCALPHASAT = 11, - D3DBLEND_BOTHSRCALPHA = 12, - D3DBLEND_BOTHINVSRCALPHA = 13, - D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DBLEND; - -typedef enum _D3DTEXTUREBLEND { - D3DTBLEND_DECAL = 1, - D3DTBLEND_MODULATE = 2, - D3DTBLEND_DECALALPHA = 3, - D3DTBLEND_MODULATEALPHA = 4, - D3DTBLEND_DECALMASK = 5, - D3DTBLEND_MODULATEMASK = 6, - D3DTBLEND_COPY = 7, - D3DTBLEND_ADD = 8, - D3DTBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DTEXTUREBLEND; - -typedef enum _D3DTEXTUREADDRESS { - D3DTADDRESS_WRAP = 1, - D3DTADDRESS_MIRROR = 2, - D3DTADDRESS_CLAMP = 3, - D3DTADDRESS_BORDER = 4, - D3DTADDRESS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DTEXTUREADDRESS; - -typedef enum _D3DCULL { - D3DCULL_NONE = 1, - D3DCULL_CW = 2, - D3DCULL_CCW = 3, - D3DCULL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DCULL; - -typedef enum _D3DCMPFUNC { - D3DCMP_NEVER = 1, - D3DCMP_LESS = 2, - D3DCMP_EQUAL = 3, - D3DCMP_LESSEQUAL = 4, - D3DCMP_GREATER = 5, - D3DCMP_NOTEQUAL = 6, - D3DCMP_GREATEREQUAL = 7, - D3DCMP_ALWAYS = 8, - D3DCMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DCMPFUNC; - -typedef enum _D3DFOGMODE { - D3DFOG_NONE = 0, - D3DFOG_EXP = 1, - D3DFOG_EXP2 = 2, - D3DFOG_LINEAR = 3, - D3DFOG_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DFOGMODE; - -typedef enum _D3DANTIALIASMODE { - D3DANTIALIAS_NONE = 0, - D3DANTIALIAS_SORTDEPENDENT = 1, - D3DANTIALIAS_SORTINDEPENDENT = 2, - D3DANTIALIAS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DANTIALIASMODE; - -// Vertex types supported by Direct3D -typedef enum _D3DVERTEXTYPE { - D3DVT_VERTEX = 1, - D3DVT_LVERTEX = 2, - D3DVT_TLVERTEX = 3, - D3DVT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DVERTEXTYPE; - -// Primitives supported by draw-primitive API -typedef enum _D3DPRIMITIVETYPE { - D3DPT_POINTLIST = 1, - D3DPT_LINELIST = 2, - D3DPT_LINESTRIP = 3, - D3DPT_TRIANGLELIST = 4, - D3DPT_TRIANGLESTRIP = 5, - D3DPT_TRIANGLEFAN = 6, - D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DPRIMITIVETYPE; - -/* - * Amount to add to a state to generate the override for that state. - */ -#define D3DSTATE_OVERRIDE_BIAS 256 - -/* - * A state which sets the override flag for the specified state type. - */ -#define D3DSTATE_OVERRIDE(type) ((DWORD) (type) + D3DSTATE_OVERRIDE_BIAS) - -typedef enum _D3DTRANSFORMSTATETYPE { - D3DTRANSFORMSTATE_WORLD = 1, - D3DTRANSFORMSTATE_VIEW = 2, - D3DTRANSFORMSTATE_PROJECTION = 3, - D3DTRANSFORMSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DTRANSFORMSTATETYPE; - -typedef enum _D3DLIGHTSTATETYPE { - D3DLIGHTSTATE_MATERIAL = 1, - D3DLIGHTSTATE_AMBIENT = 2, - D3DLIGHTSTATE_COLORMODEL = 3, - D3DLIGHTSTATE_FOGMODE = 4, - D3DLIGHTSTATE_FOGSTART = 5, - D3DLIGHTSTATE_FOGEND = 6, - D3DLIGHTSTATE_FOGDENSITY = 7, - D3DLIGHTSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DLIGHTSTATETYPE; - -typedef enum _D3DRENDERSTATETYPE { - D3DRENDERSTATE_TEXTUREHANDLE = 1, /* Texture handle */ - D3DRENDERSTATE_ANTIALIAS = 2, /* D3DANTIALIASMODE */ - D3DRENDERSTATE_TEXTUREADDRESS = 3, /* D3DTEXTUREADDRESS */ - D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4, /* TRUE for perspective correction */ - D3DRENDERSTATE_WRAPU = 5, /* TRUE for wrapping in u */ - D3DRENDERSTATE_WRAPV = 6, /* TRUE for wrapping in v */ - D3DRENDERSTATE_ZENABLE = 7, /* TRUE to enable z test */ - D3DRENDERSTATE_FILLMODE = 8, /* D3DFILL_MODE */ - D3DRENDERSTATE_SHADEMODE = 9, /* D3DSHADEMODE */ - D3DRENDERSTATE_LINEPATTERN = 10, /* D3DLINEPATTERN */ - D3DRENDERSTATE_MONOENABLE = 11, /* TRUE to enable mono rasterization */ - D3DRENDERSTATE_ROP2 = 12, /* ROP2 */ - D3DRENDERSTATE_PLANEMASK = 13, /* DWORD physical plane mask */ - D3DRENDERSTATE_ZWRITEENABLE = 14, /* TRUE to enable z writes */ - D3DRENDERSTATE_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */ - D3DRENDERSTATE_LASTPIXEL = 16, /* TRUE for last-pixel on lines */ - D3DRENDERSTATE_TEXTUREMAG = 17, /* D3DTEXTUREFILTER */ - D3DRENDERSTATE_TEXTUREMIN = 18, /* D3DTEXTUREFILTER */ - D3DRENDERSTATE_SRCBLEND = 19, /* D3DBLEND */ - D3DRENDERSTATE_DESTBLEND = 20, /* D3DBLEND */ - D3DRENDERSTATE_TEXTUREMAPBLEND = 21, /* D3DTEXTUREBLEND */ - D3DRENDERSTATE_CULLMODE = 22, /* D3DCULL */ - D3DRENDERSTATE_ZFUNC = 23, /* D3DCMPFUNC */ - D3DRENDERSTATE_ALPHAREF = 24, /* D3DFIXED */ - D3DRENDERSTATE_ALPHAFUNC = 25, /* D3DCMPFUNC */ - D3DRENDERSTATE_DITHERENABLE = 26, /* TRUE to enable dithering */ - D3DRENDERSTATE_ALPHABLENDENABLE = 27, /* TRUE to enable alpha blending */ - D3DRENDERSTATE_FOGENABLE = 28, /* TRUE to enable fog */ - D3DRENDERSTATE_SPECULARENABLE = 29, /* TRUE to enable specular */ - D3DRENDERSTATE_ZVISIBLE = 30, /* TRUE to enable z checking */ - D3DRENDERSTATE_SUBPIXEL = 31, /* TRUE to enable subpixel correction */ - D3DRENDERSTATE_SUBPIXELX = 32, /* TRUE to enable correction in X only */ - D3DRENDERSTATE_STIPPLEDALPHA = 33, /* TRUE to enable stippled alpha */ - D3DRENDERSTATE_FOGCOLOR = 34, /* D3DCOLOR */ - D3DRENDERSTATE_FOGTABLEMODE = 35, /* D3DFOGMODE */ - D3DRENDERSTATE_FOGTABLESTART = 36, /* Fog table start */ - D3DRENDERSTATE_FOGTABLEEND = 37, /* Fog table end */ - D3DRENDERSTATE_FOGTABLEDENSITY = 38, /* Fog table density */ - D3DRENDERSTATE_STIPPLEENABLE = 39, /* TRUE to enable stippling */ - D3DRENDERSTATE_EDGEANTIALIAS = 40, /* TRUE to enable edge antialiasing */ - D3DRENDERSTATE_COLORKEYENABLE = 41, /* TRUE to enable source colorkeyed textures */ - D3DRENDERSTATE_BORDERCOLOR = 43, /* Border color for texturing w/border */ - D3DRENDERSTATE_TEXTUREADDRESSU = 44, /* Texture addressing mode for U coordinate */ - D3DRENDERSTATE_TEXTUREADDRESSV = 45, /* Texture addressing mode for V coordinate */ - D3DRENDERSTATE_MIPMAPLODBIAS = 46, /* D3DVALUE Mipmap LOD bias */ - D3DRENDERSTATE_ZBIAS = 47, /* LONG Z bias */ - D3DRENDERSTATE_RANGEFOGENABLE = 48, /* Enables range-based fog */ - D3DRENDERSTATE_ANISOTROPY = 49, /* Max. anisotropy. 1 = no anisotropy */ - D3DRENDERSTATE_FLUSHBATCH = 50, /* Explicit flush for DP batching (DX5 Only) */ - D3DRENDERSTATE_STIPPLEPATTERN00 = 64, /* Stipple pattern 01... */ - D3DRENDERSTATE_STIPPLEPATTERN01 = 65, - D3DRENDERSTATE_STIPPLEPATTERN02 = 66, - D3DRENDERSTATE_STIPPLEPATTERN03 = 67, - D3DRENDERSTATE_STIPPLEPATTERN04 = 68, - D3DRENDERSTATE_STIPPLEPATTERN05 = 69, - D3DRENDERSTATE_STIPPLEPATTERN06 = 70, - D3DRENDERSTATE_STIPPLEPATTERN07 = 71, - D3DRENDERSTATE_STIPPLEPATTERN08 = 72, - D3DRENDERSTATE_STIPPLEPATTERN09 = 73, - D3DRENDERSTATE_STIPPLEPATTERN10 = 74, - D3DRENDERSTATE_STIPPLEPATTERN11 = 75, - D3DRENDERSTATE_STIPPLEPATTERN12 = 76, - D3DRENDERSTATE_STIPPLEPATTERN13 = 77, - D3DRENDERSTATE_STIPPLEPATTERN14 = 78, - D3DRENDERSTATE_STIPPLEPATTERN15 = 79, - D3DRENDERSTATE_STIPPLEPATTERN16 = 80, - D3DRENDERSTATE_STIPPLEPATTERN17 = 81, - D3DRENDERSTATE_STIPPLEPATTERN18 = 82, - D3DRENDERSTATE_STIPPLEPATTERN19 = 83, - D3DRENDERSTATE_STIPPLEPATTERN20 = 84, - D3DRENDERSTATE_STIPPLEPATTERN21 = 85, - D3DRENDERSTATE_STIPPLEPATTERN22 = 86, - D3DRENDERSTATE_STIPPLEPATTERN23 = 87, - D3DRENDERSTATE_STIPPLEPATTERN24 = 88, - D3DRENDERSTATE_STIPPLEPATTERN25 = 89, - D3DRENDERSTATE_STIPPLEPATTERN26 = 90, - D3DRENDERSTATE_STIPPLEPATTERN27 = 91, - D3DRENDERSTATE_STIPPLEPATTERN28 = 92, - D3DRENDERSTATE_STIPPLEPATTERN29 = 93, - D3DRENDERSTATE_STIPPLEPATTERN30 = 94, - D3DRENDERSTATE_STIPPLEPATTERN31 = 95, - D3DRENDERSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ -} D3DRENDERSTATETYPE; - -// For back-compatibility with legacy compilations -#define D3DRENDERSTATE_BLENDENABLE D3DRENDERSTATE_ALPHABLENDENABLE - -#define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y)) - -typedef struct _D3DSTATE { - union { - D3DTRANSFORMSTATETYPE dtstTransformStateType; - D3DLIGHTSTATETYPE dlstLightStateType; - D3DRENDERSTATETYPE drstRenderStateType; - }; - union { - DWORD dwArg[1]; - D3DVALUE dvArg[1]; - }; -} D3DSTATE, *LPD3DSTATE; - -/* - * Operation used to load matrices - * hDstMat = hSrcMat - */ -typedef struct _D3DMATRIXLOAD { - D3DMATRIXHANDLE hDestMatrix; /* Destination matrix */ - D3DMATRIXHANDLE hSrcMatrix; /* Source matrix */ -} D3DMATRIXLOAD, *LPD3DMATRIXLOAD; - -/* - * Operation used to multiply matrices - * hDstMat = hSrcMat1 * hSrcMat2 - */ -typedef struct _D3DMATRIXMULTIPLY { - D3DMATRIXHANDLE hDestMatrix; /* Destination matrix */ - D3DMATRIXHANDLE hSrcMatrix1; /* First source matrix */ - D3DMATRIXHANDLE hSrcMatrix2; /* Second source matrix */ -} D3DMATRIXMULTIPLY, *LPD3DMATRIXMULTIPLY; - -/* - * Operation used to transform and light vertices. - */ -typedef struct _D3DPROCESSVERTICES { - DWORD dwFlags; /* Do we transform or light or just copy? */ - WORD wStart; /* Index to first vertex in source */ - WORD wDest; /* Index to first vertex in local buffer */ - DWORD dwCount; /* Number of vertices to be processed */ - DWORD dwReserved; /* Must be zero */ -} D3DPROCESSVERTICES, *LPD3DPROCESSVERTICES; - -#define D3DPROCESSVERTICES_TRANSFORMLIGHT 0x00000000L -#define D3DPROCESSVERTICES_TRANSFORM 0x00000001L -#define D3DPROCESSVERTICES_COPY 0x00000002L -#define D3DPROCESSVERTICES_OPMASK 0x00000007L - -#define D3DPROCESSVERTICES_UPDATEEXTENTS 0x00000008L -#define D3DPROCESSVERTICES_NOCOLOR 0x00000010L - - -/* - * Triangle flags - */ - -/* - * Tri strip and fan flags. - * START loads all three vertices - * EVEN and ODD load just v3 with even or odd culling - * START_FLAT contains a count from 0 to 29 that allows the - * whole strip or fan to be culled in one hit. - * e.g. for a quad len = 1 - */ -#define D3DTRIFLAG_START 0x00000000L -#define D3DTRIFLAG_STARTFLAT(len) (len) /* 0 < len < 30 */ -#define D3DTRIFLAG_ODD 0x0000001eL -#define D3DTRIFLAG_EVEN 0x0000001fL - -/* - * Triangle edge flags - * enable edges for wireframe or antialiasing - */ -#define D3DTRIFLAG_EDGEENABLE1 0x00000100L /* v0-v1 edge */ -#define D3DTRIFLAG_EDGEENABLE2 0x00000200L /* v1-v2 edge */ -#define D3DTRIFLAG_EDGEENABLE3 0x00000400L /* v2-v0 edge */ -#define D3DTRIFLAG_EDGEENABLETRIANGLE \ - (D3DTRIFLAG_EDGEENABLE1 | D3DTRIFLAG_EDGEENABLE2 | D3DTRIFLAG_EDGEENABLE3) - -/* - * Primitive structures and related defines. Vertex offsets are to types - * D3DVERTEX, D3DLVERTEX, or D3DTLVERTEX. - */ - -/* - * Triangle list primitive structure - */ -typedef struct _D3DTRIANGLE { - union { - WORD v1; /* Vertex indices */ - WORD wV1; - }; - union { - WORD v2; - WORD wV2; - }; - union { - WORD v3; - WORD wV3; - }; - WORD wFlags; /* Edge (and other) flags */ -} D3DTRIANGLE, *LPD3DTRIANGLE; - -/* - * Line list structure. - * The instruction count defines the number of line segments. - */ -typedef struct _D3DLINE { - union { - WORD v1; /* Vertex indices */ - WORD wV1; - }; - union { - WORD v2; - WORD wV2; - }; -} D3DLINE, *LPD3DLINE; - -/* - * Span structure - * Spans join a list of points with the same y value. - * If the y value changes, a new span is started. - */ -typedef struct _D3DSPAN { - WORD wCount; /* Number of spans */ - WORD wFirst; /* Index to first vertex */ -} D3DSPAN, *LPD3DSPAN; - -/* - * Point structure - */ -typedef struct _D3DPOINT { - WORD wCount; /* number of points */ - WORD wFirst; /* index to first vertex */ -} D3DPOINT, *LPD3DPOINT; - - -/* - * Forward branch structure. - * Mask is logically anded with the driver status mask - * if the result equals 'value', the branch is taken. - */ -typedef struct _D3DBRANCH { - DWORD dwMask; /* Bitmask against D3D status */ - DWORD dwValue; - BOOL bNegate; /* TRUE to negate comparison */ - DWORD dwOffset; /* How far to branch forward (0 for exit)*/ -} D3DBRANCH, *LPD3DBRANCH; - -/* - * Status used for set status instruction. - * The D3D status is initialised on device creation - * and is modified by all execute calls. - */ -typedef struct _D3DSTATUS { - DWORD dwFlags; /* Do we set extents or status */ - DWORD dwStatus; /* D3D status */ - D3DRECT drExtent; -} D3DSTATUS, *LPD3DSTATUS; - -#define D3DSETSTATUS_STATUS 0x00000001L -#define D3DSETSTATUS_EXTENTS 0x00000002L -#define D3DSETSTATUS_ALL (D3DSETSTATUS_STATUS | D3DSETSTATUS_EXTENTS) - -typedef struct _D3DCLIPSTATUS { - DWORD dwFlags; /* Do we set 2d extents, 3D extents or status */ - DWORD dwStatus; /* Clip status */ - float minx, maxx; /* X extents */ - float miny, maxy; /* Y extents */ - float minz, maxz; /* Z extents */ -} D3DCLIPSTATUS, *LPD3DCLIPSTATUS; - -#define D3DCLIPSTATUS_STATUS 0x00000001L -#define D3DCLIPSTATUS_EXTENTS2 0x00000002L -#define D3DCLIPSTATUS_EXTENTS3 0x00000004L - -/* - * Statistics structure - */ -typedef struct _D3DSTATS { - DWORD dwSize; - DWORD dwTrianglesDrawn; - DWORD dwLinesDrawn; - DWORD dwPointsDrawn; - DWORD dwSpansDrawn; - DWORD dwVerticesProcessed; -} D3DSTATS, *LPD3DSTATS; - -/* - * Execute options. - * When calling using D3DEXECUTE_UNCLIPPED all the primitives - * inside the buffer must be contained within the viewport. - */ -#define D3DEXECUTE_CLIPPED 0x00000001l -#define D3DEXECUTE_UNCLIPPED 0x00000002l - -typedef struct _D3DEXECUTEDATA { - DWORD dwSize; - DWORD dwVertexOffset; - DWORD dwVertexCount; - DWORD dwInstructionOffset; - DWORD dwInstructionLength; - DWORD dwHVertexOffset; - D3DSTATUS dsStatus; /* Status after execute */ -} D3DEXECUTEDATA, *LPD3DEXECUTEDATA; - -/* - * Palette flags. - * This are or'ed with the peFlags in the PALETTEENTRYs passed to DirectDraw. - */ -#define D3DPAL_FREE 0x00 /* Renderer may use this entry freely */ -#define D3DPAL_READONLY 0x40 /* Renderer may not set this entry */ -#define D3DPAL_RESERVED 0x80 /* Renderer may not use this entry */ - -#pragma pack() - -#endif /* _D3DTYPES_H_ */ - diff --git a/include/vddraw.h b/include/vddraw.h deleted file mode 100644 index 3038828..0000000 --- a/include/vddraw.h +++ /dev/null @@ -1,3792 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1994-1997 Microsoft Corporation. All Rights Reserved. - * - * File: ddraw.h - * Content: DirectDraw include file - * - ***************************************************************************/ - -#ifndef __DDRAW_INCLUDED__ -#define __DDRAW_INCLUDED__ - -/* - * If you wish an application built against the newest version of DirectDraw - * to run against an older DirectDraw run time then define DIRECTDRAW_VERSION - * to be the earlies version of DirectDraw you wish to run against. For, - * example if you wish an application to run against a DX 3 runtime define - * DIRECTDRAW_VERSION to be 0x0300. - */ -#ifndef DIRECTDRAW_VERSION -#define DIRECTDRAW_VERSION 0x0500 -#endif /* DIRECTDRAW_VERSION */ - -#if defined( _WIN32 ) && !defined( _NO_COM ) -#define COM_NO_WINDOWS_H -#include -#else -#define IUnknown void -#if !defined( NT_BUILD_ENVIRONMENT ) && !defined(WINNT) - #define CO_E_NOTINITIALIZED 0x800401F0L -#endif -#endif - -#define _FACDD 0x876 -#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * GUIDS used by DirectDraw objects - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -DEFINE_GUID( CLSID_DirectDraw, 0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 ); -DEFINE_GUID( CLSID_DirectDrawClipper, 0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 ); -DEFINE_GUID( IID_IDirectDraw, 0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDraw2, 0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -DEFINE_GUID( IID_IDirectDrawSurface, 0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 ); -DEFINE_GUID( IID_IDirectDrawSurface3, 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB ); - -DEFINE_GUID( IID_IDirectDrawPalette, 0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawColorControl, 0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 ); - -#endif - -/*============================================================================ - * - * DirectDraw Structures - * - * Various structures used to invoke DirectDraw. - * - *==========================================================================*/ - -struct IDirectDraw; -struct IDirectDrawSurface; -struct IDirectDrawPalette; -struct IDirectDrawClipper; - -typedef struct IDirectDraw FAR *LPDIRECTDRAW; -typedef struct IDirectDraw2 FAR *LPDIRECTDRAW2; -typedef struct IDirectDrawSurface FAR *LPDIRECTDRAWSURFACE; -typedef struct IDirectDrawSurface2 FAR *LPDIRECTDRAWSURFACE2; -typedef struct IDirectDrawSurface3 FAR *LPDIRECTDRAWSURFACE3; - -typedef struct IDirectDrawPalette FAR *LPDIRECTDRAWPALETTE; -typedef struct IDirectDrawClipper FAR *LPDIRECTDRAWCLIPPER; -typedef struct IDirectDrawColorControl FAR *LPDIRECTDRAWCOLORCONTROL; - -typedef struct _DDFXROP FAR *LPDDFXROP; -typedef struct _DDSURFACEDESC FAR *LPDDSURFACEDESC; -typedef struct _DDCOLORCONTROL FAR *LPDDCOLORCONTROL; - -/* - * API's - */ -#if (defined (WIN32) || defined( _WIN32 ) ) && !defined( _NO_COM ) -//#if defined( _WIN32 ) && !defined( _NO_ENUM ) - typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKA)(GUID FAR *, LPSTR, LPSTR, LPVOID); - typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID); - extern HRESULT WINAPI DirectDrawEnumerateW( LPDDENUMCALLBACKW lpCallback, LPVOID lpContext ); - extern HRESULT WINAPI DirectDrawEnumerateA( LPDDENUMCALLBACKA lpCallback, LPVOID lpContext ); - #ifdef UNICODE - typedef LPDDENUMCALLBACKW LPDDENUMCALLBACK; - #define DirectDrawEnumerate DirectDrawEnumerateW - #else - typedef LPDDENUMCALLBACKA LPDDENUMCALLBACK; - #define DirectDrawEnumerate DirectDrawEnumerateA - #endif - extern HRESULT WINAPI DirectDrawCreate( GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter ); - extern HRESULT WINAPI DirectDrawCreateClipper( DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter ); -#endif - - -#define REGSTR_KEY_DDHW_DESCRIPTION "Description" -#define REGSTR_KEY_DDHW_DRIVERNAME "DriverName" -#define REGSTR_PATH_DDHW "Hardware\\DirectDrawDrivers" - -#define DDCREATE_HARDWAREONLY 0x00000001l -#define DDCREATE_EMULATIONONLY 0x00000002l - -#if defined(WINNT) || !defined(WIN32) -typedef long HRESULT; -#endif - -//#ifndef WINNT -typedef HRESULT (FAR PASCAL * LPDDENUMMODESCALLBACK)(LPDDSURFACEDESC, LPVOID); -typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, LPVOID); -//#endif -/* - * DDCOLORKEY - */ -typedef struct _DDCOLORKEY -{ - DWORD dwColorSpaceLowValue; // low boundary of color space that is to - // be treated as Color Key, inclusive - DWORD dwColorSpaceHighValue; // high boundary of color space that is - // to be treated as Color Key, inclusive -} DDCOLORKEY; - -typedef DDCOLORKEY FAR* LPDDCOLORKEY; - -/* - * DDBLTFX - * Used to pass override information to the DIRECTDRAWSURFACE callback Blt. - */ -typedef struct _DDBLTFX -{ - DWORD dwSize; // size of structure - DWORD dwDDFX; // FX operations - DWORD dwROP; // Win32 raster operations - DWORD dwDDROP; // Raster operations new for DirectDraw - DWORD dwRotationAngle; // Rotation angle for blt - DWORD dwZBufferOpCode; // ZBuffer compares - DWORD dwZBufferLow; // Low limit of Z buffer - DWORD dwZBufferHigh; // High limit of Z buffer - DWORD dwZBufferBaseDest; // Destination base value - DWORD dwZDestConstBitDepth; // Bit depth used to specify Z constant for destination - union - { - DWORD dwZDestConst; // Constant to use as Z buffer for dest - LPDIRECTDRAWSURFACE lpDDSZBufferDest; // Surface to use as Z buffer for dest - }; - DWORD dwZSrcConstBitDepth; // Bit depth used to specify Z constant for source - union - { - DWORD dwZSrcConst; // Constant to use as Z buffer for src - LPDIRECTDRAWSURFACE lpDDSZBufferSrc; // Surface to use as Z buffer for src - }; - DWORD dwAlphaEdgeBlendBitDepth; // Bit depth used to specify constant for alpha edge blend - DWORD dwAlphaEdgeBlend; // Alpha for edge blending - DWORD dwReserved; - DWORD dwAlphaDestConstBitDepth; // Bit depth used to specify alpha constant for destination - union - { - DWORD dwAlphaDestConst; // Constant to use as Alpha Channel - LPDIRECTDRAWSURFACE lpDDSAlphaDest; // Surface to use as Alpha Channel - }; - DWORD dwAlphaSrcConstBitDepth; // Bit depth used to specify alpha constant for source - union - { - DWORD dwAlphaSrcConst; // Constant to use as Alpha Channel - LPDIRECTDRAWSURFACE lpDDSAlphaSrc; // Surface to use as Alpha Channel - }; - union - { - DWORD dwFillColor; // color in RGB or Palettized - DWORD dwFillDepth; // depth value for z-buffer - DWORD dwFillPixel; // pixel value for RGBA or RGBZ - LPDIRECTDRAWSURFACE lpDDSPattern; // Surface to use as pattern - }; - DDCOLORKEY ddckDestColorkey; // DestColorkey override - DDCOLORKEY ddckSrcColorkey; // SrcColorkey override -} DDBLTFX; - -typedef DDBLTFX FAR* LPDDBLTFX; - - -/* - * DDSCAPS - */ -typedef struct _DDSCAPS -{ - DWORD dwCaps; // capabilities of surface wanted -} DDSCAPS; - -typedef DDSCAPS FAR* LPDDSCAPS; - -/* - * DDCAPS - */ -#define DD_ROP_SPACE (256/32) // space required to store ROP array - -#if DIRECTDRAW_VERSION >= 0x0500 -/* - * This structure is the DDCAPS structure as it was in version 2 and 3 of Direct X. - * It is present for back compatability. - */ -typedef struct _DDCAPS_DX3 -{ - DWORD dwSize; // size of the DDDRIVERCAPS structure - DWORD dwCaps; // driver specific capabilities - DWORD dwCaps2; // more driver specific capabilites - DWORD dwCKeyCaps; // color key capabilities of the surface - DWORD dwFXCaps; // driver specific stretching and effects capabilites - DWORD dwFXAlphaCaps; // alpha driver specific capabilities - DWORD dwPalCaps; // palette capabilities - DWORD dwSVCaps; // stereo vision capabilities - DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 - DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 - DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 - DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 - DWORD dwVidMemTotal; // total amount of video memory - DWORD dwVidMemFree; // amount of free video memory - DWORD dwMaxVisibleOverlays; // maximum number of visible overlays - DWORD dwCurrVisibleOverlays; // current number of visible overlays - DWORD dwNumFourCCCodes; // number of four cc codes - DWORD dwAlignBoundarySrc; // source rectangle alignment - DWORD dwAlignSizeSrc; // source rectangle byte size - DWORD dwAlignBoundaryDest; // dest rectangle alignment - DWORD dwAlignSizeDest; // dest rectangle byte size - DWORD dwAlignStrideAlign; // stride alignment - DWORD dwRops[DD_ROP_SPACE]; // ROPS supported - DDSCAPS ddsCaps; // DDSCAPS structure has all the general capabilities - DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwReserved1; // reserved - DWORD dwReserved2; // reserved - DWORD dwReserved3; // reserved - DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts - DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts - DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts - DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts - DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts - DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts - DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts - DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts - DWORD dwSSBCaps; // driver specific capabilities for System->System blts - DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts - DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts - DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts - DWORD dwReserved4; // reserved - DWORD dwReserved5; // reserved - DWORD dwReserved6; // reserved -} DDCAPS_DX3; -typedef DDCAPS_DX3 FAR* LPDDCAPS_DX3; -#endif /* DIRECTDRAW_VERSION >= 0x0500 */ - -typedef struct _DDCAPS -{ -/* 0*/ DWORD dwSize; // size of the DDDRIVERCAPS structure -/* 4*/ DWORD dwCaps; // driver specific capabilities -/* 8*/ DWORD dwCaps2; // more driver specific capabilites -/* c*/ DWORD dwCKeyCaps; // color key capabilities of the surface -/* 10*/ DWORD dwFXCaps; // driver specific stretching and effects capabilites -/* 14*/ DWORD dwFXAlphaCaps; // alpha driver specific capabilities -/* 18*/ DWORD dwPalCaps; // palette capabilities -/* 1c*/ DWORD dwSVCaps; // stereo vision capabilities -/* 20*/ DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 -/* 24*/ DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 -/* 28*/ DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 -/* 2c*/ DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 -/* 30*/ DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 -/* 34*/ DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 -/* 38*/ DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 -/* 3c*/ DWORD dwVidMemTotal; // total amount of video memory -/* 40*/ DWORD dwVidMemFree; // amount of free video memory -/* 44*/ DWORD dwMaxVisibleOverlays; // maximum number of visible overlays -/* 48*/ DWORD dwCurrVisibleOverlays; // current number of visible overlays -/* 4c*/ DWORD dwNumFourCCCodes; // number of four cc codes -/* 50*/ DWORD dwAlignBoundarySrc; // source rectangle alignment -/* 54*/ DWORD dwAlignSizeSrc; // source rectangle byte size -/* 58*/ DWORD dwAlignBoundaryDest; // dest rectangle alignment -/* 5c*/ DWORD dwAlignSizeDest; // dest rectangle byte size -/* 60*/ DWORD dwAlignStrideAlign; // stride alignment -/* 64*/ DWORD dwRops[DD_ROP_SPACE]; // ROPS supported -/* 84*/ DDSCAPS ddsCaps; // DDSCAPS structure has all the general capabilities -/* 88*/ DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 8c*/ DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 90*/ DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 94*/ DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 98*/ DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* 9c*/ DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 -/* a0*/ DWORD dwReserved1; // reserved -/* a4*/ DWORD dwReserved2; // reserved -/* a8*/ DWORD dwReserved3; // reserved -/* ac*/ DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts -/* b0*/ DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts -/* b4*/ DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts -/* b8*/ DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts -/* d8*/ DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts -/* dc*/ DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts -/* e0*/ DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts -/* e4*/ DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts -/*104*/ DWORD dwSSBCaps; // driver specific capabilities for System->System blts -/*108*/ DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts -/*10c*/ DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts -/*110*/ DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts -#if DIRECTDRAW_VERSION >= 0x0500 -/*130*/ DWORD dwMaxVideoPorts; // maximum number of usable video ports -/*134*/ DWORD dwCurrVideoPorts; // current number of video ports used -/*138*/ DWORD dwSVBCaps2; // more driver specific capabilities for System->Vmem blts -/*13c*/ DWORD dwNLVBCaps; // driver specific capabilities for non-local->local vidmem blts -/*140*/ DWORD dwNLVBCaps2; // more driver specific capabilities non-local->local vidmem blts -/*144*/ DWORD dwNLVBCKeyCaps; // driver color key capabilities for non-local->local vidmem blts -/*148*/ DWORD dwNLVBFXCaps; // driver FX capabilities for non-local->local blts -/*14c*/ DWORD dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts -#else /* DIRECTDRAW_VERSION >= 0x0500 */ -/*130*/ DWORD dwReserved4; // reserved -/*134*/ DWORD dwReserved5; // reserved -/*138*/ DWORD dwReserved6; // reserved -#endif /* DIRECTDRAW_VERSION >= 0x0500 */ -} DDCAPS; - -typedef DDCAPS FAR* LPDDCAPS; - - - -/* - * DDPIXELFORMAT - */ -typedef struct _DDPIXELFORMAT -{ - DWORD dwSize; // size of structure - DWORD dwFlags; // pixel format flags - DWORD dwFourCC; // (FOURCC code) - union - { - DWORD dwRGBBitCount; // how many bits per pixel - DWORD dwYUVBitCount; // how many bits per pixel - DWORD dwZBufferBitDepth; // how many bits for z buffers - DWORD dwAlphaBitDepth; // how many bits for alpha channels - }; - union - { - DWORD dwRBitMask; // mask for red bit - DWORD dwYBitMask; // mask for Y bits - }; - union - { - DWORD dwGBitMask; // mask for green bits - DWORD dwUBitMask; // mask for U bits - }; - union - { - DWORD dwBBitMask; // mask for blue bits - DWORD dwVBitMask; // mask for V bits - }; - union - { - DWORD dwRGBAlphaBitMask; // mask for alpha channel - DWORD dwYUVAlphaBitMask; // mask for alpha channel - DWORD dwRGBZBitMask; // mask for Z channel - DWORD dwYUVZBitMask; // mask for Z channel - }; -} DDPIXELFORMAT; - -typedef DDPIXELFORMAT FAR* LPDDPIXELFORMAT; - -/* - * DDOVERLAYFX - */ -typedef struct _DDOVERLAYFX -{ - DWORD dwSize; // size of structure - DWORD dwAlphaEdgeBlendBitDepth; // Bit depth used to specify constant for alpha edge blend - DWORD dwAlphaEdgeBlend; // Constant to use as alpha for edge blend - DWORD dwReserved; - DWORD dwAlphaDestConstBitDepth; // Bit depth used to specify alpha constant for destination - union - { - DWORD dwAlphaDestConst; // Constant to use as alpha channel for dest - LPDIRECTDRAWSURFACE lpDDSAlphaDest; // Surface to use as alpha channel for dest - }; - DWORD dwAlphaSrcConstBitDepth; // Bit depth used to specify alpha constant for source - union - { - DWORD dwAlphaSrcConst; // Constant to use as alpha channel for src - LPDIRECTDRAWSURFACE lpDDSAlphaSrc; // Surface to use as alpha channel for src - }; - DDCOLORKEY dckDestColorkey; // DestColorkey override - DDCOLORKEY dckSrcColorkey; // DestColorkey override - DWORD dwDDFX; // Overlay FX - DWORD dwFlags; // flags -} DDOVERLAYFX; - -typedef DDOVERLAYFX FAR *LPDDOVERLAYFX; - -/* - * DDBLTBATCH: BltBatch entry structure - */ -typedef struct _DDBLTBATCH -{ - LPRECT lprDest; - LPDIRECTDRAWSURFACE lpDDSSrc; - LPRECT lprSrc; - DWORD dwFlags; - LPDDBLTFX lpDDBltFx; -} DDBLTBATCH; - -typedef DDBLTBATCH FAR * LPDDBLTBATCH; - -/* - * callbacks - */ -typedef DWORD (FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper, HWND hWnd, DWORD code, LPVOID lpContext ); -#ifdef STREAMING -typedef DWORD (FAR PASCAL *LPSURFACESTREAMINGCALLBACK)(DWORD); -#endif - - -/* - * INTERACES FOLLOW: - * IDirectDraw - * IDirectDrawClipper - * IDirectDrawPalette - * IDirectDrawSurface - */ - -/* - * IDirectDraw - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDraw -DECLARE_INTERFACE_( IDirectDraw, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDraw methods ***/ - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE; - STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE; - STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; - STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; - STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDraw_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDraw_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDraw_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDraw_Compact(p) (p)->lpVtbl->Compact(p) -#define IDirectDraw_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) -#define IDirectDraw_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) -#define IDirectDraw_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) -#define IDirectDraw_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) -#define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) -#define IDirectDraw_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) -#define IDirectDraw_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) -#define IDirectDraw_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) -#define IDirectDraw_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) -#define IDirectDraw_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) -#define IDirectDraw_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) -#define IDirectDraw_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) -#define IDirectDraw_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) -#define IDirectDraw_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) -#define IDirectDraw_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirectDraw_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) -#define IDirectDraw_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) -#define IDirectDraw_SetDisplayMode(p, a, b, c) (p)->lpVtbl->SetDisplayMode(p, a, b, c) -#define IDirectDraw_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) -#else -#define IDirectDraw_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDraw_AddRef(p) (p)->AddRef() -#define IDirectDraw_Release(p) (p)->Release() -#define IDirectDraw_Compact(p) (p)->Compact() -#define IDirectDraw_CreateClipper(p, a, b, c) (p)->CreateClipper(a, b, c) -#define IDirectDraw_CreatePalette(p, a, b, c, d) (p)->CreatePalette(a, b, c, d) -#define IDirectDraw_CreateSurface(p, a, b, c) (p)->CreateSurface(a, b, c) -#define IDirectDraw_DuplicateSurface(p, a, b) (p)->DuplicateSurface(a, b) -#define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d) -#define IDirectDraw_EnumSurfaces(p, a, b, c, d) (p)->EnumSurfaces(a, b, c, d) -#define IDirectDraw_FlipToGDISurface(p) (p)->FlipToGDISurface() -#define IDirectDraw_GetCaps(p, a, b) (p)->GetCaps(a, b) -#define IDirectDraw_GetDisplayMode(p, a) (p)->GetDisplayMode(a) -#define IDirectDraw_GetFourCCCodes(p, a, b) (p)->GetFourCCCodes(a, b) -#define IDirectDraw_GetGDISurface(p, a) (p)->GetGDISurface(a) -#define IDirectDraw_GetMonitorFrequency(p, a) (p)->GetMonitorFrequency(a) -#define IDirectDraw_GetScanLine(p, a) (p)->GetScanLine(a) -#define IDirectDraw_GetVerticalBlankStatus(p, a) (p)->GetVerticalBlankStatus(a) -#define IDirectDraw_Initialize(p, a) (p)->Initialize(a) -#define IDirectDraw_RestoreDisplayMode(p) (p)->RestoreDisplayMode() -#define IDirectDraw_SetCooperativeLevel(p, a, b) (p)->SetCooperativeLevel(a, b) -#define IDirectDraw_SetDisplayMode(p, a, b, c) (p)->SetDisplayMode(a, b, c) -#define IDirectDraw_WaitForVerticalBlank(p, a, b) (p)->WaitForVerticalBlank(a, b) -#endif - -#endif - -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDraw2 -DECLARE_INTERFACE_( IDirectDraw2, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDraw methods ***/ - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE; - STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE; - STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; - STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; - STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS, LPDWORD, LPDWORD) PURE; -}; -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDraw2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDraw2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDraw2_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDraw2_Compact(p) (p)->lpVtbl->Compact(p) -#define IDirectDraw2_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) -#define IDirectDraw2_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) -#define IDirectDraw2_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) -#define IDirectDraw2_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) -#define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) -#define IDirectDraw2_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) -#define IDirectDraw2_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) -#define IDirectDraw2_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) -#define IDirectDraw2_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) -#define IDirectDraw2_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) -#define IDirectDraw2_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) -#define IDirectDraw2_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) -#define IDirectDraw2_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) -#define IDirectDraw2_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) -#define IDirectDraw2_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirectDraw2_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) -#define IDirectDraw2_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) -#define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e) -#define IDirectDraw2_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) -#define IDirectDraw2_GetAvailableVidMem(p, a, b, c) (p)->lpVtbl->GetAvailableVidMem(p, a, b, c) -#else -#define IDirectDraw2_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDraw2_AddRef(p) (p)->AddRef() -#define IDirectDraw2_Release(p) (p)->Release() -#define IDirectDraw2_Compact(p) (p)->Compact() -#define IDirectDraw2_CreateClipper(p, a, b, c) (p)->CreateClipper(a, b, c) -#define IDirectDraw2_CreatePalette(p, a, b, c, d) (p)->CreatePalette(a, b, c, d) -#define IDirectDraw2_CreateSurface(p, a, b, c) (p)->CreateSurface(a, b, c) -#define IDirectDraw2_DuplicateSurface(p, a, b) (p)->DuplicateSurface(a, b) -#define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d) -#define IDirectDraw2_EnumSurfaces(p, a, b, c, d) (p)->EnumSurfaces(a, b, c, d) -#define IDirectDraw2_FlipToGDISurface(p) (p)->FlipToGDISurface() -#define IDirectDraw2_GetCaps(p, a, b) (p)->GetCaps(a, b) -#define IDirectDraw2_GetDisplayMode(p, a) (p)->GetDisplayMode(a) -#define IDirectDraw2_GetFourCCCodes(p, a, b) (p)->GetFourCCCodes(a, b) -#define IDirectDraw2_GetGDISurface(p, a) (p)->GetGDISurface(a) -#define IDirectDraw2_GetMonitorFrequency(p, a) (p)->GetMonitorFrequency(a) -#define IDirectDraw2_GetScanLine(p, a) (p)->GetScanLine(a) -#define IDirectDraw2_GetVerticalBlankStatus(p, a) (p)->GetVerticalBlankStatus(a) -#define IDirectDraw2_Initialize(p, a) (p)->Initialize(a) -#define IDirectDraw2_RestoreDisplayMode(p) (p)->RestoreDisplayMode() -#define IDirectDraw2_SetCooperativeLevel(p, a, b) (p)->SetCooperativeLevel(a, b) -#define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e) -#define IDirectDraw2_WaitForVerticalBlank(p, a, b) (p)->WaitForVerticalBlank(a, b) -#define IDirectDraw2_GetAvailableVidMem(p, a, b, c) (p)->GetAvailableVidMem(a, b, c) -#endif - -#endif - -/* - * IDirectDrawPalette - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawPalette -DECLARE_INTERFACE_( IDirectDrawPalette, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawPalette methods ***/ - STDMETHOD(GetCaps)(THIS_ LPDWORD) PURE; - STDMETHOD(GetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD, LPPALETTEENTRY) PURE; - STDMETHOD(SetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawPalette_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDrawPalette_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawPalette_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawPalette_GetCaps(p, a) (p)->lpVtbl->GetCaps(p, a) -#define IDirectDrawPalette_GetEntries(p, a, b, c, d) (p)->lpVtbl->GetEntries(p, a, b, c, d) -#define IDirectDrawPalette_Initialize(p, a, b, c) (p)->lpVtbl->Initialize(p, a, b, c) -#define IDirectDrawPalette_SetEntries(p, a, b, c, d) (p)->lpVtbl->SetEntries(p, a, b, c, d) -#else -#define IDirectDrawPalette_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDrawPalette_AddRef(p) (p)->AddRef() -#define IDirectDrawPalette_Release(p) (p)->Release() -#define IDirectDrawPalette_GetCaps(p, a) (p)->GetCaps(a) -#define IDirectDrawPalette_GetEntries(p, a, b, c, d) (p)->GetEntries(a, b, c, d) -#define IDirectDrawPalette_Initialize(p, a, b, c) (p)->Initialize(a, b, c) -#define IDirectDrawPalette_SetEntries(p, a, b, c, d) (p)->SetEntries(a, b, c, d) -#endif - -#endif - -/* - * IDirectDrawClipper - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawClipper -DECLARE_INTERFACE_( IDirectDrawClipper, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawClipper methods ***/ - STDMETHOD(GetClipList)(THIS_ LPRECT, LPRGNDATA, LPDWORD) PURE; - STDMETHOD(GetHWnd)(THIS_ HWND FAR *) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD) PURE; - STDMETHOD(IsClipListChanged)(THIS_ BOOL FAR *) PURE; - STDMETHOD(SetClipList)(THIS_ LPRGNDATA,DWORD) PURE; - STDMETHOD(SetHWnd)(THIS_ DWORD, HWND ) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawClipper_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDrawClipper_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawClipper_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawClipper_GetClipList(p, a, b, c) (p)->lpVtbl->GetClipList(p, a, b, c) -#define IDirectDrawClipper_GetHWnd(p, a) (p)->lpVtbl->GetHWnd(p, a) -#define IDirectDrawClipper_Initialize(p, a, b) (p)->lpVtbl->Initialize(p, a, b) -#define IDirectDrawClipper_IsClipListChanged(p, a) (p)->lpVtbl->IsClipListChanged(p, a) -#define IDirectDrawClipper_SetClipList(p, a, b) (p)->lpVtbl->SetClipList(p, a, b) -#define IDirectDrawClipper_SetHWnd(p, a, b) (p)->lpVtbl->SetHWnd(p, a, b) -#else -#define IDirectDrawClipper_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDrawClipper_AddRef(p) (p)->AddRef() -#define IDirectDrawClipper_Release(p) (p)->Release() -#define IDirectDrawClipper_GetClipList(p, a, b, c) (p)->GetClipList(a, b, c) -#define IDirectDrawClipper_GetHWnd(p, a) (p)->GetHWnd(a) -#define IDirectDrawClipper_Initialize(p, a, b) (p)->Initialize(a, b) -#define IDirectDrawClipper_IsClipListChanged(p, a) (p)->IsClipListChanged(a) -#define IDirectDrawClipper_SetClipList(p, a, b) (p)->SetClipList(a, b) -#define IDirectDrawClipper_SetHWnd(p, a, b) (p)->SetHWnd(a, b) -#endif - -#endif - -/* - * IDirectDrawSurface and related interfaces - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawSurface -DECLARE_INTERFACE_( IDirectDrawSurface, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPVOID) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawSurface_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectDrawSurface_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawSurface_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawSurface_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) -#define IDirectDrawSurface_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) -#define IDirectDrawSurface_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) -#define IDirectDrawSurface_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) -#define IDirectDrawSurface_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) -#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) -#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) -#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) -#define IDirectDrawSurface_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IDirectDrawSurface_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) -#define IDirectDrawSurface_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) -#define IDirectDrawSurface_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) -#define IDirectDrawSurface_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) -#define IDirectDrawSurface_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) -#define IDirectDrawSurface_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirectDrawSurface_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) -#define IDirectDrawSurface_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) -#define IDirectDrawSurface_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) -#define IDirectDrawSurface_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) -#define IDirectDrawSurface_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) -#define IDirectDrawSurface_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectDrawSurface_IsLost(p) (p)->lpVtbl->IsLost(p) -#define IDirectDrawSurface_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirectDrawSurface_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#define IDirectDrawSurface_Restore(p) (p)->lpVtbl->Restore(p) -#define IDirectDrawSurface_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) -#define IDirectDrawSurface_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) -#define IDirectDrawSurface_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) -#define IDirectDrawSurface_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) -#define IDirectDrawSurface_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) -#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) -#define IDirectDrawSurface_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) -#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) -#else -#define IDirectDrawSurface_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectDrawSurface_AddRef(p) (p)->AddRef() -#define IDirectDrawSurface_Release(p) (p)->Release() -#define IDirectDrawSurface_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) -#define IDirectDrawSurface_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) -#define IDirectDrawSurface_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) -#define IDirectDrawSurface_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) -#define IDirectDrawSurface_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) -#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) -#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) -#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) -#define IDirectDrawSurface_Flip(p,a,b) (p)->Flip(a,b) -#define IDirectDrawSurface_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) -#define IDirectDrawSurface_GetBltStatus(p,a) (p)->GetBltStatus(a) -#define IDirectDrawSurface_GetCaps(p,b) (p)->GetCaps(b) -#define IDirectDrawSurface_GetClipper(p,a) (p)->GetClipper(a) -#define IDirectDrawSurface_GetColorKey(p,a,b) (p)->GetColorKey(a,b) -#define IDirectDrawSurface_GetDC(p,a) (p)->GetDC(a) -#define IDirectDrawSurface_GetFlipStatus(p,a) (p)->GetFlipStatus(a) -#define IDirectDrawSurface_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) -#define IDirectDrawSurface_GetPalette(p,a) (p)->GetPalette(a) -#define IDirectDrawSurface_GetPixelFormat(p,a) (p)->GetPixelFormat(a) -#define IDirectDrawSurface_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) -#define IDirectDrawSurface_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectDrawSurface_IsLost(p) (p)->IsLost() -#define IDirectDrawSurface_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirectDrawSurface_ReleaseDC(p,a) (p)->ReleaseDC(a) -#define IDirectDrawSurface_Restore(p) (p)->Restore() -#define IDirectDrawSurface_SetClipper(p,a) (p)->SetClipper(a) -#define IDirectDrawSurface_SetColorKey(p,a,b) (p)->SetColorKey(a,b) -#define IDirectDrawSurface_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) -#define IDirectDrawSurface_SetPalette(p,a) (p)->SetPalette(a) -#define IDirectDrawSurface_Unlock(p,b) (p)->Unlock(b) -#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) -#define IDirectDrawSurface_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) -#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) -#endif - -/* - * IDirectDrawSurface2 and related interfaces - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface2 -DECLARE_INTERFACE_( IDirectDrawSurface2, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE2) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE2, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE2, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE2) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE2, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE2 FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPVOID) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE2) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; - STDMETHOD(PageLock)(THIS_ DWORD) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawSurface2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectDrawSurface2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawSurface2_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawSurface2_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) -#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) -#define IDirectDrawSurface2_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) -#define IDirectDrawSurface2_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) -#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) -#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) -#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) -#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) -#define IDirectDrawSurface2_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IDirectDrawSurface2_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) -#define IDirectDrawSurface2_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) -#define IDirectDrawSurface2_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) -#define IDirectDrawSurface2_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) -#define IDirectDrawSurface2_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) -#define IDirectDrawSurface2_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirectDrawSurface2_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) -#define IDirectDrawSurface2_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) -#define IDirectDrawSurface2_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) -#define IDirectDrawSurface2_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) -#define IDirectDrawSurface2_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) -#define IDirectDrawSurface2_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectDrawSurface2_IsLost(p) (p)->lpVtbl->IsLost(p) -#define IDirectDrawSurface2_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirectDrawSurface2_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#define IDirectDrawSurface2_Restore(p) (p)->lpVtbl->Restore(p) -#define IDirectDrawSurface2_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) -#define IDirectDrawSurface2_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) -#define IDirectDrawSurface2_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) -#define IDirectDrawSurface2_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) -#define IDirectDrawSurface2_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) -#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) -#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) -#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) -#define IDirectDrawSurface2_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a) -#define IDirectDrawSurface2_PageLock(p,a) (p)->lpVtbl->PageLock(p,a) -#define IDirectDrawSurface2_PageUnlock(p,a) (p)->lpVtbl->PageUnlock(p,a) -#else -#define IDirectDrawSurface2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectDrawSurface2_AddRef(p) (p)->AddRef() -#define IDirectDrawSurface2_Release(p) (p)->Release() -#define IDirectDrawSurface2_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) -#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) -#define IDirectDrawSurface2_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) -#define IDirectDrawSurface2_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) -#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) -#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) -#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) -#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) -#define IDirectDrawSurface2_Flip(p,a,b) (p)->Flip(a,b) -#define IDirectDrawSurface2_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) -#define IDirectDrawSurface2_GetBltStatus(p,a) (p)->GetBltStatus(a) -#define IDirectDrawSurface2_GetCaps(p,b) (p)->GetCaps(b) -#define IDirectDrawSurface2_GetClipper(p,a) (p)->GetClipper(a) -#define IDirectDrawSurface2_GetColorKey(p,a,b) (p)->GetColorKey(a,b) -#define IDirectDrawSurface2_GetDC(p,a) (p)->GetDC(a) -#define IDirectDrawSurface2_GetFlipStatus(p,a) (p)->GetFlipStatus(a) -#define IDirectDrawSurface2_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) -#define IDirectDrawSurface2_GetPalette(p,a) (p)->GetPalette(a) -#define IDirectDrawSurface2_GetPixelFormat(p,a) (p)->GetPixelFormat(a) -#define IDirectDrawSurface2_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) -#define IDirectDrawSurface2_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectDrawSurface2_IsLost(p) (p)->IsLost() -#define IDirectDrawSurface2_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirectDrawSurface2_ReleaseDC(p,a) (p)->ReleaseDC(a) -#define IDirectDrawSurface2_Restore(p) (p)->Restore() -#define IDirectDrawSurface2_SetClipper(p,a) (p)->SetClipper(a) -#define IDirectDrawSurface2_SetColorKey(p,a,b) (p)->SetColorKey(a,b) -#define IDirectDrawSurface2_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) -#define IDirectDrawSurface2_SetPalette(p,a) (p)->SetPalette(a) -#define IDirectDrawSurface2_Unlock(p,b) (p)->Unlock(b) -#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) -#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) -#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) -#define IDirectDrawSurface2_GetDDInterface(p,a) (p)->GetDDInterface(a) -#define IDirectDrawSurface2_PageLock(p,a) (p)->PageLock(a) -#define IDirectDrawSurface2_PageUnlock(p,a) (p)->PageUnlock(a) -#endif - -/* - * IDirectDrawSurface3 and related interfaces - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface3 -DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE3, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE3, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE3) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE3 FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPVOID) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; - STDMETHOD(PageLock)(THIS_ DWORD) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; - /*** Added in the V3 interface ***/ - STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC, DWORD) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawSurface3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectDrawSurface3_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawSurface3_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawSurface3_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) -#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) -#define IDirectDrawSurface3_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) -#define IDirectDrawSurface3_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) -#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) -#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) -#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) -#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) -#define IDirectDrawSurface3_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IDirectDrawSurface3_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) -#define IDirectDrawSurface3_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) -#define IDirectDrawSurface3_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) -#define IDirectDrawSurface3_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) -#define IDirectDrawSurface3_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) -#define IDirectDrawSurface3_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirectDrawSurface3_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) -#define IDirectDrawSurface3_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) -#define IDirectDrawSurface3_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) -#define IDirectDrawSurface3_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) -#define IDirectDrawSurface3_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) -#define IDirectDrawSurface3_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectDrawSurface3_IsLost(p) (p)->lpVtbl->IsLost(p) -#define IDirectDrawSurface3_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirectDrawSurface3_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#define IDirectDrawSurface3_Restore(p) (p)->lpVtbl->Restore(p) -#define IDirectDrawSurface3_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) -#define IDirectDrawSurface3_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) -#define IDirectDrawSurface3_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) -#define IDirectDrawSurface3_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) -#define IDirectDrawSurface3_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) -#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) -#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) -#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) -#define IDirectDrawSurface3_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a) -#define IDirectDrawSurface3_PageLock(p,a) (p)->lpVtbl->PageLock(p,a) -#define IDirectDrawSurface3_PageUnlock(p,a) (p)->lpVtbl->PageUnlock(p,a) -#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) (p)->lpVtbl->SetSurfaceDesc(p,a,b) -#else -#define IDirectDrawSurface3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectDrawSurface3_AddRef(p) (p)->AddRef() -#define IDirectDrawSurface3_Release(p) (p)->Release() -#define IDirectDrawSurface3_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) -#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) -#define IDirectDrawSurface3_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) -#define IDirectDrawSurface3_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) -#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) -#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) -#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) -#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) -#define IDirectDrawSurface3_Flip(p,a,b) (p)->Flip(a,b) -#define IDirectDrawSurface3_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) -#define IDirectDrawSurface3_GetBltStatus(p,a) (p)->GetBltStatus(a) -#define IDirectDrawSurface3_GetCaps(p,b) (p)->GetCaps(b) -#define IDirectDrawSurface3_GetClipper(p,a) (p)->GetClipper(a) -#define IDirectDrawSurface3_GetColorKey(p,a,b) (p)->GetColorKey(a,b) -#define IDirectDrawSurface3_GetDC(p,a) (p)->GetDC(a) -#define IDirectDrawSurface3_GetFlipStatus(p,a) (p)->GetFlipStatus(a) -#define IDirectDrawSurface3_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) -#define IDirectDrawSurface3_GetPalette(p,a) (p)->GetPalette(a) -#define IDirectDrawSurface3_GetPixelFormat(p,a) (p)->GetPixelFormat(a) -#define IDirectDrawSurface3_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) -#define IDirectDrawSurface3_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectDrawSurface3_IsLost(p) (p)->IsLost() -#define IDirectDrawSurface3_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) -#define IDirectDrawSurface3_ReleaseDC(p,a) (p)->ReleaseDC(a) -#define IDirectDrawSurface3_Restore(p) (p)->Restore() -#define IDirectDrawSurface3_SetClipper(p,a) (p)->SetClipper(a) -#define IDirectDrawSurface3_SetColorKey(p,a,b) (p)->SetColorKey(a,b) -#define IDirectDrawSurface3_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) -#define IDirectDrawSurface3_SetPalette(p,a) (p)->SetPalette(a) -#define IDirectDrawSurface3_Unlock(p,b) (p)->Unlock(b) -#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) -#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) -#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) -#define IDirectDrawSurface3_GetDDInterface(p,a) (p)->GetDDInterface(a) -#define IDirectDrawSurface3_PageLock(p,a) (p)->PageLock(a) -#define IDirectDrawSurface3_PageUnlock(p,a) (p)->PageUnlock(a) -#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) (p)->SetSurfaceDesc(a,b) -#endif - -/* - * IDirectDrawColorControl - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawColorControl -DECLARE_INTERFACE_( IDirectDrawColorControl, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawColorControl methods ***/ - STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; - STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawColorControl_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDrawColorControl_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawColorControl_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawColorControl_GetColorControls(p, a) (p)->lpVtbl->GetColorControls(p, a) -#define IDirectDrawColorControl_SetColorControls(p, a) (p)->lpVtbl->SetColorControls(p, a) -#else -#define IDirectDrawColorControl_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IDirectDrawColorControl_AddRef(p) (p)->AddRef() -#define IDirectDrawColorControl_Release(p) (p)->Release() -#define IDirectDrawColorControl_GetColorControls(p, a) (p)->GetColorControls(a) -#define IDirectDrawColorControl_SetColorControls(p, a) (p)->SetColorControls(a) -#endif - -#endif - - - -#endif - - -/* - * DDSURFACEDESC - */ -typedef struct _DDSURFACEDESC -{ - DWORD dwSize; // size of the DDSURFACEDESC structure - DWORD dwFlags; // determines what fields are valid - DWORD dwHeight; // height of surface to be created - DWORD dwWidth; // width of input surface - union - { - LONG lPitch; // distance to start of next line (return value only) - DWORD dwLinearSize; // Formless late-allocated optimized surface size - }; - DWORD dwBackBufferCount; // number of back buffers requested - union - { - DWORD dwMipMapCount; // number of mip-map levels requested - DWORD dwZBufferBitDepth; // depth of Z buffer requested - DWORD dwRefreshRate; // refresh rate (used when display mode is described) - }; - DWORD dwAlphaBitDepth; // depth of alpha buffer requested - DWORD dwReserved; // reserved - LPVOID lpSurface; // pointer to the associated surface memory - DDCOLORKEY ddckCKDestOverlay; // color key for destination overlay use - DDCOLORKEY ddckCKDestBlt; // color key for destination blt use - DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use - DDCOLORKEY ddckCKSrcBlt; // color key for source blt use - DDPIXELFORMAT ddpfPixelFormat; // pixel format description of the surface - DDSCAPS ddsCaps; // direct draw surface capabilities -} DDSURFACEDESC; - -/* - * ddsCaps field is valid. - */ -#define DDSD_CAPS 0x00000001l // default - -/* - * dwHeight field is valid. - */ -#define DDSD_HEIGHT 0x00000002l - -/* - * dwWidth field is valid. - */ -#define DDSD_WIDTH 0x00000004l - -/* - * lPitch is valid. - */ -#define DDSD_PITCH 0x00000008l - -/* - * dwBackBufferCount is valid. - */ -#define DDSD_BACKBUFFERCOUNT 0x00000020l - -/* - * dwZBufferBitDepth is valid. - */ -#define DDSD_ZBUFFERBITDEPTH 0x00000040l - -/* - * dwAlphaBitDepth is valid. - */ -#define DDSD_ALPHABITDEPTH 0x00000080l - - -/* - * lpSurface is valid. - */ -#define DDSD_LPSURFACE 0x00000800l - -/* - * ddpfPixelFormat is valid. - */ -#define DDSD_PIXELFORMAT 0x00001000l - -/* - * ddckCKDestOverlay is valid. - */ -#define DDSD_CKDESTOVERLAY 0x00002000l - -/* - * ddckCKDestBlt is valid. - */ -#define DDSD_CKDESTBLT 0x00004000l - -/* - * ddckCKSrcOverlay is valid. - */ -#define DDSD_CKSRCOVERLAY 0x00008000l - -/* - * ddckCKSrcBlt is valid. - */ -#define DDSD_CKSRCBLT 0x00010000l - -/* - * dwMipMapCount is valid. - */ -#define DDSD_MIPMAPCOUNT 0x00020000l - - /* - * dwRefreshRate is valid - */ -#define DDSD_REFRESHRATE 0x00040000l - -/* - * dwLinearSize is valid - */ -#define DDSD_LINEARSIZE 0x00080000l - -/* - * All input fields are valid. - */ -#define DDSD_ALL 0x000ff9eel - - -/* - * DDCOLORCONTROL - */ -typedef struct _DDCOLORCONTROL -{ - DWORD dwSize; - DWORD dwFlags; - LONG lBrightness; - LONG lContrast; - LONG lHue; - LONG lSaturation; - LONG lSharpness; - LONG lGamma; - LONG lColorEnable; - DWORD dwReserved1; -} DDCOLORCONTROL; - - -/* - * lBrightness field is valid. - */ -#define DDCOLOR_BRIGHTNESS 0x00000001l - -/* - * lContrast field is valid. - */ -#define DDCOLOR_CONTRAST 0x00000002l - -/* - * lHue field is valid. - */ -#define DDCOLOR_HUE 0x00000004l - -/* - * lSaturation field is valid. - */ -#define DDCOLOR_SATURATION 0x00000008l - -/* - * lSharpness field is valid. - */ -#define DDCOLOR_SHARPNESS 0x00000010l - -/* - * lGamma field is valid. - */ -#define DDCOLOR_GAMMA 0x00000020l - -/* - * lColorEnable field is valid. - */ -#define DDCOLOR_COLORENABLE 0x00000040l - - - -/*============================================================================ - * - * Direct Draw Capability Flags - * - * These flags are used to describe the capabilities of a given Surface. - * All flags are bit flags. - * - *==========================================================================*/ - -/**************************************************************************** - * - * DIRECTDRAWSURFACE CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * This bit is reserved. It should not be specified. - */ -#define DDSCAPS_RESERVED1 0x00000001l - -/* - * Indicates that this surface contains alpha-only information. - * (To determine if a surface is RGBA/YUVA, the pixel format must be - * interrogated.) - */ -#define DDSCAPS_ALPHA 0x00000002l - -/* - * Indicates that this surface is a backbuffer. It is generally - * set by CreateSurface when the DDSCAPS_FLIP capability bit is set. - * It indicates that this surface is THE back buffer of a surface - * flipping structure. DirectDraw supports N surfaces in a - * surface flipping structure. Only the surface that immediately - * precedeces the DDSCAPS_FRONTBUFFER has this capability bit set. - * The other surfaces are identified as back buffers by the presence - * of the DDSCAPS_FLIP capability, their attachment order, and the - * absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER - * capabilities. The bit is sent to CreateSurface when a standalone - * back buffer is being created. This surface could be attached to - * a front buffer and/or back buffers to form a flipping surface - * structure after the CreateSurface call. See AddAttachments for - * a detailed description of the behaviors in this case. - */ -#define DDSCAPS_BACKBUFFER 0x00000004l - -/* - * Indicates a complex surface structure is being described. A - * complex surface structure results in the creation of more than - * one surface. The additional surfaces are attached to the root - * surface. The complex structure can only be destroyed by - * destroying the root. - */ -#define DDSCAPS_COMPLEX 0x00000008l - -/* - * Indicates that this surface is a part of a surface flipping structure. - * When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and - * DDSCAP_BACKBUFFER bits are not set. They are set by CreateSurface - * on the resulting creations. The dwBackBufferCount field in the - * DDSURFACEDESC structure must be set to at least 1 in order for - * the CreateSurface call to succeed. The DDSCAPS_COMPLEX capability - * must always be set with creating multiple surfaces through CreateSurface. - */ -#define DDSCAPS_FLIP 0x00000010l - -/* - * Indicates that this surface is THE front buffer of a surface flipping - * structure. It is generally set by CreateSurface when the DDSCAPS_FLIP - * capability bit is set. - * If this capability is sent to CreateSurface then a standalonw front buffer - * is created. This surface will not have the DDSCAPS_FLIP capability. - * It can be attached to other back buffers to form a flipping structure. - * See AddAttachments for a detailed description of the behaviors in this - * case. - */ -#define DDSCAPS_FRONTBUFFER 0x00000020l - -/* - * Indicates that this surface is any offscreen surface that is not an overlay, - * texture, zbuffer, front buffer, back buffer, or alpha surface. It is used - * to identify plain vanilla surfaces. - */ -#define DDSCAPS_OFFSCREENPLAIN 0x00000040l - -/* - * Indicates that this surface is an overlay. It may or may not be directly visible - * depending on whether or not it is currently being overlayed onto the primary - * surface. DDSCAPS_VISIBLE can be used to determine whether or not it is being - * overlayed at the moment. - */ -#define DDSCAPS_OVERLAY 0x00000080l - -/* - * Indicates that unique DirectDrawPalette objects can be created and - * attached to this surface. - */ -#define DDSCAPS_PALETTE 0x00000100l - -/* - * Indicates that this surface is the primary surface. The primary - * surface represents what the user is seeing at the moment. - */ -#define DDSCAPS_PRIMARYSURFACE 0x00000200l - -/* - * Indicates that this surface is the primary surface for the left eye. - * The primary surface for the left eye represents what the user is seeing - * at the moment with the users left eye. When this surface is created the - * DDSCAPS_PRIMARYSURFACE represents what the user is seeing with the users - * right eye. - */ -#define DDSCAPS_PRIMARYSURFACELEFT 0x00000400l - -/* - * Indicates that this surface memory was allocated in system memory - */ -#define DDSCAPS_SYSTEMMEMORY 0x00000800l - -/* - * Indicates that this surface can be used as a 3D texture. It does not - * indicate whether or not the surface is being used for that purpose. - */ -#define DDSCAPS_TEXTURE 0x00001000l - -/* - * Indicates that a surface may be a destination for 3D rendering. This - * bit must be set in order to query for a Direct3D Device Interface - * from this surface. - */ -#define DDSCAPS_3DDEVICE 0x00002000l - -/* - * Indicates that this surface exists in video memory. - */ -#define DDSCAPS_VIDEOMEMORY 0x00004000l - -/* - * Indicates that changes made to this surface are immediately visible. - * It is always set for the primary surface and is set for overlays while - * they are being overlayed and texture maps while they are being textured. - */ -#define DDSCAPS_VISIBLE 0x00008000l - -/* - * Indicates that only writes are permitted to the surface. Read accesses - * from the surface may or may not generate a protection fault, but the - * results of a read from this surface will not be meaningful. READ ONLY. - */ -#define DDSCAPS_WRITEONLY 0x00010000l - -/* - * Indicates that this surface is a z buffer. A z buffer does not contain - * displayable information. Instead it contains bit depth information that is - * used to determine which pixels are visible and which are obscured. - */ -#define DDSCAPS_ZBUFFER 0x00020000l - -/* - * Indicates surface will have a DC associated long term - */ -#define DDSCAPS_OWNDC 0x00040000l - -/* - * Indicates surface should be able to receive live video - */ -#define DDSCAPS_LIVEVIDEO 0x00080000l - -/* - * Indicates surface should be able to have a stream decompressed - * to it by the hardware. - */ -#define DDSCAPS_HWCODEC 0x00100000l - -/* - * Surface is a ModeX surface. - * - */ -#define DDSCAPS_MODEX 0x00200000l - -/* - * Indicates surface is one level of a mip-map. This surface will - * be attached to other DDSCAPS_MIPMAP surfaces to form the mip-map. - * This can be done explicitly, by creating a number of surfaces and - * attaching them with AddAttachedSurface or by implicitly by CreateSurface. - * If this bit is set then DDSCAPS_TEXTURE must also be set. - */ -#define DDSCAPS_MIPMAP 0x00400000l - -/* - * This bit is reserved. It should not be specified. - */ -#define DDSCAPS_RESERVED2 0x00800000l - - -/* - * Indicates that memory for the surface is not allocated until the surface - * is loaded (via the Direct3D texture Load() function). - */ -#define DDSCAPS_ALLOCONLOAD 0x04000000l - -/* - * Indicates that the surface will recieve data from a video port. - */ -#define DDSCAPS_VIDEOPORT 0x08000000l - -/* - * Indicates that a video memory surface is resident in true, local video - * memory rather than non-local video memory. If this flag is specified then - * so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with - * DDSCAPS_NONLOCALVIDMEM. - */ -#define DDSCAPS_LOCALVIDMEM 0x10000000l - -/* - * Indicates that a video memory surface is resident in non-local video - * memory rather than true, local video memory. If this flag is specified - * then so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with - * DDSCAPS_LOCALVIDMEM. - */ -#define DDSCAPS_NONLOCALVIDMEM 0x20000000l - -/* - * Indicates that this surface is a standard VGA mode surface, and not a - * ModeX surface. (This flag will never be set in combination with the - * DDSCAPS_MODEX flag). - */ -#define DDSCAPS_STANDARDVGAMODE 0x40000000l - -/* - * Indicates that this surface will be an optimized surface. This flag is - * currently only valid in conjunction with the DDSCAPS_TEXTURE flag. The surface - * will be created without any underlying video memory until loaded. - */ -#define DDSCAPS_OPTIMIZED 0x80000000l - - - - /**************************************************************************** - * - * DIRECTDRAW DRIVER CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Display hardware has 3D acceleration. - */ -#define DDCAPS_3D 0x00000001l - -/* - * Indicates that DirectDraw will support only dest rectangles that are aligned - * on DIRECTDRAWCAPS.dwAlignBoundaryDest boundaries of the surface, respectively. - * READ ONLY. - */ -#define DDCAPS_ALIGNBOUNDARYDEST 0x00000002l - -/* - * Indicates that DirectDraw will support only source rectangles whose sizes in - * BYTEs are DIRECTDRAWCAPS.dwAlignSizeDest multiples, respectively. READ ONLY. - */ -#define DDCAPS_ALIGNSIZEDEST 0x00000004l -/* - * Indicates that DirectDraw will support only source rectangles that are aligned - * on DIRECTDRAWCAPS.dwAlignBoundarySrc boundaries of the surface, respectively. - * READ ONLY. - */ -#define DDCAPS_ALIGNBOUNDARYSRC 0x00000008l - -/* - * Indicates that DirectDraw will support only source rectangles whose sizes in - * BYTEs are DIRECTDRAWCAPS.dwAlignSizeSrc multiples, respectively. READ ONLY. - */ -#define DDCAPS_ALIGNSIZESRC 0x00000010l - -/* - * Indicates that DirectDraw will create video memory surfaces that have a stride - * alignment equal to DIRECTDRAWCAPS.dwAlignStride. READ ONLY. - */ -#define DDCAPS_ALIGNSTRIDE 0x00000020l - -/* - * Display hardware is capable of blt operations. - */ -#define DDCAPS_BLT 0x00000040l - -/* - * Display hardware is capable of asynchronous blt operations. - */ -#define DDCAPS_BLTQUEUE 0x00000080l - -/* - * Display hardware is capable of color space conversions during the blt operation. - */ -#define DDCAPS_BLTFOURCC 0x00000100l - -/* - * Display hardware is capable of stretching during blt operations. - */ -#define DDCAPS_BLTSTRETCH 0x00000200l - -/* - * Display hardware is shared with GDI. - */ -#define DDCAPS_GDI 0x00000400l - -/* - * Display hardware can overlay. - */ -#define DDCAPS_OVERLAY 0x00000800l - -/* - * Set if display hardware supports overlays but can not clip them. - */ -#define DDCAPS_OVERLAYCANTCLIP 0x00001000l - -/* - * Indicates that overlay hardware is capable of color space conversions during - * the overlay operation. - */ -#define DDCAPS_OVERLAYFOURCC 0x00002000l - -/* - * Indicates that stretching can be done by the overlay hardware. - */ -#define DDCAPS_OVERLAYSTRETCH 0x00004000l - -/* - * Indicates that unique DirectDrawPalettes can be created for DirectDrawSurfaces - * other than the primary surface. - */ -#define DDCAPS_PALETTE 0x00008000l - -/* - * Indicates that palette changes can be syncd with the veritcal refresh. - */ -#define DDCAPS_PALETTEVSYNC 0x00010000l - -/* - * Display hardware can return the current scan line. - */ -#define DDCAPS_READSCANLINE 0x00020000l - -/* - * Display hardware has stereo vision capabilities. DDSCAPS_PRIMARYSURFACELEFT - * can be created. - */ -#define DDCAPS_STEREOVIEW 0x00040000l - -/* - * Display hardware is capable of generating a vertical blank interrupt. - */ -#define DDCAPS_VBI 0x00080000l - -/* - * Supports the use of z buffers with blt operations. - */ -#define DDCAPS_ZBLTS 0x00100000l - -/* - * Supports Z Ordering of overlays. - */ -#define DDCAPS_ZOVERLAYS 0x00200000l - -/* - * Supports color key - */ -#define DDCAPS_COLORKEY 0x00400000l - -/* - * Supports alpha surfaces - */ -#define DDCAPS_ALPHA 0x00800000l - -/* - * colorkey is hardware assisted(DDCAPS_COLORKEY will also be set) - */ -#define DDCAPS_COLORKEYHWASSIST 0x01000000l - -/* - * no hardware support at all - */ -#define DDCAPS_NOHARDWARE 0x02000000l - -/* - * Display hardware is capable of color fill with bltter - */ -#define DDCAPS_BLTCOLORFILL 0x04000000l - -/* - * Display hardware is bank switched, and potentially very slow at - * random access to VRAM. - */ -#define DDCAPS_BANKSWITCHED 0x08000000l - -/* - * Display hardware is capable of depth filling Z-buffers with bltter - */ -#define DDCAPS_BLTDEPTHFILL 0x10000000l - -/* - * Display hardware is capable of clipping while bltting. - */ -#define DDCAPS_CANCLIP 0x20000000l - -/* - * Display hardware is capable of clipping while stretch bltting. - */ -#define DDCAPS_CANCLIPSTRETCHED 0x40000000l - -/* - * Display hardware is capable of bltting to or from system memory - */ -#define DDCAPS_CANBLTSYSMEM 0x80000000l - - - /**************************************************************************** - * - * MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2) - * - ****************************************************************************/ - -/* - * Display hardware is certified - */ -#define DDCAPS2_CERTIFIED 0x00000001l - -/* - * Driver cannot interleave 2D operations (lock and blt) to surfaces with - * Direct3D rendering operations between calls to BeginScene() and EndScene() - */ -#define DDCAPS2_NO2DDURING3DSCENE 0x00000002l - -/* - * Display hardware contains a video port - */ -#define DDCAPS2_VIDEOPORT 0x00000004l - -/* - * The overlay can be automatically flipped according to the video port - * VSYNCs, providing automatic doubled buffered display of video port - * data using an overlay - */ -#define DDCAPS2_AUTOFLIPOVERLAY 0x00000008l - -/* - * Overlay can display each field of interlaced data individually while - * it is interleaved in memory without causing jittery artifacts. - */ -#define DDCAPS2_CANBOBINTERLEAVED 0x00000010l - -/* - * Overlay can display each field of interlaced data individually while - * it is not interleaved in memory without causing jittery artifacts. - */ -#define DDCAPS2_CANBOBNONINTERLEAVED 0x00000020l - -/* - * The overlay surface contains color controls (brightness, sharpness, etc.) - */ -#define DDCAPS2_COLORCONTROLOVERLAY 0x00000040l - -/* - * The primary surface contains color controls (gamma, etc.) - */ -#define DDCAPS2_COLORCONTROLPRIMARY 0x00000080l - -/* - * RGBZ -> RGB supported for 16:16 RGB:Z - */ -#define DDCAPS2_CANDROPZ16BIT 0x00000100l - -/* - * Driver supports non-local video memory. - */ -#define DDCAPS2_NONLOCALVIDMEM 0x00000200l - -/* - * Dirver supports non-local video memory but has different capabilities for - * non-local video memory surfaces. If this bit is set then so must - * DDCAPS2_NONLOCALVIDMEM. - */ -#define DDCAPS2_NONLOCALVIDMEMCAPS 0x00000400l - -/* - * Driver neither requires nor prefers surfaces to be pagelocked when performing - * blts involving system memory surfaces - */ -#define DDCAPS2_NOPAGELOCKREQUIRED 0x00000800l - -/* - * Driver can create surfaces which are wider than the primary surface - */ -#define DDCAPS2_WIDESURFACES 0x00001000l - -/* - * Driver supports bob using software without using a video port - */ -#define DDCAPS2_CANFLIPODDEVEN 0x00002000l - -/**************************************************************************** - * - * DIRECTDRAW FX ALPHA CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Supports alpha blending around the edge of a source color keyed surface. - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHAEDGEBLEND 0x00000001l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value becomes - * more opaque as the alpha value increases. (0 is transparent.) - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHAPIXELS 0x00000002l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value - * becomes more transparent as the alpha value increases. (0 is opaque.) - * This flag can only be set if DDCAPS_ALPHA is set. - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHAPIXELSNEG 0x00000004l - -/* - * Supports alpha only surfaces. The bit depth of an alpha only surface can be - * 1,2,4, or 8. The alpha value becomes more opaque as the alpha value increases. - * (0 is transparent.) - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHASURFACES 0x00000008l - -/* - * The depth of the alpha channel data can range can be 1,2,4, or 8. - * The NEG suffix indicates that this alpha channel becomes more transparent - * as the alpha value increases. (0 is opaque.) This flag can only be set if - * DDCAPS_ALPHA is set. - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHASURFACESNEG 0x00000010l - -/* - * Supports alpha blending around the edge of a source color keyed surface. - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND 0x00000020l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value becomes - * more opaque as the alpha value increases. (0 is transparent.) - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHAPIXELS 0x00000040l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value - * becomes more transparent as the alpha value increases. (0 is opaque.) - * This flag can only be set if DDCAPS_ALPHA is set. - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG 0x00000080l - -/* - * Supports alpha only surfaces. The bit depth of an alpha only surface can be - * 1,2,4, or 8. The alpha value becomes more opaque as the alpha value increases. - * (0 is transparent.) - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHASURFACES 0x00000100l - -/* - * The depth of the alpha channel data can range can be 1,2,4, or 8. - * The NEG suffix indicates that this alpha channel becomes more transparent - * as the alpha value increases. (0 is opaque.) This flag can only be set if - * DDCAPS_ALPHA is set. - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHASURFACESNEG 0x00000200l - -/**************************************************************************** - * - * DIRECTDRAW FX CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Uses arithmetic operations to stretch and shrink surfaces during blt - * rather than pixel doubling techniques. Along the Y axis. - */ -#define DDFXCAPS_BLTARITHSTRETCHY 0x00000020l - -/* - * Uses arithmetic operations to stretch during blt - * rather than pixel doubling techniques. Along the Y axis. Only - * works for x1, x2, etc. - */ -#define DDFXCAPS_BLTARITHSTRETCHYN 0x00000010l - -/* - * Supports mirroring left to right in blt. - */ -#define DDFXCAPS_BLTMIRRORLEFTRIGHT 0x00000040l - -/* - * Supports mirroring top to bottom in blt. - */ -#define DDFXCAPS_BLTMIRRORUPDOWN 0x00000080l - -/* - * Supports arbitrary rotation for blts. - */ -#define DDFXCAPS_BLTROTATION 0x00000100l - -/* - * Supports 90 degree rotations for blts. - */ -#define DDFXCAPS_BLTROTATION90 0x00000200l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKX 0x00000400l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKXN 0x00000800l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * y axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKY 0x00001000l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the y axis (vertical direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKYN 0x00002000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHX 0x00004000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHXN 0x00008000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * y axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHY 0x00010000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the y axis (vertical direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHYN 0x00020000l - -/* - * Uses arithmetic operations to stretch and shrink surfaces during - * overlay rather than pixel doubling techniques. Along the Y axis - * for overlays. - */ -#define DDFXCAPS_OVERLAYARITHSTRETCHY 0x00040000l - -/* - * Uses arithmetic operations to stretch surfaces during - * overlay rather than pixel doubling techniques. Along the Y axis - * for overlays. Only works for x1, x2, etc. - */ -#define DDFXCAPS_OVERLAYARITHSTRETCHYN 0x00000008l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKX 0x00080000l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKXN 0x00100000l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * y axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKY 0x00200000l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the y axis (vertical direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKYN 0x00400000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHX 0x00800000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHXN 0x01000000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * y axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHY 0x02000000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the y axis (vertical direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHYN 0x04000000l - -/* - * DirectDraw supports mirroring of overlays across the vertical axis - */ -#define DDFXCAPS_OVERLAYMIRRORLEFTRIGHT 0x08000000l - -/* - * DirectDraw supports mirroring of overlays across the horizontal axis - */ -#define DDFXCAPS_OVERLAYMIRRORUPDOWN 0x10000000l - -/**************************************************************************** - * - * DIRECTDRAW STEREO VIEW CAPABILITIES - * - ****************************************************************************/ - -/* - * The stereo view is accomplished via enigma encoding. - */ -#define DDSVCAPS_ENIGMA 0x00000001l - -/* - * The stereo view is accomplished via high frequency flickering. - */ -#define DDSVCAPS_FLICKER 0x00000002l - -/* - * The stereo view is accomplished via red and blue filters applied - * to the left and right eyes. All images must adapt their colorspaces - * for this process. - */ -#define DDSVCAPS_REDBLUE 0x00000004l - -/* - * The stereo view is accomplished with split screen technology. - */ -#define DDSVCAPS_SPLIT 0x00000008l - -/**************************************************************************** - * - * DIRECTDRAWPALETTE CAPABILITIES - * - ****************************************************************************/ - -/* - * Index is 4 bits. There are sixteen color entries in the palette table. - */ -#define DDPCAPS_4BIT 0x00000001l - -/* - * Index is onto a 8 bit color index. This field is only valid with the - * DDPCAPS_1BIT, DDPCAPS_2BIT or DDPCAPS_4BIT capability and the target - * surface is in 8bpp. Each color entry is one byte long and is an index - * into destination surface's 8bpp palette. - */ -#define DDPCAPS_8BITENTRIES 0x00000002l - -/* - * Index is 8 bits. There are 256 color entries in the palette table. - */ -#define DDPCAPS_8BIT 0x00000004l - -/* - * Indicates that this DIRECTDRAWPALETTE should use the palette color array - * passed into the lpDDColorArray parameter to initialize the DIRECTDRAWPALETTE - * object. - */ -#define DDPCAPS_INITIALIZE 0x00000008l - -/* - * This palette is the one attached to the primary surface. Changing this - * table has immediate effect on the display unless DDPSETPAL_VSYNC is specified - * and supported. - */ -#define DDPCAPS_PRIMARYSURFACE 0x00000010l - -/* - * This palette is the one attached to the primary surface left. Changing - * this table has immediate effect on the display for the left eye unless - * DDPSETPAL_VSYNC is specified and supported. - */ -#define DDPCAPS_PRIMARYSURFACELEFT 0x00000020l - -/* - * This palette can have all 256 entries defined - */ -#define DDPCAPS_ALLOW256 0x00000040l - -/* - * This palette can have modifications to it synced with the monitors - * refresh rate. - */ -#define DDPCAPS_VSYNC 0x00000080l - -/* - * Index is 1 bit. There are two color entries in the palette table. - */ -#define DDPCAPS_1BIT 0x00000100l - -/* - * Index is 2 bit. There are four color entries in the palette table. - */ -#define DDPCAPS_2BIT 0x00000200l - - -/**************************************************************************** - * - * DIRECTDRAWPALETTE SETENTRY CONSTANTS - * - ****************************************************************************/ - - -/**************************************************************************** - * - * DIRECTDRAWPALETTE GETENTRY CONSTANTS - * - ****************************************************************************/ - -/* 0 is the only legal value */ - -/**************************************************************************** - * - * DIRECTDRAWSURFACE SETPALETTE CONSTANTS - * - ****************************************************************************/ - - -/**************************************************************************** - * - * DIRECTDRAW BITDEPTH CONSTANTS - * - * NOTE: These are only used to indicate supported bit depths. These - * are flags only, they are not to be used as an actual bit depth. The - * absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual - * bit depths in a surface or for changing the display mode. - * - ****************************************************************************/ - -/* - * 1 bit per pixel. - */ -#define DDBD_1 0x00004000l - -/* - * 2 bits per pixel. - */ -#define DDBD_2 0x00002000l - -/* - * 4 bits per pixel. - */ -#define DDBD_4 0x00001000l - -/* - * 8 bits per pixel. - */ -#define DDBD_8 0x00000800l - -/* - * 16 bits per pixel. - */ -#define DDBD_16 0x00000400l - -/* - * 24 bits per pixel. - */ -#define DDBD_24 0X00000200l - -/* - * 32 bits per pixel. - */ -#define DDBD_32 0x00000100l - -/**************************************************************************** - * - * DIRECTDRAWSURFACE SET/GET COLOR KEY FLAGS - * - ****************************************************************************/ - -/* - * Set if the structure contains a color space. Not set if the structure - * contains a single color key. - */ -#define DDCKEY_COLORSPACE 0x00000001l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a destination color key for blt operations. - */ -#define DDCKEY_DESTBLT 0x00000002l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a destination color key for overlay operations. - */ -#define DDCKEY_DESTOVERLAY 0x00000004l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a source color key for blt operations. - */ -#define DDCKEY_SRCBLT 0x00000008l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a source color key for overlay operations. - */ -#define DDCKEY_SRCOVERLAY 0x00000010l - - -/**************************************************************************** - * - * DIRECTDRAW COLOR KEY CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Supports transparent blting using a color key to identify the replaceable - * bits of the destination surface for RGB colors. - */ -#define DDCKEYCAPS_DESTBLT 0x00000001l - -/* - * Supports transparent blting using a color space to identify the replaceable - * bits of the destination surface for RGB colors. - */ -#define DDCKEYCAPS_DESTBLTCLRSPACE 0x00000002l - -/* - * Supports transparent blting using a color space to identify the replaceable - * bits of the destination surface for YUV colors. - */ -#define DDCKEYCAPS_DESTBLTCLRSPACEYUV 0x00000004l - -/* - * Supports transparent blting using a color key to identify the replaceable - * bits of the destination surface for YUV colors. - */ -#define DDCKEYCAPS_DESTBLTYUV 0x00000008l - -/* - * Supports overlaying using colorkeying of the replaceable bits of the surface - * being overlayed for RGB colors. - */ -#define DDCKEYCAPS_DESTOVERLAY 0x00000010l - -/* - * Supports a color space as the color key for the destination for RGB colors. - */ -#define DDCKEYCAPS_DESTOVERLAYCLRSPACE 0x00000020l - -/* - * Supports a color space as the color key for the destination for YUV colors. - */ -#define DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV 0x00000040l - -/* - * Supports only one active destination color key value for visible overlay - * surfaces. - */ -#define DDCKEYCAPS_DESTOVERLAYONEACTIVE 0x00000080l - -/* - * Supports overlaying using colorkeying of the replaceable bits of the - * surface being overlayed for YUV colors. - */ -#define DDCKEYCAPS_DESTOVERLAYYUV 0x00000100l - -/* - * Supports transparent blting using the color key for the source with - * this surface for RGB colors. - */ -#define DDCKEYCAPS_SRCBLT 0x00000200l - -/* - * Supports transparent blting using a color space for the source with - * this surface for RGB colors. - */ -#define DDCKEYCAPS_SRCBLTCLRSPACE 0x00000400l - -/* - * Supports transparent blting using a color space for the source with - * this surface for YUV colors. - */ -#define DDCKEYCAPS_SRCBLTCLRSPACEYUV 0x00000800l - -/* - * Supports transparent blting using the color key for the source with - * this surface for YUV colors. - */ -#define DDCKEYCAPS_SRCBLTYUV 0x00001000l - -/* - * Supports overlays using the color key for the source with this - * overlay surface for RGB colors. - */ -#define DDCKEYCAPS_SRCOVERLAY 0x00002000l - -/* - * Supports overlays using a color space as the source color key for - * the overlay surface for RGB colors. - */ -#define DDCKEYCAPS_SRCOVERLAYCLRSPACE 0x00004000l - -/* - * Supports overlays using a color space as the source color key for - * the overlay surface for YUV colors. - */ -#define DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV 0x00008000l - -/* - * Supports only one active source color key value for visible - * overlay surfaces. - */ -#define DDCKEYCAPS_SRCOVERLAYONEACTIVE 0x00010000l - -/* - * Supports overlays using the color key for the source with this - * overlay surface for YUV colors. - */ -#define DDCKEYCAPS_SRCOVERLAYYUV 0x00020000l - -/* - * there are no bandwidth trade-offs for using colorkey with an overlay - */ -#define DDCKEYCAPS_NOCOSTOVERLAY 0x00040000l - - -/**************************************************************************** - * - * DIRECTDRAW PIXELFORMAT FLAGS - * - ****************************************************************************/ - -/* - * The surface has alpha channel information in the pixel format. - */ -#define DDPF_ALPHAPIXELS 0x00000001l - -/* - * The pixel format contains alpha only information - */ -#define DDPF_ALPHA 0x00000002l - -/* - * The FourCC code is valid. - */ -#define DDPF_FOURCC 0x00000004l - -/* - * The surface is 4-bit color indexed. - */ -#define DDPF_PALETTEINDEXED4 0x00000008l - -/* - * The surface is indexed into a palette which stores indices - * into the destination surface's 8-bit palette. - */ -#define DDPF_PALETTEINDEXEDTO8 0x00000010l - -/* - * The surface is 8-bit color indexed. - */ -#define DDPF_PALETTEINDEXED8 0x00000020l - -/* - * The RGB data in the pixel format structure is valid. - */ -#define DDPF_RGB 0x00000040l - -/* - * The surface will accept pixel data in the format specified - * and compress it during the write. - */ -#define DDPF_COMPRESSED 0x00000080l - -/* - * The surface will accept RGB data and translate it during - * the write to YUV data. The format of the data to be written - * will be contained in the pixel format structure. The DDPF_RGB - * flag will be set. - */ -#define DDPF_RGBTOYUV 0x00000100l - -/* - * pixel format is YUV - YUV data in pixel format struct is valid - */ -#define DDPF_YUV 0x00000200l - -/* - * pixel format is a z buffer only surface - */ -#define DDPF_ZBUFFER 0x00000400l - -/* - * The surface is 1-bit color indexed. - */ -#define DDPF_PALETTEINDEXED1 0x00000800l - -/* - * The surface is 2-bit color indexed. - */ -#define DDPF_PALETTEINDEXED2 0x00001000l - -/* - * The surface contains Z information in the pixels - */ -#define DDPF_ZPIXELS 0x00002000l - -/*=========================================================================== - * - * - * DIRECTDRAW CALLBACK FLAGS - * - * - *==========================================================================*/ - -/**************************************************************************** - * - * DIRECTDRAW ENUMSURFACES FLAGS - * - ****************************************************************************/ - -/* - * Enumerate all of the surfaces that meet the search criterion. - */ -#define DDENUMSURFACES_ALL 0x00000001l - -/* - * A search hit is a surface that matches the surface description. - */ -#define DDENUMSURFACES_MATCH 0x00000002l - -/* - * A search hit is a surface that does not match the surface description. - */ -#define DDENUMSURFACES_NOMATCH 0x00000004l - -/* - * Enumerate the first surface that can be created which meets the search criterion. - */ -#define DDENUMSURFACES_CANBECREATED 0x00000008l - -/* - * Enumerate the surfaces that already exist that meet the search criterion. - */ -#define DDENUMSURFACES_DOESEXIST 0x00000010l - - -/**************************************************************************** - * - * DIRECTDRAW SETDISPLAYMODE FLAGS - * - ****************************************************************************/ - -/* - * The desired mode is a standard VGA mode - */ -#define DDSDM_STANDARDVGAMODE 0x00000001l - - - -/**************************************************************************** - * - * DIRECTDRAW ENUMDISPLAYMODES FLAGS - * - ****************************************************************************/ - -/* - * Enumerate Modes with different refresh rates. EnumDisplayModes guarantees - * that a particular mode will be enumerated only once. This flag specifies whether - * the refresh rate is taken into account when determining if a mode is unique. - */ -#define DDEDM_REFRESHRATES 0x00000001l - -/* - * Enumerate VGA modes. Specify this flag if you wish to enumerate supported VGA - * modes such as mode 0x13 in addition to the usual ModeX modes (which are always - * enumerated if the application has previously called SetCooperativeLevel with the - * DDSCL_ALLOWMODEX flag set). - */ -#define DDEDM_STANDARDVGAMODES 0x00000002L - - -/**************************************************************************** - * - * DIRECTDRAW SETCOOPERATIVELEVEL FLAGS - * - ****************************************************************************/ - -/* - * Exclusive mode owner will be responsible for the entire primary surface. - * GDI can be ignored. used with DD - */ -#define DDSCL_FULLSCREEN 0x00000001l - -/* - * allow CTRL_ALT_DEL to work while in fullscreen exclusive mode - */ -#define DDSCL_ALLOWREBOOT 0x00000002l - -/* - * prevents DDRAW from modifying the application window. - * prevents DDRAW from minimize/restore the application window on activation. - */ -#define DDSCL_NOWINDOWCHANGES 0x00000004l - -/* - * app wants to work as a regular Windows application - */ -#define DDSCL_NORMAL 0x00000008l - -/* - * app wants exclusive access - */ -#define DDSCL_EXCLUSIVE 0x00000010l - - -/* - * app can deal with non-windows display modes - */ -#define DDSCL_ALLOWMODEX 0x00000040l - - -/**************************************************************************** - * - * DIRECTDRAW BLT FLAGS - * - ****************************************************************************/ - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the destination surface as the alpha channel for this blt. - */ -#define DDBLT_ALPHADEST 0x00000001l - -/* - * Use the dwConstAlphaDest field in the DDBLTFX structure as the alpha channel - * for the destination surface for this blt. - */ -#define DDBLT_ALPHADESTCONSTOVERRIDE 0x00000002l - -/* - * The NEG suffix indicates that the destination surface becomes more - * transparent as the alpha value increases. (0 is opaque) - */ -#define DDBLT_ALPHADESTNEG 0x00000004l - -/* - * Use the lpDDSAlphaDest field in the DDBLTFX structure as the alpha - * channel for the destination for this blt. - */ -#define DDBLT_ALPHADESTSURFACEOVERRIDE 0x00000008l - -/* - * Use the dwAlphaEdgeBlend field in the DDBLTFX structure as the alpha channel - * for the edges of the image that border the color key colors. - */ -#define DDBLT_ALPHAEDGEBLEND 0x00000010l - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the source surface as the alpha channel for this blt. - */ -#define DDBLT_ALPHASRC 0x00000020l - -/* - * Use the dwConstAlphaSrc field in the DDBLTFX structure as the alpha channel - * for the source for this blt. - */ -#define DDBLT_ALPHASRCCONSTOVERRIDE 0x00000040l - -/* - * The NEG suffix indicates that the source surface becomes more transparent - * as the alpha value increases. (0 is opaque) - */ -#define DDBLT_ALPHASRCNEG 0x00000080l - -/* - * Use the lpDDSAlphaSrc field in the DDBLTFX structure as the alpha channel - * for the source for this blt. - */ -#define DDBLT_ALPHASRCSURFACEOVERRIDE 0x00000100l - -/* - * Do this blt asynchronously through the FIFO in the order received. If - * there is no room in the hardware FIFO fail the call. - */ -#define DDBLT_ASYNC 0x00000200l - -/* - * Uses the dwFillColor field in the DDBLTFX structure as the RGB color - * to fill the destination rectangle on the destination surface with. - */ -#define DDBLT_COLORFILL 0x00000400l - -/* - * Uses the dwDDFX field in the DDBLTFX structure to specify the effects - * to use for the blt. - */ -#define DDBLT_DDFX 0x00000800l - -/* - * Uses the dwDDROPS field in the DDBLTFX structure to specify the ROPS - * that are not part of the Win32 API. - */ -#define DDBLT_DDROPS 0x00001000l - -/* - * Use the color key associated with the destination surface. - */ -#define DDBLT_KEYDEST 0x00002000l - -/* - * Use the dckDestColorkey field in the DDBLTFX structure as the color key - * for the destination surface. - */ -#define DDBLT_KEYDESTOVERRIDE 0x00004000l - -/* - * Use the color key associated with the source surface. - */ -#define DDBLT_KEYSRC 0x00008000l - -/* - * Use the dckSrcColorkey field in the DDBLTFX structure as the color key - * for the source surface. - */ -#define DDBLT_KEYSRCOVERRIDE 0x00010000l - -/* - * Use the dwROP field in the DDBLTFX structure for the raster operation - * for this blt. These ROPs are the same as the ones defined in the Win32 API. - */ -#define DDBLT_ROP 0x00020000l - -/* - * Use the dwRotationAngle field in the DDBLTFX structure as the angle - * (specified in 1/100th of a degree) to rotate the surface. - */ -#define DDBLT_ROTATIONANGLE 0x00040000l - -/* - * Z-buffered blt using the z-buffers attached to the source and destination - * surfaces and the dwZBufferOpCode field in the DDBLTFX structure as the - * z-buffer opcode. - */ -#define DDBLT_ZBUFFER 0x00080000l - -/* - * Z-buffered blt using the dwConstDest Zfield and the dwZBufferOpCode field - * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively - * for the destination. - */ -#define DDBLT_ZBUFFERDESTCONSTOVERRIDE 0x00100000l - -/* - * Z-buffered blt using the lpDDSDestZBuffer field and the dwZBufferOpCode - * field in the DDBLTFX structure as the z-buffer and z-buffer opcode - * respectively for the destination. - */ -#define DDBLT_ZBUFFERDESTOVERRIDE 0x00200000l - -/* - * Z-buffered blt using the dwConstSrcZ field and the dwZBufferOpCode field - * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively - * for the source. - */ -#define DDBLT_ZBUFFERSRCCONSTOVERRIDE 0x00400000l - -/* - * Z-buffered blt using the lpDDSSrcZBuffer field and the dwZBufferOpCode - * field in the DDBLTFX structure as the z-buffer and z-buffer opcode - * respectively for the source. - */ -#define DDBLT_ZBUFFERSRCOVERRIDE 0x00800000l - -/* - * wait until the device is ready to handle the blt - * this will cause blt to not return DDERR_WASSTILLDRAWING - */ -#define DDBLT_WAIT 0x01000000l - -/* - * Uses the dwFillDepth field in the DDBLTFX structure as the depth value - * to fill the destination rectangle on the destination Z-buffer surface - * with. - */ -#define DDBLT_DEPTHFILL 0x02000000l - - - -/**************************************************************************** - * - * BLTFAST FLAGS - * - ****************************************************************************/ - -#define DDBLTFAST_NOCOLORKEY 0x00000000 -#define DDBLTFAST_SRCCOLORKEY 0x00000001 -#define DDBLTFAST_DESTCOLORKEY 0x00000002 -#define DDBLTFAST_WAIT 0x00000010 - -/**************************************************************************** - * - * FLIP FLAGS - * - ****************************************************************************/ - -#define DDFLIP_WAIT 0x00000001l - -/* - * Indicates that the target surface contains the even field of video data. - * This flag is only valid with an overlay surface. - */ -#define DDFLIP_EVEN 0x00000002l - -/* - * Indicates that the target surface contains the odd field of video data. - * This flag is only valid with an overlay surface. - */ -#define DDFLIP_ODD 0x00000004l - - - -/**************************************************************************** - * - * DIRECTDRAW SURFACE OVERLAY FLAGS - * - ****************************************************************************/ - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the destination surface as the alpha channel for the - * destination overlay. - */ -#define DDOVER_ALPHADEST 0x00000001l - -/* - * Use the dwConstAlphaDest field in the DDOVERLAYFX structure as the - * destination alpha channel for this overlay. - */ -#define DDOVER_ALPHADESTCONSTOVERRIDE 0x00000002l - -/* - * The NEG suffix indicates that the destination surface becomes more - * transparent as the alpha value increases. - */ -#define DDOVER_ALPHADESTNEG 0x00000004l - -/* - * Use the lpDDSAlphaDest field in the DDOVERLAYFX structure as the alpha - * channel destination for this overlay. - */ -#define DDOVER_ALPHADESTSURFACEOVERRIDE 0x00000008l - -/* - * Use the dwAlphaEdgeBlend field in the DDOVERLAYFX structure as the alpha - * channel for the edges of the image that border the color key colors. - */ -#define DDOVER_ALPHAEDGEBLEND 0x00000010l - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the source surface as the source alpha channel for this overlay. - */ -#define DDOVER_ALPHASRC 0x00000020l - -/* - * Use the dwConstAlphaSrc field in the DDOVERLAYFX structure as the source - * alpha channel for this overlay. - */ -#define DDOVER_ALPHASRCCONSTOVERRIDE 0x00000040l - -/* - * The NEG suffix indicates that the source surface becomes more transparent - * as the alpha value increases. - */ -#define DDOVER_ALPHASRCNEG 0x00000080l - -/* - * Use the lpDDSAlphaSrc field in the DDOVERLAYFX structure as the alpha channel - * source for this overlay. - */ -#define DDOVER_ALPHASRCSURFACEOVERRIDE 0x00000100l - -/* - * Turn this overlay off. - */ -#define DDOVER_HIDE 0x00000200l - -/* - * Use the color key associated with the destination surface. - */ -#define DDOVER_KEYDEST 0x00000400l - -/* - * Use the dckDestColorkey field in the DDOVERLAYFX structure as the color key - * for the destination surface - */ -#define DDOVER_KEYDESTOVERRIDE 0x00000800l - -/* - * Use the color key associated with the source surface. - */ -#define DDOVER_KEYSRC 0x00001000l - -/* - * Use the dckSrcColorkey field in the DDOVERLAYFX structure as the color key - * for the source surface. - */ -#define DDOVER_KEYSRCOVERRIDE 0x00002000l - -/* - * Turn this overlay on. - */ -#define DDOVER_SHOW 0x00004000l - -/* - * Add a dirty rect to an emulated overlayed surface. - */ -#define DDOVER_ADDDIRTYRECT 0x00008000l - -/* - * Redraw all dirty rects on an emulated overlayed surface. - */ -#define DDOVER_REFRESHDIRTYRECTS 0x00010000l - -/* - * Redraw the entire surface on an emulated overlayed surface. - */ -#define DDOVER_REFRESHALL 0x00020000l - - -/* - * Use the overlay FX flags to define special overlay FX - */ -#define DDOVER_DDFX 0x00080000l - -/* - * Autoflip the overlay when ever the video port autoflips - */ -#define DDOVER_AUTOFLIP 0x00100000l - -/* - * Display each field of video port data individually without - * causing any jittery artifacts - */ -#define DDOVER_BOB 0x00200000l - -/* - * Indicates that bob/weave decisions should not be overridden by other - * interfaces. - */ -#define DDOVER_OVERRIDEBOBWEAVE 0x00400000l - -/* - * Indicates that the surface memory is composed of interleaved fields. - */ -#define DDOVER_INTERLEAVED 0x00800000l - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE LOCK FLAGS - * - ****************************************************************************/ - -/* - * The default. Set to indicate that Lock should return a valid memory pointer - * to the top of the specified rectangle. If no rectangle is specified then a - * pointer to the top of the surface is returned. - */ -#define DDLOCK_SURFACEMEMORYPTR 0x00000000L // default - -/* - * Set to indicate that Lock should wait until it can obtain a valid memory - * pointer before returning. If this bit is set, Lock will never return - * DDERR_WASSTILLDRAWING. - */ -#define DDLOCK_WAIT 0x00000001L - -/* - * Set if an event handle is being passed to Lock. Lock will trigger the event - * when it can return the surface memory pointer requested. - */ -#define DDLOCK_EVENT 0x00000002L - -/* - * Indicates that the surface being locked will only be read from. - */ -#define DDLOCK_READONLY 0x00000010L - -/* - * Indicates that the surface being locked will only be written to - */ -#define DDLOCK_WRITEONLY 0x00000020L - - -/* - * Indicates that a system wide lock should not be taken when this surface - * is locked. This has several advantages (cursor responsiveness, ability - * to call more Windows functions, easier debugging) when locking video - * memory surfaces. However, an application specifying this flag must - * comply with a number of conditions documented in the help file. - * Furthermore, this flag cannot be specified when locking the primary. - */ -#define DDLOCK_NOSYSLOCK 0x00000800L - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE PAGELOCK FLAGS - * - ****************************************************************************/ - -/* - * No flags defined at present - */ - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE PAGEUNLOCK FLAGS - * - ****************************************************************************/ - -/* - * No flags defined at present - */ - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE BLT FX FLAGS - * - ****************************************************************************/ - -/* - * If stretching, use arithmetic stretching along the Y axis for this blt. - */ -#define DDBLTFX_ARITHSTRETCHY 0x00000001l - -/* - * Do this blt mirroring the surface left to right. Spin the - * surface around its y-axis. - */ -#define DDBLTFX_MIRRORLEFTRIGHT 0x00000002l - -/* - * Do this blt mirroring the surface up and down. Spin the surface - * around its x-axis. - */ -#define DDBLTFX_MIRRORUPDOWN 0x00000004l - -/* - * Schedule this blt to avoid tearing. - */ -#define DDBLTFX_NOTEARING 0x00000008l - -/* - * Do this blt rotating the surface one hundred and eighty degrees. - */ -#define DDBLTFX_ROTATE180 0x00000010l - -/* - * Do this blt rotating the surface two hundred and seventy degrees. - */ -#define DDBLTFX_ROTATE270 0x00000020l - -/* - * Do this blt rotating the surface ninety degrees. - */ -#define DDBLTFX_ROTATE90 0x00000040l - -/* - * Do this z blt using dwZBufferLow and dwZBufferHigh as range values - * specified to limit the bits copied from the source surface. - */ -#define DDBLTFX_ZBUFFERRANGE 0x00000080l - -/* - * Do this z blt adding the dwZBufferBaseDest to each of the sources z values - * before comparing it with the desting z values. - */ -#define DDBLTFX_ZBUFFERBASEDEST 0x00000100l - -/**************************************************************************** - * - * DIRECTDRAWSURFACE OVERLAY FX FLAGS - * - ****************************************************************************/ - -/* - * If stretching, use arithmetic stretching along the Y axis for this overlay. - */ -#define DDOVERFX_ARITHSTRETCHY 0x00000001l - -/* - * Mirror the overlay across the vertical axis - */ -#define DDOVERFX_MIRRORLEFTRIGHT 0x00000002l - -/* - * Mirror the overlay across the horizontal axis - */ -#define DDOVERFX_MIRRORUPDOWN 0x00000004l - -/**************************************************************************** - * - * DIRECTDRAW WAITFORVERTICALBLANK FLAGS - * - ****************************************************************************/ - -/* - * return when the vertical blank interval begins - */ -#define DDWAITVB_BLOCKBEGIN 0x00000001l - -/* - * set up an event to trigger when the vertical blank begins - */ -#define DDWAITVB_BLOCKBEGINEVENT 0x00000002l - -/* - * return when the vertical blank interval ends and display begins - */ -#define DDWAITVB_BLOCKEND 0x00000004l - -/**************************************************************************** - * - * DIRECTDRAW GETFLIPSTATUS FLAGS - * - ****************************************************************************/ - -/* - * is it OK to flip now? - */ -#define DDGFS_CANFLIP 0x00000001l - -/* - * is the last flip finished? - */ -#define DDGFS_ISFLIPDONE 0x00000002l - -/**************************************************************************** - * - * DIRECTDRAW GETBLTSTATUS FLAGS - * - ****************************************************************************/ - -/* - * is it OK to blt now? - */ -#define DDGBS_CANBLT 0x00000001l - -/* - * is the blt to the surface finished? - */ -#define DDGBS_ISBLTDONE 0x00000002l - - -/**************************************************************************** - * - * DIRECTDRAW ENUMOVERLAYZORDER FLAGS - * - ****************************************************************************/ - -/* - * Enumerate overlays back to front. - */ -#define DDENUMOVERLAYZ_BACKTOFRONT 0x00000000l - -/* - * Enumerate overlays front to back - */ -#define DDENUMOVERLAYZ_FRONTTOBACK 0x00000001l - -/**************************************************************************** - * - * DIRECTDRAW UPDATEOVERLAYZORDER FLAGS - * - ****************************************************************************/ - -/* - * Send overlay to front - */ -#define DDOVERZ_SENDTOFRONT 0x00000000l - -/* - * Send overlay to back - */ -#define DDOVERZ_SENDTOBACK 0x00000001l - -/* - * Move Overlay forward - */ -#define DDOVERZ_MOVEFORWARD 0x00000002l - -/* - * Move Overlay backward - */ -#define DDOVERZ_MOVEBACKWARD 0x00000003l - -/* - * Move Overlay in front of relative surface - */ -#define DDOVERZ_INSERTINFRONTOF 0x00000004l - -/* - * Move Overlay in back of relative surface - */ -#define DDOVERZ_INSERTINBACKOF 0x00000005l - -/*=========================================================================== - * - * - * DIRECTDRAW RETURN CODES - * - * The return values from DirectDraw Commands and Surface that return an HRESULT - * are codes from DirectDraw concerning the results of the action - * requested by DirectDraw. - * - *==========================================================================*/ - -/* - * Status is OK - * - * Issued by: DirectDraw Commands and all callbacks - */ -#define DD_OK 0 - -/**************************************************************************** - * - * DIRECTDRAW ENUMCALLBACK RETURN VALUES - * - * EnumCallback returns are used to control the flow of the DIRECTDRAW and - * DIRECTDRAWSURFACE object enumerations. They can only be returned by - * enumeration callback routines. - * - ****************************************************************************/ - -/* - * stop the enumeration - */ -#define DDENUMRET_CANCEL 0 - -/* - * continue the enumeration - */ -#define DDENUMRET_OK 1 - -/**************************************************************************** - * - * DIRECTDRAW ERRORS - * - * Errors are represented by negative values and cannot be combined. - * - ****************************************************************************/ - -/* - * This object is already initialized - */ -#define DDERR_ALREADYINITIALIZED MAKE_DDHRESULT( 5 ) - -/* - * This surface can not be attached to the requested surface. - */ -#define DDERR_CANNOTATTACHSURFACE MAKE_DDHRESULT( 10 ) - -/* - * This surface can not be detached from the requested surface. - */ -#define DDERR_CANNOTDETACHSURFACE MAKE_DDHRESULT( 20 ) - -/* - * Support is currently not available. - */ -#define DDERR_CURRENTLYNOTAVAIL MAKE_DDHRESULT( 40 ) - -/* - * An exception was encountered while performing the requested operation - */ -#define DDERR_EXCEPTION MAKE_DDHRESULT( 55 ) - -/* - * Generic failure. - */ -#define DDERR_GENERIC E_FAIL - -/* - * Height of rectangle provided is not a multiple of reqd alignment - */ -#define DDERR_HEIGHTALIGN MAKE_DDHRESULT( 90 ) - -/* - * Unable to match primary surface creation request with existing - * primary surface. - */ -#define DDERR_INCOMPATIBLEPRIMARY MAKE_DDHRESULT( 95 ) - -/* - * One or more of the caps bits passed to the callback are incorrect. - */ -#define DDERR_INVALIDCAPS MAKE_DDHRESULT( 100 ) - -/* - * DirectDraw does not support provided Cliplist. - */ -#define DDERR_INVALIDCLIPLIST MAKE_DDHRESULT( 110 ) - -/* - * DirectDraw does not support the requested mode - */ -#define DDERR_INVALIDMODE MAKE_DDHRESULT( 120 ) - -/* - * DirectDraw received a pointer that was an invalid DIRECTDRAW object. - */ -#define DDERR_INVALIDOBJECT MAKE_DDHRESULT( 130 ) - -/* - * One or more of the parameters passed to the callback function are - * incorrect. - */ -#define DDERR_INVALIDPARAMS E_INVALIDARG - -/* - * pixel format was invalid as specified - */ -#define DDERR_INVALIDPIXELFORMAT MAKE_DDHRESULT( 145 ) - -/* - * Rectangle provided was invalid. - */ -#define DDERR_INVALIDRECT MAKE_DDHRESULT( 150 ) - -/* - * Operation could not be carried out because one or more surfaces are locked - */ -#define DDERR_LOCKEDSURFACES MAKE_DDHRESULT( 160 ) - -/* - * There is no 3D present. - */ -#define DDERR_NO3D MAKE_DDHRESULT( 170 ) - -/* - * Operation could not be carried out because there is no alpha accleration - * hardware present or available. - */ -#define DDERR_NOALPHAHW MAKE_DDHRESULT( 180 ) - - -/* - * no clip list available - */ -#define DDERR_NOCLIPLIST MAKE_DDHRESULT( 205 ) - -/* - * Operation could not be carried out because there is no color conversion - * hardware present or available. - */ -#define DDERR_NOCOLORCONVHW MAKE_DDHRESULT( 210 ) - -/* - * Create function called without DirectDraw object method SetCooperativeLevel - * being called. - */ -#define DDERR_NOCOOPERATIVELEVELSET MAKE_DDHRESULT( 212 ) - -/* - * Surface doesn't currently have a color key - */ -#define DDERR_NOCOLORKEY MAKE_DDHRESULT( 215 ) - -/* - * Operation could not be carried out because there is no hardware support - * of the dest color key. - */ -#define DDERR_NOCOLORKEYHW MAKE_DDHRESULT( 220 ) - -/* - * No DirectDraw support possible with current display driver - */ -#define DDERR_NODIRECTDRAWSUPPORT MAKE_DDHRESULT( 222 ) - -/* - * Operation requires the application to have exclusive mode but the - * application does not have exclusive mode. - */ -#define DDERR_NOEXCLUSIVEMODE MAKE_DDHRESULT( 225 ) - -/* - * Flipping visible surfaces is not supported. - */ -#define DDERR_NOFLIPHW MAKE_DDHRESULT( 230 ) - -/* - * There is no GDI present. - */ -#define DDERR_NOGDI MAKE_DDHRESULT( 240 ) - -/* - * Operation could not be carried out because there is no hardware present - * or available. - */ -#define DDERR_NOMIRRORHW MAKE_DDHRESULT( 250 ) - -/* - * Requested item was not found - */ -#define DDERR_NOTFOUND MAKE_DDHRESULT( 255 ) - -/* - * Operation could not be carried out because there is no overlay hardware - * present or available. - */ -#define DDERR_NOOVERLAYHW MAKE_DDHRESULT( 260 ) - -/* - * Operation could not be carried out because there is no appropriate raster - * op hardware present or available. - */ -#define DDERR_NORASTEROPHW MAKE_DDHRESULT( 280 ) - -/* - * Operation could not be carried out because there is no rotation hardware - * present or available. - */ -#define DDERR_NOROTATIONHW MAKE_DDHRESULT( 290 ) - -/* - * Operation could not be carried out because there is no hardware support - * for stretching - */ -#define DDERR_NOSTRETCHHW MAKE_DDHRESULT( 310 ) - -/* - * DirectDrawSurface is not in 4 bit color palette and the requested operation - * requires 4 bit color palette. - */ -#define DDERR_NOT4BITCOLOR MAKE_DDHRESULT( 316 ) - -/* - * DirectDrawSurface is not in 4 bit color index palette and the requested - * operation requires 4 bit color index palette. - */ -#define DDERR_NOT4BITCOLORINDEX MAKE_DDHRESULT( 317 ) - -/* - * DirectDraw Surface is not in 8 bit color mode and the requested operation - * requires 8 bit color. - */ -#define DDERR_NOT8BITCOLOR MAKE_DDHRESULT( 320 ) - -/* - * Operation could not be carried out because there is no texture mapping - * hardware present or available. - */ -#define DDERR_NOTEXTUREHW MAKE_DDHRESULT( 330 ) - -/* - * Operation could not be carried out because there is no hardware support - * for vertical blank synchronized operations. - */ -#define DDERR_NOVSYNCHW MAKE_DDHRESULT( 335 ) - -/* - * Operation could not be carried out because there is no hardware support - * for zbuffer blting. - */ -#define DDERR_NOZBUFFERHW MAKE_DDHRESULT( 340 ) - -/* - * Overlay surfaces could not be z layered based on their BltOrder because - * the hardware does not support z layering of overlays. - */ -#define DDERR_NOZOVERLAYHW MAKE_DDHRESULT( 350 ) - -/* - * The hardware needed for the requested operation has already been - * allocated. - */ -#define DDERR_OUTOFCAPS MAKE_DDHRESULT( 360 ) - -/* - * DirectDraw does not have enough memory to perform the operation. - */ -#define DDERR_OUTOFMEMORY E_OUTOFMEMORY - -/* - * DirectDraw does not have enough memory to perform the operation. - */ -#define DDERR_OUTOFVIDEOMEMORY MAKE_DDHRESULT( 380 ) - -/* - * hardware does not support clipped overlays - */ -#define DDERR_OVERLAYCANTCLIP MAKE_DDHRESULT( 382 ) - -/* - * Can only have ony color key active at one time for overlays - */ -#define DDERR_OVERLAYCOLORKEYONLYONEACTIVE MAKE_DDHRESULT( 384 ) - -/* - * Access to this palette is being refused because the palette is already - * locked by another thread. - */ -#define DDERR_PALETTEBUSY MAKE_DDHRESULT( 387 ) - -/* - * No src color key specified for this operation. - */ -#define DDERR_COLORKEYNOTSET MAKE_DDHRESULT( 400 ) - -/* - * This surface is already attached to the surface it is being attached to. - */ -#define DDERR_SURFACEALREADYATTACHED MAKE_DDHRESULT( 410 ) - -/* - * This surface is already a dependency of the surface it is being made a - * dependency of. - */ -#define DDERR_SURFACEALREADYDEPENDENT MAKE_DDHRESULT( 420 ) - -/* - * Access to this surface is being refused because the surface is already - * locked by another thread. - */ -#define DDERR_SURFACEBUSY MAKE_DDHRESULT( 430 ) - -/* - * Access to this surface is being refused because no driver exists - * which can supply a pointer to the surface. - * This is most likely to happen when attempting to lock the primary - * surface when no DCI provider is present. - * Will also happen on attempts to lock an optimized surface. - */ -#define DDERR_CANTLOCKSURFACE MAKE_DDHRESULT( 435 ) - -/* - * Access to Surface refused because Surface is obscured. - */ -#define DDERR_SURFACEISOBSCURED MAKE_DDHRESULT( 440 ) - -/* - * Access to this surface is being refused because the surface is gone. - * The DIRECTDRAWSURFACE object representing this surface should - * have Restore called on it. - */ -#define DDERR_SURFACELOST MAKE_DDHRESULT( 450 ) - -/* - * The requested surface is not attached. - */ -#define DDERR_SURFACENOTATTACHED MAKE_DDHRESULT( 460 ) - -/* - * Height requested by DirectDraw is too large. - */ -#define DDERR_TOOBIGHEIGHT MAKE_DDHRESULT( 470 ) - -/* - * Size requested by DirectDraw is too large -- The individual height and - * width are OK. - */ -#define DDERR_TOOBIGSIZE MAKE_DDHRESULT( 480 ) - -/* - * Width requested by DirectDraw is too large. - */ -#define DDERR_TOOBIGWIDTH MAKE_DDHRESULT( 490 ) - -/* - * Action not supported. - */ -#define DDERR_UNSUPPORTED E_NOTIMPL - -/* - * FOURCC format requested is unsupported by DirectDraw - */ -#define DDERR_UNSUPPORTEDFORMAT MAKE_DDHRESULT( 510 ) - -/* - * Bitmask in the pixel format requested is unsupported by DirectDraw - */ -#define DDERR_UNSUPPORTEDMASK MAKE_DDHRESULT( 520 ) - -/* - * vertical blank is in progress - */ -#define DDERR_VERTICALBLANKINPROGRESS MAKE_DDHRESULT( 537 ) - -/* - * Informs DirectDraw that the previous Blt which is transfering information - * to or from this Surface is incomplete. - */ -#define DDERR_WASSTILLDRAWING MAKE_DDHRESULT( 540 ) - - -/* - * Rectangle provided was not horizontally aligned on reqd. boundary - */ -#define DDERR_XALIGN MAKE_DDHRESULT( 560 ) - -/* - * The GUID passed to DirectDrawCreate is not a valid DirectDraw driver - * identifier. - */ -#define DDERR_INVALIDDIRECTDRAWGUID MAKE_DDHRESULT( 561 ) - -/* - * A DirectDraw object representing this driver has already been created - * for this process. - */ -#define DDERR_DIRECTDRAWALREADYCREATED MAKE_DDHRESULT( 562 ) - -/* - * A hardware only DirectDraw object creation was attempted but the driver - * did not support any hardware. - */ -#define DDERR_NODIRECTDRAWHW MAKE_DDHRESULT( 563 ) - -/* - * this process already has created a primary surface - */ -#define DDERR_PRIMARYSURFACEALREADYEXISTS MAKE_DDHRESULT( 564 ) - -/* - * software emulation not available. - */ -#define DDERR_NOEMULATION MAKE_DDHRESULT( 565 ) - -/* - * region passed to Clipper::GetClipList is too small. - */ -#define DDERR_REGIONTOOSMALL MAKE_DDHRESULT( 566 ) - -/* - * an attempt was made to set a clip list for a clipper objec that - * is already monitoring an hwnd. - */ -#define DDERR_CLIPPERISUSINGHWND MAKE_DDHRESULT( 567 ) - -/* - * No clipper object attached to surface object - */ -#define DDERR_NOCLIPPERATTACHED MAKE_DDHRESULT( 568 ) - -/* - * Clipper notification requires an HWND or - * no HWND has previously been set as the CooperativeLevel HWND. - */ -#define DDERR_NOHWND MAKE_DDHRESULT( 569 ) - -/* - * HWND used by DirectDraw CooperativeLevel has been subclassed, - * this prevents DirectDraw from restoring state. - */ -#define DDERR_HWNDSUBCLASSED MAKE_DDHRESULT( 570 ) - -/* - * The CooperativeLevel HWND has already been set. - * It can not be reset while the process has surfaces or palettes created. - */ -#define DDERR_HWNDALREADYSET MAKE_DDHRESULT( 571 ) - -/* - * No palette object attached to this surface. - */ -#define DDERR_NOPALETTEATTACHED MAKE_DDHRESULT( 572 ) - -/* - * No hardware support for 16 or 256 color palettes. - */ -#define DDERR_NOPALETTEHW MAKE_DDHRESULT( 573 ) - -/* - * If a clipper object is attached to the source surface passed into a - * BltFast call. - */ -#define DDERR_BLTFASTCANTCLIP MAKE_DDHRESULT( 574 ) - -/* - * No blter. - */ -#define DDERR_NOBLTHW MAKE_DDHRESULT( 575 ) - -/* - * No DirectDraw ROP hardware. - */ -#define DDERR_NODDROPSHW MAKE_DDHRESULT( 576 ) - -/* - * returned when GetOverlayPosition is called on a hidden overlay - */ -#define DDERR_OVERLAYNOTVISIBLE MAKE_DDHRESULT( 577 ) - -/* - * returned when GetOverlayPosition is called on a overlay that UpdateOverlay - * has never been called on to establish a destionation. - */ -#define DDERR_NOOVERLAYDEST MAKE_DDHRESULT( 578 ) - -/* - * returned when the position of the overlay on the destionation is no longer - * legal for that destionation. - */ -#define DDERR_INVALIDPOSITION MAKE_DDHRESULT( 579 ) - -/* - * returned when an overlay member is called for a non-overlay surface - */ -#define DDERR_NOTAOVERLAYSURFACE MAKE_DDHRESULT( 580 ) - -/* - * An attempt was made to set the cooperative level when it was already - * set to exclusive. - */ -#define DDERR_EXCLUSIVEMODEALREADYSET MAKE_DDHRESULT( 581 ) - -/* - * An attempt has been made to flip a surface that is not flippable. - */ -#define DDERR_NOTFLIPPABLE MAKE_DDHRESULT( 582 ) - -/* - * Can't duplicate primary & 3D surfaces, or surfaces that are implicitly - * created. - */ -#define DDERR_CANTDUPLICATE MAKE_DDHRESULT( 583 ) - -/* - * Surface was not locked. An attempt to unlock a surface that was not - * locked at all, or by this process, has been attempted. - */ -#define DDERR_NOTLOCKED MAKE_DDHRESULT( 584 ) - -/* - * Windows can not create any more DCs - */ -#define DDERR_CANTCREATEDC MAKE_DDHRESULT( 585 ) - -/* - * No DC was ever created for this surface. - */ -#define DDERR_NODC MAKE_DDHRESULT( 586 ) - -/* - * This surface can not be restored because it was created in a different - * mode. - */ -#define DDERR_WRONGMODE MAKE_DDHRESULT( 587 ) - -/* - * This surface can not be restored because it is an implicitly created - * surface. - */ -#define DDERR_IMPLICITLYCREATED MAKE_DDHRESULT( 588 ) - -/* - * The surface being used is not a palette-based surface - */ -#define DDERR_NOTPALETTIZED MAKE_DDHRESULT( 589 ) - - -/* - * The display is currently in an unsupported mode - */ -#define DDERR_UNSUPPORTEDMODE MAKE_DDHRESULT( 590 ) - -/* - * Operation could not be carried out because there is no mip-map - * texture mapping hardware present or available. - */ -#define DDERR_NOMIPMAPHW MAKE_DDHRESULT( 591 ) - -/* - * The requested action could not be performed because the surface was of - * the wrong type. - */ -#define DDERR_INVALIDSURFACETYPE MAKE_DDHRESULT( 592 ) - - - -/* - * Device does not support optimized surfaces, therefore no video memory optimized surfaces - */ -#define DDERR_NOOPTIMIZEHW MAKE_DDHRESULT( 600 ) - -/* - * Surface is an optimized surface, but has not yet been allocated any memory - */ -#define DDERR_NOTLOADED MAKE_DDHRESULT( 601 ) - -/* - * A DC has already been returned for this surface. Only one DC can be - * retrieved per surface. - */ -#define DDERR_DCALREADYCREATED MAKE_DDHRESULT( 620 ) - -/* - * An attempt was made to allocate non-local video memory from a device - * that does not support non-local video memory. - */ -#define DDERR_NONONLOCALVIDMEM MAKE_DDHRESULT( 630 ) - -/* - * The attempt to page lock a surface failed. - */ -#define DDERR_CANTPAGELOCK MAKE_DDHRESULT( 640 ) - -/* - * The attempt to page unlock a surface failed. - */ -#define DDERR_CANTPAGEUNLOCK MAKE_DDHRESULT( 660 ) - -/* - * An attempt was made to page unlock a surface with no outstanding page locks. - */ -#define DDERR_NOTPAGELOCKED MAKE_DDHRESULT( 680 ) - -/* - * There is more data available than the specified buffer size could hold - */ -#define DDERR_MOREDATA MAKE_DDHRESULT( 690 ) - -/* - * The video port is not active - */ -#define DDERR_VIDEONOTACTIVE MAKE_DDHRESULT( 695 ) - -/* - * Surfaces created by one direct draw device cannot be used directly by - * another direct draw device. - */ -#define DDERR_DEVICEDOESNTOWNSURFACE MAKE_DDHRESULT( 699 ) - - -/* - * An attempt was made to invoke an interface member of a DirectDraw object - * created by CoCreateInstance() before it was initialized. - */ -#define DDERR_NOTINITIALIZED CO_E_NOTINITIALIZED - -/* Alpha bit depth constants */ - - -#ifdef __cplusplus -}; -#endif - -#endif - diff --git a/include/vdinput.h b/include/vdinput.h deleted file mode 100644 index f53b7b7..0000000 --- a/include/vdinput.h +++ /dev/null @@ -1,1850 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved. - * - * File: dinput.h - * Content: DirectInput include file - * - ****************************************************************************/ - -#ifndef __DINPUT_INCLUDED__ -#define __DINPUT_INCLUDED__ - -#ifndef DIJ_RINGZERO - -#ifdef _WIN32 -#define COM_NO_WINDOWS_H -#include -#endif - -#endif /* DIJ_RINGZERO */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef DIRECTINPUT_VERSION -#define DIRECTINPUT_VERSION 0x0500 -#endif - -#ifndef DIJ_RINGZERO -/**************************************************************************** - * - * Class IDs - * - ****************************************************************************/ - -DEFINE_GUID(CLSID_DirectInput, 0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(CLSID_DirectInputDevice,0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); - -/**************************************************************************** - * - * Interfaces - * - ****************************************************************************/ - -DEFINE_GUID(IID_IDirectInputA, 0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(IID_IDirectInputW, 0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(IID_IDirectInput2A, 0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(IID_IDirectInput2W, 0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); - -DEFINE_GUID(IID_IDirectInputDeviceA, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(IID_IDirectInputDeviceW, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(IID_IDirectInputDevice2A,0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(IID_IDirectInputDevice2W,0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); - -DEFINE_GUID(IID_IDirectInputEffect, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); - -/**************************************************************************** - * - * Predefined object types - * - ****************************************************************************/ - -DEFINE_GUID(GUID_XAxis, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_YAxis, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_ZAxis, 0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_RxAxis, 0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_RyAxis, 0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_RzAxis, 0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_Slider, 0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); - -DEFINE_GUID(GUID_Button, 0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_Key, 0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); - -DEFINE_GUID(GUID_POV, 0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); - -DEFINE_GUID(GUID_Unknown, 0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); - -/**************************************************************************** - * - * Predefined product GUIDs - * - ****************************************************************************/ - -DEFINE_GUID(GUID_SysMouse, 0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_SysKeyboard,0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_Joystick ,0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); - -/**************************************************************************** - * - * Predefined force feedback effects - * - ****************************************************************************/ - -DEFINE_GUID(GUID_ConstantForce,0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_RampForce, 0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_Square, 0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_Sine, 0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_Triangle, 0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_SawtoothUp, 0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_SawtoothDown, 0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_Spring, 0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_Damper, 0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_Inertia, 0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_Friction, 0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_CustomForce, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); - - -#endif /* DIJ_RINGZERO */ - -/**************************************************************************** - * - * Interfaces and Structures... - * - ****************************************************************************/ - -#if(DIRECTINPUT_VERSION >= 0x0500) - -/**************************************************************************** - * - * IDirectInputEffect - * - ****************************************************************************/ - -#define DIEFT_ALL 0x00000000 - -#define DIEFT_CONSTANTFORCE 0x00000001 -#define DIEFT_RAMPFORCE 0x00000002 -#define DIEFT_PERIODIC 0x00000003 -#define DIEFT_CONDITION 0x00000004 -#define DIEFT_CUSTOMFORCE 0x00000005 -#define DIEFT_HARDWARE 0x000000FF - -#define DIEFT_FFATTACK 0x00000200 -#define DIEFT_FFFADE 0x00000400 -#define DIEFT_SATURATION 0x00000800 -#define DIEFT_POSNEGCOEFFICIENTS 0x00001000 -#define DIEFT_POSNEGSATURATION 0x00002000 -#define DIEFT_DEADBAND 0x00004000 - -#define DIEFT_GETTYPE(n) LOBYTE(n) - -#define DI_DEGREES 100 -#define DI_FFNOMINALMAX 10000 -#define DI_SECONDS 1000000 - -typedef struct DICONSTANTFORCE { - LONG lMagnitude; -} DICONSTANTFORCE, *LPDICONSTANTFORCE; -typedef const DICONSTANTFORCE *LPCDICONSTANTFORCE; - -typedef struct DIRAMPFORCE { - LONG lStart; - LONG lEnd; -} DIRAMPFORCE, *LPDIRAMPFORCE; -typedef const DIRAMPFORCE *LPCDIRAMPFORCE; - -typedef struct DIPERIODIC { - DWORD dwMagnitude; - LONG lOffset; - DWORD dwPhase; - DWORD dwPeriod; -} DIPERIODIC, *LPDIPERIODIC; -typedef const DIPERIODIC *LPCDIPERIODIC; - -typedef struct DICONDITION { - LONG lOffset; - LONG lPositiveCoefficient; - LONG lNegativeCoefficient; - DWORD dwPositiveSaturation; - DWORD dwNegativeSaturation; - LONG lDeadBand; -} DICONDITION, *LPDICONDITION; -typedef const DICONDITION *LPCDICONDITION; - -typedef struct DICUSTOMFORCE { - DWORD cChannels; - DWORD dwSamplePeriod; - DWORD cSamples; - LPLONG rglForceData; -} DICUSTOMFORCE, *LPDICUSTOMFORCE; -typedef const DICUSTOMFORCE *LPCDICUSTOMFORCE; - -typedef struct DIENVELOPE { - DWORD dwSize; /* sizeof(DIENVELOPE) */ - DWORD dwAttackLevel; - DWORD dwAttackTime; /* Microseconds */ - DWORD dwFadeLevel; - DWORD dwFadeTime; /* Microseconds */ -} DIENVELOPE, *LPDIENVELOPE; -typedef const DIENVELOPE *LPCDIENVELOPE; - -typedef struct DIEFFECT { - DWORD dwSize; /* sizeof(DIEFFECT) */ - DWORD dwFlags; /* DIEFF_* */ - DWORD dwDuration; /* Microseconds */ - DWORD dwSamplePeriod; /* Microseconds */ - DWORD dwGain; - DWORD dwTriggerButton; /* or DIEB_NOTRIGGER */ - DWORD dwTriggerRepeatInterval; /* Microseconds */ - DWORD cAxes; /* Number of axes */ - LPDWORD rgdwAxes; /* Array of axes */ - LPLONG rglDirection; /* Array of directions */ - LPDIENVELOPE lpEnvelope; /* Optional */ - DWORD cbTypeSpecificParams; /* Size of params */ - LPVOID lpvTypeSpecificParams; /* Pointer to params */ -} DIEFFECT, *LPDIEFFECT; -typedef const DIEFFECT *LPCDIEFFECT; - -#define DIEFF_OBJECTIDS 0x00000001 -#define DIEFF_OBJECTOFFSETS 0x00000002 -#define DIEFF_CARTESIAN 0x00000010 -#define DIEFF_POLAR 0x00000020 -#define DIEFF_SPHERICAL 0x00000040 - -#define DIEP_DURATION 0x00000001 -#define DIEP_SAMPLEPERIOD 0x00000002 -#define DIEP_GAIN 0x00000004 -#define DIEP_TRIGGERBUTTON 0x00000008 -#define DIEP_TRIGGERREPEATINTERVAL 0x00000010 -#define DIEP_AXES 0x00000020 -#define DIEP_DIRECTION 0x00000040 -#define DIEP_ENVELOPE 0x00000080 -#define DIEP_TYPESPECIFICPARAMS 0x00000100 -#define DIEP_ALLPARAMS 0x000001FF -#define DIEP_START 0x20000000 -#define DIEP_NORESTART 0x40000000 -#define DIEP_NODOWNLOAD 0x80000000 -#define DIEB_NOTRIGGER 0xFFFFFFFF - -#define DIES_SOLO 0x00000001 -#define DIES_NODOWNLOAD 0x80000000 - -#define DIEGES_PLAYING 0x00000001 -#define DIEGES_EMULATED 0x00000002 - -typedef struct DIEFFESCAPE { - DWORD dwSize; - DWORD dwCommand; - LPVOID lpvInBuffer; - DWORD cbInBuffer; - LPVOID lpvOutBuffer; - DWORD cbOutBuffer; -} DIEFFESCAPE, *LPDIEFFESCAPE; - -#ifndef DIJ_RINGZERO - -#undef INTERFACE -#define INTERFACE IDirectInputEffect - -DECLARE_INTERFACE_(IDirectInputEffect, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirectInputEffect methods ***/ - STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; - STDMETHOD(GetEffectGuid)(THIS_ LPGUID) PURE; - STDMETHOD(GetParameters)(THIS_ LPDIEFFECT,DWORD) PURE; - STDMETHOD(SetParameters)(THIS_ LPCDIEFFECT,DWORD) PURE; - STDMETHOD(Start)(THIS_ DWORD,DWORD) PURE; - STDMETHOD(Stop)(THIS) PURE; - STDMETHOD(GetEffectStatus)(THIS_ LPDWORD) PURE; - STDMETHOD(Download)(THIS) PURE; - STDMETHOD(Unload)(THIS) PURE; - STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; -}; - -typedef struct IDirectInputEffect *LPDIRECTINPUTEFFECT; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectInputEffect_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectInputEffect_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectInputEffect_Release(p) (p)->lpVtbl->Release(p) -#define IDirectInputEffect_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) -#define IDirectInputEffect_GetEffectGuid(p,a) (p)->lpVtbl->GetEffectGuid(p,a) -#define IDirectInputEffect_GetParameters(p,a,b) (p)->lpVtbl->GetParameters(p,a,b) -#define IDirectInputEffect_SetParameters(p,a,b) (p)->lpVtbl->SetParameters(p,a,b) -#define IDirectInputEffect_Start(p,a,b) (p)->lpVtbl->Start(p,a,b) -#define IDirectInputEffect_Stop(p) (p)->lpVtbl->Stop(p) -#define IDirectInputEffect_GetEffectStatus(p,a) (p)->lpVtbl->GetEffectStatus(p,a) -#define IDirectInputEffect_Download(p) (p)->lpVtbl->Download(p) -#define IDirectInputEffect_Unload(p) (p)->lpVtbl->Unload(p) -#define IDirectInputEffect_Escape(p,a) (p)->lpVtbl->Escape(p,a) -#else -#define IDirectInputEffect_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectInputEffect_AddRef(p) (p)->AddRef() -#define IDirectInputEffect_Release(p) (p)->Release() -#define IDirectInputEffect_Initialize(p,a,b,c) (p)->Initialize(a,b,c) -#define IDirectInputEffect_GetEffectGuid(p,a) (p)->GetEffectGuid(a) -#define IDirectInputEffect_GetParameters(p,a,b) (p)->GetParameters(a,b) -#define IDirectInputEffect_SetParameters(p,a,b) (p)->SetParameters(a,b) -#define IDirectInputEffect_Start(p,a,b) (p)->Start(a,b) -#define IDirectInputEffect_Stop(p) (p)->Stop() -#define IDirectInputEffect_GetEffectStatus(p,a) (p)->GetEffectStatus(a) -#define IDirectInputEffect_Download(p) (p)->Download() -#define IDirectInputEffect_Unload(p) (p)->Unload() -#define IDirectInputEffect_Escape(p,a) (p)->Escape(a) -#endif - -#endif /* DIJ_RINGZERO */ - -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ - -/**************************************************************************** - * - * IDirectInputDevice - * - ****************************************************************************/ - -#define DIDEVTYPE_DEVICE 1 -#define DIDEVTYPE_MOUSE 2 -#define DIDEVTYPE_KEYBOARD 3 -#define DIDEVTYPE_JOYSTICK 4 -#define DIDEVTYPE_HID 0x00010000 - -#define DIDEVTYPEMOUSE_UNKNOWN 1 -#define DIDEVTYPEMOUSE_TRADITIONAL 2 -#define DIDEVTYPEMOUSE_FINGERSTICK 3 -#define DIDEVTYPEMOUSE_TOUCHPAD 4 -#define DIDEVTYPEMOUSE_TRACKBALL 5 - -#define DIDEVTYPEKEYBOARD_UNKNOWN 0 -#define DIDEVTYPEKEYBOARD_PCXT 1 -#define DIDEVTYPEKEYBOARD_OLIVETTI 2 -#define DIDEVTYPEKEYBOARD_PCAT 3 -#define DIDEVTYPEKEYBOARD_PCENH 4 -#define DIDEVTYPEKEYBOARD_NOKIA1050 5 -#define DIDEVTYPEKEYBOARD_NOKIA9140 6 -#define DIDEVTYPEKEYBOARD_NEC98 7 -#define DIDEVTYPEKEYBOARD_NEC98LAPTOP 8 -#define DIDEVTYPEKEYBOARD_NEC98106 9 -#define DIDEVTYPEKEYBOARD_JAPAN106 10 -#define DIDEVTYPEKEYBOARD_JAPANAX 11 -#define DIDEVTYPEKEYBOARD_J3100 12 - -#define DIDEVTYPEJOYSTICK_UNKNOWN 1 -#define DIDEVTYPEJOYSTICK_TRADITIONAL 2 -#define DIDEVTYPEJOYSTICK_FLIGHTSTICK 3 -#define DIDEVTYPEJOYSTICK_GAMEPAD 4 -#define DIDEVTYPEJOYSTICK_RUDDER 5 -#define DIDEVTYPEJOYSTICK_WHEEL 6 -#define DIDEVTYPEJOYSTICK_HEADTRACKER 7 - -#define GET_DIDEVICE_TYPE(dwDevType) LOBYTE(dwDevType) -#define GET_DIDEVICE_SUBTYPE(dwDevType) HIBYTE(dwDevType) - -#if(DIRECTINPUT_VERSION >= 0x0500) -/* This structure is defined for DirectX 3.0 compatibility */ - -typedef struct DIDEVCAPS_DX3 { - DWORD dwSize; - DWORD dwFlags; - DWORD dwDevType; - DWORD dwAxes; - DWORD dwButtons; - DWORD dwPOVs; -} DIDEVCAPS_DX3, *LPDIDEVCAPS_DX3; -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ - -typedef struct DIDEVCAPS { - DWORD dwSize; - DWORD dwFlags; - DWORD dwDevType; - DWORD dwAxes; - DWORD dwButtons; - DWORD dwPOVs; -#if(DIRECTINPUT_VERSION >= 0x0500) - DWORD dwFFSamplePeriod; - DWORD dwFFMinTimeResolution; - DWORD dwFirmwareRevision; - DWORD dwHardwareRevision; - DWORD dwFFDriverVersion; -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ -} DIDEVCAPS, *LPDIDEVCAPS; - -#define DIDC_ATTACHED 0x00000001 -#define DIDC_POLLEDDEVICE 0x00000002 -#define DIDC_EMULATED 0x00000004 -#define DIDC_POLLEDDATAFORMAT 0x00000008 -#if(DIRECTINPUT_VERSION >= 0x0500) -#define DIDC_FORCEFEEDBACK 0x00000100 -#define DIDC_FFATTACK 0x00000200 -#define DIDC_FFFADE 0x00000400 -#define DIDC_SATURATION 0x00000800 -#define DIDC_POSNEGCOEFFICIENTS 0x00001000 -#define DIDC_POSNEGSATURATION 0x00002000 -#define DIDC_DEADBAND 0x00004000 -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ - -#define DIDFT_ALL 0x00000000 - -#define DIDFT_RELAXIS 0x00000001 -#define DIDFT_ABSAXIS 0x00000002 -#define DIDFT_AXIS 0x00000003 - -#define DIDFT_PSHBUTTON 0x00000004 -#define DIDFT_TGLBUTTON 0x00000008 -#define DIDFT_BUTTON 0x0000000C - -#define DIDFT_POV 0x00000010 - -#define DIDFT_COLLECTION 0x00000040 -#define DIDFT_NODATA 0x00000080 - -#define DIDFT_ANYINSTANCE 0x00FFFF00 -#define DIDFT_INSTANCEMASK DIDFT_ANYINSTANCE -#define DIDFT_MAKEINSTANCE(n) ((WORD)(n) << 8) -#define DIDFT_GETTYPE(n) LOBYTE(n) -#define DIDFT_GETINSTANCE(n) LOWORD((n) >> 8) -#define DIDFT_FFACTUATOR 0x01000000 -#define DIDFT_FFEFFECTTRIGGER 0x02000000 - -#define DIDFT_ENUMCOLLECTION(n) ((WORD)(n) << 8) -#define DIDFT_NOCOLLECTION 0x00FFFF00 - - -#ifndef DIJ_RINGZERO - -typedef struct _DIOBJECTDATAFORMAT { - const GUID *pguid; - DWORD dwOfs; - DWORD dwType; - DWORD dwFlags; -} DIOBJECTDATAFORMAT, *LPDIOBJECTDATAFORMAT; -typedef const DIOBJECTDATAFORMAT *LPCDIOBJECTDATAFORMAT; - -typedef struct _DIDATAFORMAT { - DWORD dwSize; - DWORD dwObjSize; - DWORD dwFlags; - DWORD dwDataSize; - DWORD dwNumObjs; - LPDIOBJECTDATAFORMAT rgodf; -} DIDATAFORMAT, *LPDIDATAFORMAT; -typedef const DIDATAFORMAT *LPCDIDATAFORMAT; - -#define DIDF_ABSAXIS 0x00000001 -#define DIDF_RELAXIS 0x00000002 - -extern const DIDATAFORMAT c_dfDIMouse; -extern const DIDATAFORMAT c_dfDIKeyboard; -extern const DIDATAFORMAT c_dfDIJoystick; -extern const DIDATAFORMAT c_dfDIJoystick2; - -#if(DIRECTINPUT_VERSION >= 0x0500) -/* These structures are defined for DirectX 3.0 compatibility */ - -typedef struct DIDEVICEOBJECTINSTANCE_DX3A { - DWORD dwSize; - GUID guidType; - DWORD dwOfs; - DWORD dwType; - DWORD dwFlags; - CHAR tszName[MAX_PATH]; -} DIDEVICEOBJECTINSTANCE_DX3A, *LPDIDEVICEOBJECTINSTANCE_DX3A; -typedef struct DIDEVICEOBJECTINSTANCE_DX3W { - DWORD dwSize; - GUID guidType; - DWORD dwOfs; - DWORD dwType; - DWORD dwFlags; - WCHAR tszName[MAX_PATH]; -} DIDEVICEOBJECTINSTANCE_DX3W, *LPDIDEVICEOBJECTINSTANCE_DX3W; -#ifdef UNICODE -typedef DIDEVICEOBJECTINSTANCE_DX3W DIDEVICEOBJECTINSTANCE_DX3; -typedef LPDIDEVICEOBJECTINSTANCE_DX3W LPDIDEVICEOBJECTINSTANCE_DX3; -#else -typedef DIDEVICEOBJECTINSTANCE_DX3A DIDEVICEOBJECTINSTANCE_DX3; -typedef LPDIDEVICEOBJECTINSTANCE_DX3A LPDIDEVICEOBJECTINSTANCE_DX3; -#endif // UNICODE -typedef const DIDEVICEOBJECTINSTANCE_DX3A *LPCDIDEVICEOBJECTINSTANCE_DX3A; -typedef const DIDEVICEOBJECTINSTANCE_DX3W *LPCDIDEVICEOBJECTINSTANCE_DX3W; -typedef const DIDEVICEOBJECTINSTANCE_DX3 *LPCDIDEVICEOBJECTINSTANCE_DX3; -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ - -typedef struct DIDEVICEOBJECTINSTANCEA { - DWORD dwSize; - GUID guidType; - DWORD dwOfs; - DWORD dwType; - DWORD dwFlags; - CHAR tszName[MAX_PATH]; -#if(DIRECTINPUT_VERSION >= 0x0500) - DWORD dwFFMaxForce; - DWORD dwFFForceResolution; - WORD wCollectionNumber; - WORD wDesignatorIndex; - WORD wUsagePage; - WORD wUsage; - DWORD dwDimension; - WORD wExponent; - WORD wReserved; -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ -} DIDEVICEOBJECTINSTANCEA, *LPDIDEVICEOBJECTINSTANCEA; -typedef struct DIDEVICEOBJECTINSTANCEW { - DWORD dwSize; - GUID guidType; - DWORD dwOfs; - DWORD dwType; - DWORD dwFlags; - WCHAR tszName[MAX_PATH]; -#if(DIRECTINPUT_VERSION >= 0x0500) - DWORD dwFFMaxForce; - DWORD dwFFForceResolution; - WORD wCollectionNumber; - WORD wDesignatorIndex; - WORD wUsagePage; - WORD wUsage; - DWORD dwDimension; - WORD wExponent; - WORD wReserved; -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ -} DIDEVICEOBJECTINSTANCEW, *LPDIDEVICEOBJECTINSTANCEW; -#ifdef UNICODE -typedef DIDEVICEOBJECTINSTANCEW DIDEVICEOBJECTINSTANCE; -typedef LPDIDEVICEOBJECTINSTANCEW LPDIDEVICEOBJECTINSTANCE; -#else -typedef DIDEVICEOBJECTINSTANCEA DIDEVICEOBJECTINSTANCE; -typedef LPDIDEVICEOBJECTINSTANCEA LPDIDEVICEOBJECTINSTANCE; -#endif // UNICODE -typedef const DIDEVICEOBJECTINSTANCEA *LPCDIDEVICEOBJECTINSTANCEA; -typedef const DIDEVICEOBJECTINSTANCEW *LPCDIDEVICEOBJECTINSTANCEW; -typedef const DIDEVICEOBJECTINSTANCE *LPCDIDEVICEOBJECTINSTANCE; - -typedef BOOL (FAR PASCAL * LPDIENUMDEVICEOBJECTSCALLBACKA)(LPCDIDEVICEOBJECTINSTANCEA, LPVOID); -typedef BOOL (FAR PASCAL * LPDIENUMDEVICEOBJECTSCALLBACKW)(LPCDIDEVICEOBJECTINSTANCEW, LPVOID); -#ifdef UNICODE -#define LPDIENUMDEVICEOBJECTSCALLBACK LPDIENUMDEVICEOBJECTSCALLBACKW -#else -#define LPDIENUMDEVICEOBJECTSCALLBACK LPDIENUMDEVICEOBJECTSCALLBACKA -#endif // !UNICODE - -#if(DIRECTINPUT_VERSION >= 0x0500) -#define DIDOI_FFACTUATOR 0x00000001 -#define DIDOI_FFEFFECTTRIGGER 0x00000002 -#define DIDOI_POLLED 0x00008000 -#define DIDOI_ASPECTPOSITION 0x00000100 -#define DIDOI_ASPECTVELOCITY 0x00000200 -#define DIDOI_ASPECTACCEL 0x00000300 -#define DIDOI_ASPECTFORCE 0x00000400 -#define DIDOI_ASPECTMASK 0x00000F00 -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ - -typedef struct DIPROPHEADER { - DWORD dwSize; - DWORD dwHeaderSize; - DWORD dwObj; - DWORD dwHow; -} DIPROPHEADER, *LPDIPROPHEADER; -typedef const DIPROPHEADER *LPCDIPROPHEADER; - -#define DIPH_DEVICE 0 -#define DIPH_BYOFFSET 1 -#define DIPH_BYID 2 - -typedef struct DIPROPDWORD { - DIPROPHEADER diph; - DWORD dwData; -} DIPROPDWORD, *LPDIPROPDWORD; -typedef const DIPROPDWORD *LPCDIPROPDWORD; - -typedef struct DIPROPRANGE { - DIPROPHEADER diph; - LONG lMin; - LONG lMax; -} DIPROPRANGE, *LPDIPROPRANGE; -typedef const DIPROPRANGE *LPCDIPROPRANGE; - -#define DIPROPRANGE_NOMIN ((LONG)0x80000000) -#define DIPROPRANGE_NOMAX ((LONG)0x7FFFFFFF) - -#ifdef __cplusplus -#define MAKEDIPROP(prop) (*(const GUID *)(prop)) -#else -#define MAKEDIPROP(prop) ((REFGUID)(prop)) -#endif - -#define DIPROP_BUFFERSIZE MAKEDIPROP(1) - -#define DIPROP_AXISMODE MAKEDIPROP(2) - -#define DIPROPAXISMODE_ABS 0 -#define DIPROPAXISMODE_REL 1 - -#define DIPROP_GRANULARITY MAKEDIPROP(3) - -#define DIPROP_RANGE MAKEDIPROP(4) - -#define DIPROP_DEADZONE MAKEDIPROP(5) - -#define DIPROP_SATURATION MAKEDIPROP(6) - -#define DIPROP_FFGAIN MAKEDIPROP(7) - -#define DIPROP_FFLOAD MAKEDIPROP(8) - -#define DIPROP_AUTOCENTER MAKEDIPROP(9) - -#define DIPROPAUTOCENTER_OFF 0 -#define DIPROPAUTOCENTER_ON 1 - -#define DIPROP_CALIBRATIONMODE MAKEDIPROP(10) - -#define DIPROPCALIBRATIONMODE_COOKED 0 -#define DIPROPCALIBRATIONMODE_RAW 1 - -typedef struct DIDEVICEOBJECTDATA { - DWORD dwOfs; - DWORD dwData; - DWORD dwTimeStamp; - DWORD dwSequence; -} DIDEVICEOBJECTDATA, *LPDIDEVICEOBJECTDATA; -typedef const DIDEVICEOBJECTDATA *LPCDIDEVICEOBJECTDATA; - -#define DIGDD_PEEK 0x00000001 - -#define DISEQUENCE_COMPARE(dwSequence1, cmp, dwSequence2) \ - ((int)((dwSequence1) - (dwSequence2)) cmp 0) -#define DISCL_EXCLUSIVE 0x00000001 -#define DISCL_NONEXCLUSIVE 0x00000002 -#define DISCL_FOREGROUND 0x00000004 -#define DISCL_BACKGROUND 0x00000008 - -#if(DIRECTINPUT_VERSION >= 0x0500) -/* These structures are defined for DirectX 3.0 compatibility */ - -typedef struct DIDEVICEINSTANCE_DX3A { - DWORD dwSize; - GUID guidInstance; - GUID guidProduct; - DWORD dwDevType; - CHAR tszInstanceName[MAX_PATH]; - CHAR tszProductName[MAX_PATH]; -} DIDEVICEINSTANCE_DX3A, *LPDIDEVICEINSTANCE_DX3A; -typedef struct DIDEVICEINSTANCE_DX3W { - DWORD dwSize; - GUID guidInstance; - GUID guidProduct; - DWORD dwDevType; - WCHAR tszInstanceName[MAX_PATH]; - WCHAR tszProductName[MAX_PATH]; -} DIDEVICEINSTANCE_DX3W, *LPDIDEVICEINSTANCE_DX3W; -#ifdef UNICODE -typedef DIDEVICEINSTANCE_DX3W DIDEVICEINSTANCE_DX3; -typedef LPDIDEVICEINSTANCE_DX3W LPDIDEVICEINSTANCE_DX3; -#else -typedef DIDEVICEINSTANCE_DX3A DIDEVICEINSTANCE_DX3; -typedef LPDIDEVICEINSTANCE_DX3A LPDIDEVICEINSTANCE_DX3; -#endif // UNICODE -typedef const DIDEVICEINSTANCE_DX3A *LPCDIDEVICEINSTANCE_DX3A; -typedef const DIDEVICEINSTANCE_DX3W *LPCDIDEVICEINSTANCE_DX3W; -typedef const DIDEVICEINSTANCE_DX3 *LPCDIDEVICEINSTANCE_DX3; -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ - -typedef struct DIDEVICEINSTANCEA { - DWORD dwSize; - GUID guidInstance; - GUID guidProduct; - DWORD dwDevType; - CHAR tszInstanceName[MAX_PATH]; - CHAR tszProductName[MAX_PATH]; -#if(DIRECTINPUT_VERSION >= 0x0500) - GUID guidFFDriver; - WORD wUsagePage; - WORD wUsage; -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ -} DIDEVICEINSTANCEA, *LPDIDEVICEINSTANCEA; -typedef struct DIDEVICEINSTANCEW { - DWORD dwSize; - GUID guidInstance; - GUID guidProduct; - DWORD dwDevType; - WCHAR tszInstanceName[MAX_PATH]; - WCHAR tszProductName[MAX_PATH]; -#if(DIRECTINPUT_VERSION >= 0x0500) - GUID guidFFDriver; - WORD wUsagePage; - WORD wUsage; -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ -} DIDEVICEINSTANCEW, *LPDIDEVICEINSTANCEW; -#ifdef UNICODE -typedef DIDEVICEINSTANCEW DIDEVICEINSTANCE; -typedef LPDIDEVICEINSTANCEW LPDIDEVICEINSTANCE; -#else -typedef DIDEVICEINSTANCEA DIDEVICEINSTANCE; -typedef LPDIDEVICEINSTANCEA LPDIDEVICEINSTANCE; -#endif // UNICODE -typedef const DIDEVICEINSTANCEA *LPCDIDEVICEINSTANCEA; -typedef const DIDEVICEINSTANCEW *LPCDIDEVICEINSTANCEW; -typedef const DIDEVICEINSTANCE *LPCDIDEVICEINSTANCE; - -#undef INTERFACE -#define INTERFACE IDirectInputDeviceW - -DECLARE_INTERFACE_(IDirectInputDeviceW, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirectInputDeviceW methods ***/ - STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; - STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE; - STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; - STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; - STDMETHOD(Acquire)(THIS) PURE; - STDMETHOD(Unacquire)(THIS) PURE; - STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; - STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; - STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; - STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; - STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE; - STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; -}; - -typedef struct IDirectInputDeviceW *LPDIRECTINPUTDEVICEW; - -#undef INTERFACE -#define INTERFACE IDirectInputDeviceA - -DECLARE_INTERFACE_(IDirectInputDeviceA, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirectInputDeviceA methods ***/ - STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; - STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE; - STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; - STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; - STDMETHOD(Acquire)(THIS) PURE; - STDMETHOD(Unacquire)(THIS) PURE; - STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; - STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; - STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; - STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; - STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE; - STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; -}; - -typedef struct IDirectInputDeviceA *LPDIRECTINPUTDEVICEA; - -#ifdef UNICODE -#define IID_IDirectInputDevice IID_IDirectInputDeviceW -#define IDirectInputDevice IDirectInputDeviceW -#define IDirectInputDeviceVtbl IDirectInputDeviceWVtbl -#else -#define IID_IDirectInputDevice IID_IDirectInputDeviceA -#define IDirectInputDevice IDirectInputDeviceA -#define IDirectInputDeviceVtbl IDirectInputDeviceAVtbl -#endif -typedef struct IDirectInputDevice *LPDIRECTINPUTDEVICE; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectInputDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectInputDevice_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectInputDevice_Release(p) (p)->lpVtbl->Release(p) -#define IDirectInputDevice_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) -#define IDirectInputDevice_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c) -#define IDirectInputDevice_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b) -#define IDirectInputDevice_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b) -#define IDirectInputDevice_Acquire(p) (p)->lpVtbl->Acquire(p) -#define IDirectInputDevice_Unacquire(p) (p)->lpVtbl->Unacquire(p) -#define IDirectInputDevice_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b) -#define IDirectInputDevice_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d) -#define IDirectInputDevice_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a) -#define IDirectInputDevice_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a) -#define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) -#define IDirectInputDevice_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c) -#define IDirectInputDevice_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a) -#define IDirectInputDevice_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) -#define IDirectInputDevice_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) -#else -#define IDirectInputDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectInputDevice_AddRef(p) (p)->AddRef() -#define IDirectInputDevice_Release(p) (p)->Release() -#define IDirectInputDevice_GetCapabilities(p,a) (p)->GetCapabilities(a) -#define IDirectInputDevice_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c) -#define IDirectInputDevice_GetProperty(p,a,b) (p)->GetProperty(a,b) -#define IDirectInputDevice_SetProperty(p,a,b) (p)->SetProperty(a,b) -#define IDirectInputDevice_Acquire(p) (p)->Acquire() -#define IDirectInputDevice_Unacquire(p) (p)->Unacquire() -#define IDirectInputDevice_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b) -#define IDirectInputDevice_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d) -#define IDirectInputDevice_SetDataFormat(p,a) (p)->SetDataFormat(a) -#define IDirectInputDevice_SetEventNotification(p,a) (p)->SetEventNotification(a) -#define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) -#define IDirectInputDevice_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c) -#define IDirectInputDevice_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a) -#define IDirectInputDevice_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) -#define IDirectInputDevice_Initialize(p,a,b,c) (p)->Initialize(a,b,c) -#endif - -#endif /* DIJ_RINGZERO */ - - -#if(DIRECTINPUT_VERSION >= 0x0500) - -#define DISFFC_RESET 0x00000001 -#define DISFFC_STOPALL 0x00000002 -#define DISFFC_PAUSE 0x00000004 -#define DISFFC_CONTINUE 0x00000008 -#define DISFFC_SETACTUATORSON 0x00000010 -#define DISFFC_SETACTUATORSOFF 0x00000020 - -#define DIGFFS_EMPTY 0x00000001 -#define DIGFFS_STOPPED 0x00000002 -#define DIGFFS_PAUSED 0x00000004 -#define DIGFFS_ACTUATORSON 0x00000010 -#define DIGFFS_ACTUATORSOFF 0x00000020 -#define DIGFFS_POWERON 0x00000040 -#define DIGFFS_POWEROFF 0x00000080 -#define DIGFFS_SAFETYSWITCHON 0x00000100 -#define DIGFFS_SAFETYSWITCHOFF 0x00000200 -#define DIGFFS_USERFFSWITCHON 0x00000400 -#define DIGFFS_USERFFSWITCHOFF 0x00000800 -#define DIGFFS_DEVICELOST 0x80000000 - -#ifndef DIJ_RINGZERO - -typedef struct DIEFFECTINFOA { - DWORD dwSize; - GUID guid; - DWORD dwEffType; - DWORD dwStaticParams; - DWORD dwDynamicParams; - CHAR tszName[MAX_PATH]; -} DIEFFECTINFOA, *LPDIEFFECTINFOA; -typedef struct DIEFFECTINFOW { - DWORD dwSize; - GUID guid; - DWORD dwEffType; - DWORD dwStaticParams; - DWORD dwDynamicParams; - WCHAR tszName[MAX_PATH]; -} DIEFFECTINFOW, *LPDIEFFECTINFOW; -#ifdef UNICODE -typedef DIEFFECTINFOW DIEFFECTINFO; -typedef LPDIEFFECTINFOW LPDIEFFECTINFO; -#else -typedef DIEFFECTINFOA DIEFFECTINFO; -typedef LPDIEFFECTINFOA LPDIEFFECTINFO; -#endif // UNICODE -typedef const DIEFFECTINFOA *LPCDIEFFECTINFOA; -typedef const DIEFFECTINFOW *LPCDIEFFECTINFOW; -typedef const DIEFFECTINFO *LPCDIEFFECTINFO; - -typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSCALLBACKA)(LPCDIEFFECTINFOA, LPVOID); -typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSCALLBACKW)(LPCDIEFFECTINFOW, LPVOID); -#ifdef UNICODE -#define LPDIENUMEFFECTSCALLBACK LPDIENUMEFFECTSCALLBACKW -#else -#define LPDIENUMEFFECTSCALLBACK LPDIENUMEFFECTSCALLBACKA -#endif // !UNICODE -typedef BOOL (FAR PASCAL * LPDIENUMCREATEDEFFECTOBJECTSCALLBACK)(LPDIRECTINPUTEFFECT, LPVOID); - -#undef INTERFACE -#define INTERFACE IDirectInputDevice2W - -DECLARE_INTERFACE_(IDirectInputDevice2W, IDirectInputDeviceW) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirectInputDeviceW methods ***/ - STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; - STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE; - STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; - STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; - STDMETHOD(Acquire)(THIS) PURE; - STDMETHOD(Unacquire)(THIS) PURE; - STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; - STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; - STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; - STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; - STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE; - STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; - - /*** IDirectInputDevice2W methods ***/ - STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE; - STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW,LPVOID,DWORD) PURE; - STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW,REFGUID) PURE; - STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE; - STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE; - STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; - STDMETHOD(Poll)(THIS) PURE; - STDMETHOD(SendDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; -}; - -typedef struct IDirectInputDevice2W *LPDIRECTINPUTDEVICE2W; - -#undef INTERFACE -#define INTERFACE IDirectInputDevice2A - -DECLARE_INTERFACE_(IDirectInputDevice2A, IDirectInputDeviceA) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirectInputDeviceA methods ***/ - STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; - STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE; - STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; - STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; - STDMETHOD(Acquire)(THIS) PURE; - STDMETHOD(Unacquire)(THIS) PURE; - STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; - STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; - STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; - STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; - STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE; - STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; - - /*** IDirectInputDevice2A methods ***/ - STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE; - STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA,LPVOID,DWORD) PURE; - STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA,REFGUID) PURE; - STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE; - STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE; - STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; - STDMETHOD(Poll)(THIS) PURE; - STDMETHOD(SendDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; -}; - -typedef struct IDirectInputDevice2A *LPDIRECTINPUTDEVICE2A; - -#ifdef UNICODE -#define IID_IDirectInputDevice2 IID_IDirectInputDevice2W -#define IDirectInputDevice2 IDirectInputDevice2W -#define IDirectInputDevice2Vtbl IDirectInputDevice2WVtbl -#else -#define IID_IDirectInputDevice2 IID_IDirectInputDevice2A -#define IDirectInputDevice2 IDirectInputDevice2A -#define IDirectInputDevice2Vtbl IDirectInputDevice2AVtbl -#endif -typedef struct IDirectInputDevice2 *LPDIRECTINPUTDEVICE2; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectInputDevice2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectInputDevice2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectInputDevice2_Release(p) (p)->lpVtbl->Release(p) -#define IDirectInputDevice2_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) -#define IDirectInputDevice2_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c) -#define IDirectInputDevice2_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b) -#define IDirectInputDevice2_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b) -#define IDirectInputDevice2_Acquire(p) (p)->lpVtbl->Acquire(p) -#define IDirectInputDevice2_Unacquire(p) (p)->lpVtbl->Unacquire(p) -#define IDirectInputDevice2_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b) -#define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d) -#define IDirectInputDevice2_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a) -#define IDirectInputDevice2_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a) -#define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) -#define IDirectInputDevice2_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c) -#define IDirectInputDevice2_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a) -#define IDirectInputDevice2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) -#define IDirectInputDevice2_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) -#define IDirectInputDevice2_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d) -#define IDirectInputDevice2_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c) -#define IDirectInputDevice2_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b) -#define IDirectInputDevice2_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a) -#define IDirectInputDevice2_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a) -#define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c) -#define IDirectInputDevice2_Escape(p,a) (p)->lpVtbl->Escape(p,a) -#define IDirectInputDevice2_Poll(p) (p)->lpVtbl->Poll(p) -#define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d) -#else -#define IDirectInputDevice2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectInputDevice2_AddRef(p) (p)->AddRef() -#define IDirectInputDevice2_Release(p) (p)->Release() -#define IDirectInputDevice2_GetCapabilities(p,a) (p)->GetCapabilities(a) -#define IDirectInputDevice2_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c) -#define IDirectInputDevice2_GetProperty(p,a,b) (p)->GetProperty(a,b) -#define IDirectInputDevice2_SetProperty(p,a,b) (p)->SetProperty(a,b) -#define IDirectInputDevice2_Acquire(p) (p)->Acquire() -#define IDirectInputDevice2_Unacquire(p) (p)->Unacquire() -#define IDirectInputDevice2_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b) -#define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d) -#define IDirectInputDevice2_SetDataFormat(p,a) (p)->SetDataFormat(a) -#define IDirectInputDevice2_SetEventNotification(p,a) (p)->SetEventNotification(a) -#define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) -#define IDirectInputDevice2_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c) -#define IDirectInputDevice2_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a) -#define IDirectInputDevice2_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) -#define IDirectInputDevice2_Initialize(p,a,b,c) (p)->Initialize(a,b,c) -#define IDirectInputDevice2_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d) -#define IDirectInputDevice2_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c) -#define IDirectInputDevice2_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b) -#define IDirectInputDevice2_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a) -#define IDirectInputDevice2_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a) -#define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c) -#define IDirectInputDevice2_Escape(p,a) (p)->Escape(a) -#define IDirectInputDevice2_Poll(p) (p)->Poll() -#define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d) -#endif - -#endif /* DIJ_RINGZERO */ - -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ - -/**************************************************************************** - * - * Mouse - * - ****************************************************************************/ - -#ifndef DIJ_RINGZERO - -typedef struct _DIMOUSESTATE { - LONG lX; - LONG lY; - LONG lZ; - BYTE rgbButtons[4]; -} DIMOUSESTATE, *LPDIMOUSESTATE; - -#define DIMOFS_X FIELD_OFFSET(DIMOUSESTATE, lX) -#define DIMOFS_Y FIELD_OFFSET(DIMOUSESTATE, lY) -#define DIMOFS_Z FIELD_OFFSET(DIMOUSESTATE, lZ) -#define DIMOFS_BUTTON0 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 0) -#define DIMOFS_BUTTON1 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 1) -#define DIMOFS_BUTTON2 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 2) -#define DIMOFS_BUTTON3 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3) - -#endif /* DIJ_RINGZERO */ - -/**************************************************************************** - * - * Keyboard - * - ****************************************************************************/ - -#ifndef DIJ_RINGZERO - -/**************************************************************************** - * - * DirectInput keyboard scan codes - * - ****************************************************************************/ - -#define DIK_ESCAPE 0x01 -#define DIK_1 0x02 -#define DIK_2 0x03 -#define DIK_3 0x04 -#define DIK_4 0x05 -#define DIK_5 0x06 -#define DIK_6 0x07 -#define DIK_7 0x08 -#define DIK_8 0x09 -#define DIK_9 0x0A -#define DIK_0 0x0B -#define DIK_MINUS 0x0C /* - on main keyboard */ -#define DIK_EQUALS 0x0D -#define DIK_BACK 0x0E /* backspace */ -#define DIK_TAB 0x0F -#define DIK_Q 0x10 -#define DIK_W 0x11 -#define DIK_E 0x12 -#define DIK_R 0x13 -#define DIK_T 0x14 -#define DIK_Y 0x15 -#define DIK_U 0x16 -#define DIK_I 0x17 -#define DIK_O 0x18 -#define DIK_P 0x19 -#define DIK_LBRACKET 0x1A -#define DIK_RBRACKET 0x1B -#define DIK_RETURN 0x1C /* Enter on main keyboard */ -#define DIK_LCONTROL 0x1D -#define DIK_A 0x1E -#define DIK_S 0x1F -#define DIK_D 0x20 -#define DIK_F 0x21 -#define DIK_G 0x22 -#define DIK_H 0x23 -#define DIK_J 0x24 -#define DIK_K 0x25 -#define DIK_L 0x26 -#define DIK_SEMICOLON 0x27 -#define DIK_APOSTROPHE 0x28 -#define DIK_GRAVE 0x29 /* accent grave */ -#define DIK_LSHIFT 0x2A -#define DIK_BACKSLASH 0x2B -#define DIK_Z 0x2C -#define DIK_X 0x2D -#define DIK_C 0x2E -#define DIK_V 0x2F -#define DIK_B 0x30 -#define DIK_N 0x31 -#define DIK_M 0x32 -#define DIK_COMMA 0x33 -#define DIK_PERIOD 0x34 /* . on main keyboard */ -#define DIK_SLASH 0x35 /* / on main keyboard */ -#define DIK_RSHIFT 0x36 -#define DIK_MULTIPLY 0x37 /* * on numeric keypad */ -#define DIK_LMENU 0x38 /* left Alt */ -#define DIK_SPACE 0x39 -#define DIK_CAPITAL 0x3A -#define DIK_F1 0x3B -#define DIK_F2 0x3C -#define DIK_F3 0x3D -#define DIK_F4 0x3E -#define DIK_F5 0x3F -#define DIK_F6 0x40 -#define DIK_F7 0x41 -#define DIK_F8 0x42 -#define DIK_F9 0x43 -#define DIK_F10 0x44 -#define DIK_NUMLOCK 0x45 -#define DIK_SCROLL 0x46 /* Scroll Lock */ -#define DIK_NUMPAD7 0x47 -#define DIK_NUMPAD8 0x48 -#define DIK_NUMPAD9 0x49 -#define DIK_SUBTRACT 0x4A /* - on numeric keypad */ -#define DIK_NUMPAD4 0x4B -#define DIK_NUMPAD5 0x4C -#define DIK_NUMPAD6 0x4D -#define DIK_ADD 0x4E /* + on numeric keypad */ -#define DIK_NUMPAD1 0x4F -#define DIK_NUMPAD2 0x50 -#define DIK_NUMPAD3 0x51 -#define DIK_NUMPAD0 0x52 -#define DIK_DECIMAL 0x53 /* . on numeric keypad */ -#define DIK_F11 0x57 -#define DIK_F12 0x58 - -#define DIK_F13 0x64 /* (NEC PC98) */ -#define DIK_F14 0x65 /* (NEC PC98) */ -#define DIK_F15 0x66 /* (NEC PC98) */ - -#define DIK_KANA 0x70 /* (Japanese keyboard) */ -#define DIK_CONVERT 0x79 /* (Japanese keyboard) */ -#define DIK_NOCONVERT 0x7B /* (Japanese keyboard) */ -#define DIK_YEN 0x7D /* (Japanese keyboard) */ -#define DIK_NUMPADEQUALS 0x8D /* = on numeric keypad (NEC PC98) */ -#define DIK_CIRCUMFLEX 0x90 /* (Japanese keyboard) */ -#define DIK_AT 0x91 /* (NEC PC98) */ -#define DIK_COLON 0x92 /* (NEC PC98) */ -#define DIK_UNDERLINE 0x93 /* (NEC PC98) */ -#define DIK_KANJI 0x94 /* (Japanese keyboard) */ -#define DIK_STOP 0x95 /* (NEC PC98) */ -#define DIK_AX 0x96 /* (Japan AX) */ -#define DIK_UNLABELED 0x97 /* (J3100) */ -#define DIK_NUMPADENTER 0x9C /* Enter on numeric keypad */ -#define DIK_RCONTROL 0x9D -#define DIK_NUMPADCOMMA 0xB3 /* , on numeric keypad (NEC PC98) */ -#define DIK_DIVIDE 0xB5 /* / on numeric keypad */ -#define DIK_SYSRQ 0xB7 -#define DIK_RMENU 0xB8 /* right Alt */ -#define DIK_HOME 0xC7 /* Home on arrow keypad */ -#define DIK_UP 0xC8 /* UpArrow on arrow keypad */ -#define DIK_PRIOR 0xC9 /* PgUp on arrow keypad */ -#define DIK_LEFT 0xCB /* LeftArrow on arrow keypad */ -#define DIK_RIGHT 0xCD /* RightArrow on arrow keypad */ -#define DIK_END 0xCF /* End on arrow keypad */ -#define DIK_DOWN 0xD0 /* DownArrow on arrow keypad */ -#define DIK_NEXT 0xD1 /* PgDn on arrow keypad */ -#define DIK_INSERT 0xD2 /* Insert on arrow keypad */ -#define DIK_DELETE 0xD3 /* Delete on arrow keypad */ -#define DIK_LWIN 0xDB /* Left Windows key */ -#define DIK_RWIN 0xDC /* Right Windows key */ -#define DIK_APPS 0xDD /* AppMenu key */ - -/* - * Alternate names for keys, to facilitate transition from DOS. - */ -#define DIK_BACKSPACE DIK_BACK /* backspace */ -#define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */ -#define DIK_LALT DIK_LMENU /* left Alt */ -#define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */ -#define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */ -#define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */ -#define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */ -#define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */ -#define DIK_RALT DIK_RMENU /* right Alt */ -#define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */ -#define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */ -#define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */ -#define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */ -#define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */ -#define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */ - -#endif /* DIJ_RINGZERO */ - -/**************************************************************************** - * - * Joystick - * - ****************************************************************************/ - -#ifndef DIJ_RINGZERO - -typedef struct DIJOYSTATE { - LONG lX; /* x-axis position */ - LONG lY; /* y-axis position */ - LONG lZ; /* z-axis position */ - LONG lRx; /* x-axis rotation */ - LONG lRy; /* y-axis rotation */ - LONG lRz; /* z-axis rotation */ - LONG rglSlider[2]; /* extra axes positions */ - DWORD rgdwPOV[4]; /* POV directions */ - BYTE rgbButtons[32]; /* 32 buttons */ -} DIJOYSTATE, *LPDIJOYSTATE; - -typedef struct DIJOYSTATE2 { - LONG lX; /* x-axis position */ - LONG lY; /* y-axis position */ - LONG lZ; /* z-axis position */ - LONG lRx; /* x-axis rotation */ - LONG lRy; /* y-axis rotation */ - LONG lRz; /* z-axis rotation */ - LONG rglSlider[2]; /* extra axes positions */ - DWORD rgdwPOV[4]; /* POV directions */ - BYTE rgbButtons[128]; /* 128 buttons */ - LONG lVX; /* x-axis velocity */ - LONG lVY; /* y-axis velocity */ - LONG lVZ; /* z-axis velocity */ - LONG lVRx; /* x-axis angular velocity */ - LONG lVRy; /* y-axis angular velocity */ - LONG lVRz; /* z-axis angular velocity */ - LONG rglVSlider[2]; /* extra axes velocities */ - LONG lAX; /* x-axis acceleration */ - LONG lAY; /* y-axis acceleration */ - LONG lAZ; /* z-axis acceleration */ - LONG lARx; /* x-axis angular acceleration */ - LONG lARy; /* y-axis angular acceleration */ - LONG lARz; /* z-axis angular acceleration */ - LONG rglASlider[2]; /* extra axes accelerations */ - LONG lFX; /* x-axis force */ - LONG lFY; /* y-axis force */ - LONG lFZ; /* z-axis force */ - LONG lFRx; /* x-axis torque */ - LONG lFRy; /* y-axis torque */ - LONG lFRz; /* z-axis torque */ - LONG rglFSlider[2]; /* extra axes forces */ -} DIJOYSTATE2, *LPDIJOYSTATE2; - -#define DIJOFS_X FIELD_OFFSET(DIJOYSTATE, lX) -#define DIJOFS_Y FIELD_OFFSET(DIJOYSTATE, lY) -#define DIJOFS_Z FIELD_OFFSET(DIJOYSTATE, lZ) -#define DIJOFS_RX FIELD_OFFSET(DIJOYSTATE, lRx) -#define DIJOFS_RY FIELD_OFFSET(DIJOYSTATE, lRy) -#define DIJOFS_RZ FIELD_OFFSET(DIJOYSTATE, lRz) -#define DIJOFS_SLIDER(n) (FIELD_OFFSET(DIJOYSTATE, rglSlider) + \ - (n) * sizeof(LONG)) -#define DIJOFS_POV(n) (FIELD_OFFSET(DIJOYSTATE, rgdwPOV) + \ - (n) * sizeof(DWORD)) -#define DIJOFS_BUTTON(n) (FIELD_OFFSET(DIJOYSTATE, rgbButtons) + (n)) -#define DIJOFS_BUTTON0 DIJOFS_BUTTON(0) -#define DIJOFS_BUTTON1 DIJOFS_BUTTON(1) -#define DIJOFS_BUTTON2 DIJOFS_BUTTON(2) -#define DIJOFS_BUTTON3 DIJOFS_BUTTON(3) -#define DIJOFS_BUTTON4 DIJOFS_BUTTON(4) -#define DIJOFS_BUTTON5 DIJOFS_BUTTON(5) -#define DIJOFS_BUTTON6 DIJOFS_BUTTON(6) -#define DIJOFS_BUTTON7 DIJOFS_BUTTON(7) -#define DIJOFS_BUTTON8 DIJOFS_BUTTON(8) -#define DIJOFS_BUTTON9 DIJOFS_BUTTON(9) -#define DIJOFS_BUTTON10 DIJOFS_BUTTON(10) -#define DIJOFS_BUTTON11 DIJOFS_BUTTON(11) -#define DIJOFS_BUTTON12 DIJOFS_BUTTON(12) -#define DIJOFS_BUTTON13 DIJOFS_BUTTON(13) -#define DIJOFS_BUTTON14 DIJOFS_BUTTON(14) -#define DIJOFS_BUTTON15 DIJOFS_BUTTON(15) -#define DIJOFS_BUTTON16 DIJOFS_BUTTON(16) -#define DIJOFS_BUTTON17 DIJOFS_BUTTON(17) -#define DIJOFS_BUTTON18 DIJOFS_BUTTON(18) -#define DIJOFS_BUTTON19 DIJOFS_BUTTON(19) -#define DIJOFS_BUTTON20 DIJOFS_BUTTON(20) -#define DIJOFS_BUTTON21 DIJOFS_BUTTON(21) -#define DIJOFS_BUTTON22 DIJOFS_BUTTON(22) -#define DIJOFS_BUTTON23 DIJOFS_BUTTON(23) -#define DIJOFS_BUTTON24 DIJOFS_BUTTON(24) -#define DIJOFS_BUTTON25 DIJOFS_BUTTON(25) -#define DIJOFS_BUTTON26 DIJOFS_BUTTON(26) -#define DIJOFS_BUTTON27 DIJOFS_BUTTON(27) -#define DIJOFS_BUTTON28 DIJOFS_BUTTON(28) -#define DIJOFS_BUTTON29 DIJOFS_BUTTON(29) -#define DIJOFS_BUTTON30 DIJOFS_BUTTON(30) -#define DIJOFS_BUTTON31 DIJOFS_BUTTON(31) - - -#endif /* DIJ_RINGZERO */ - -/**************************************************************************** - * - * IDirectInput - * - ****************************************************************************/ - -#ifndef DIJ_RINGZERO - -#define DIENUM_STOP 0 -#define DIENUM_CONTINUE 1 - -typedef BOOL (FAR PASCAL * LPDIENUMDEVICESCALLBACKA)(LPCDIDEVICEINSTANCEA, LPVOID); -typedef BOOL (FAR PASCAL * LPDIENUMDEVICESCALLBACKW)(LPCDIDEVICEINSTANCEW, LPVOID); -#ifdef UNICODE -#define LPDIENUMDEVICESCALLBACK LPDIENUMDEVICESCALLBACKW -#else -#define LPDIENUMDEVICESCALLBACK LPDIENUMDEVICESCALLBACKA -#endif // !UNICODE - -#define DIEDFL_ALLDEVICES 0x00000000 -#define DIEDFL_ATTACHEDONLY 0x00000001 -#if(DIRECTINPUT_VERSION >= 0x0500) -#define DIEDFL_FORCEFEEDBACK 0x00000100 -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ - -#undef INTERFACE -#define INTERFACE IDirectInputW - -DECLARE_INTERFACE_(IDirectInputW, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirectInputW methods ***/ - STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE; - STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE; - STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; -}; - -typedef struct IDirectInputW *LPDIRECTINPUTW; - -#undef INTERFACE -#define INTERFACE IDirectInputA - -DECLARE_INTERFACE_(IDirectInputA, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirectInputA methods ***/ - STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE; - STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE; - STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; -}; - -typedef struct IDirectInputA *LPDIRECTINPUTA; - -#ifdef UNICODE -#define IID_IDirectInput IID_IDirectInputW -#define IDirectInput IDirectInputW -#define IDirectInputVtbl IDirectInputWVtbl -#else -#define IID_IDirectInput IID_IDirectInputA -#define IDirectInput IDirectInputA -#define IDirectInputVtbl IDirectInputAVtbl -#endif -typedef struct IDirectInput *LPDIRECTINPUT; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectInput_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectInput_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectInput_Release(p) (p)->lpVtbl->Release(p) -#define IDirectInput_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) -#define IDirectInput_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) -#define IDirectInput_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) -#define IDirectInput_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) -#define IDirectInput_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#else -#define IDirectInput_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectInput_AddRef(p) (p)->AddRef() -#define IDirectInput_Release(p) (p)->Release() -#define IDirectInput_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) -#define IDirectInput_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d) -#define IDirectInput_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a) -#define IDirectInput_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) -#define IDirectInput_Initialize(p,a,b) (p)->Initialize(a,b) -#endif - -#undef INTERFACE -#define INTERFACE IDirectInput2W - -DECLARE_INTERFACE_(IDirectInput2W, IDirectInputW) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirectInputW methods ***/ - STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE; - STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE; - STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; - - /*** IDirectInput2W methods ***/ - STDMETHOD(FindDevice)(THIS_ REFGUID,LPCWSTR,LPGUID) PURE; -}; - -typedef struct IDirectInput2W *LPDIRECTINPUT2W; - -#undef INTERFACE -#define INTERFACE IDirectInput2A - -DECLARE_INTERFACE_(IDirectInput2A, IDirectInputA) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IDirectInputA methods ***/ - STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE; - STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE; - STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; - - /*** IDirectInput2A methods ***/ - STDMETHOD(FindDevice)(THIS_ REFGUID,LPCSTR,LPGUID) PURE; -}; - -typedef struct IDirectInput2A *LPDIRECTINPUT2A; - -#ifdef UNICODE -#define IID_IDirectInput2 IID_IDirectInput2W -#define IDirectInput2 IDirectInput2W -#define IDirectInput2Vtbl IDirectInput2WVtbl -#else -#define IID_IDirectInput2 IID_IDirectInput2A -#define IDirectInput2 IDirectInput2A -#define IDirectInput2Vtbl IDirectInput2AVtbl -#endif -typedef struct IDirectInput2 *LPDIRECTINPUT2; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectInput2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectInput2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectInput2_Release(p) (p)->lpVtbl->Release(p) -#define IDirectInput2_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) -#define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) -#define IDirectInput2_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) -#define IDirectInput2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) -#define IDirectInput2_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectInput2_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c) -#else -#define IDirectInput2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectInput2_AddRef(p) (p)->AddRef() -#define IDirectInput2_Release(p) (p)->Release() -#define IDirectInput2_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) -#define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d) -#define IDirectInput2_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a) -#define IDirectInput2_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) -#define IDirectInput2_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectInput2_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c) -#endif - -extern HRESULT WINAPI DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA *ppDI, LPUNKNOWN punkOuter); -extern HRESULT WINAPI DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTW *ppDI, LPUNKNOWN punkOuter); -#ifdef UNICODE -#define DirectInputCreate DirectInputCreateW -#else -#define DirectInputCreate DirectInputCreateA -#endif // !UNICODE - -#endif /* DIJ_RINGZERO */ - - -/**************************************************************************** - * - * Return Codes - * - ****************************************************************************/ - -/* - * The operation completed successfully. - */ -#define DI_OK S_OK - -/* - * The device exists but is not currently attached. - */ -#define DI_NOTATTACHED S_FALSE - -/* - * The device buffer overflowed. Some input was lost. - */ -#define DI_BUFFEROVERFLOW S_FALSE - -/* - * The change in device properties had no effect. - */ -#define DI_PROPNOEFFECT S_FALSE - -/* - * The operation had no effect. - */ -#define DI_NOEFFECT S_FALSE - -/* - * The device is a polled device. As a result, device buffering - * will not collect any data and event notifications will not be - * signalled until GetDeviceState is called. - */ -#define DI_POLLEDDEVICE ((HRESULT)0x00000002L) - -/* - * The parameters of the effect were successfully updated by - * IDirectInputEffect::SetParameters, but the effect was not - * downloaded because the device is not exclusively acquired - * or because the DIEP_NODOWNLOAD flag was passed. - */ -#define DI_DOWNLOADSKIPPED ((HRESULT)0x00000003L) - -/* - * The parameters of the effect were successfully updated by - * IDirectInputEffect::SetParameters, but in order to change - * the parameters, the effect needed to be restarted. - */ -#define DI_EFFECTRESTARTED ((HRESULT)0x00000004L) - -/* - * The parameters of the effect were successfully updated by - * IDirectInputEffect::SetParameters, but some of them were - * beyond the capabilities of the device and were truncated. - */ -#define DI_TRUNCATED ((HRESULT)0x00000008L) - -/* - * Equal to DI_EFFECTRESTARTED | DI_TRUNCATED. - */ -#define DI_TRUNCATEDANDRESTARTED ((HRESULT)0x0000000CL) - -/* - * The application requires a newer version of DirectInput. - */ -#define DIERR_OLDDIRECTINPUTVERSION \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION) - -/* - * The application was written for an unsupported prerelease version - * of DirectInput. - */ -#define DIERR_BETADIRECTINPUTVERSION \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP) - -/* - * The object could not be created due to an incompatible driver version - * or mismatched or incomplete driver components. - */ -#define DIERR_BADDRIVERVER \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL) - -/* - * The device or device instance or effect is not registered with DirectInput. - */ -#define DIERR_DEVICENOTREG REGDB_E_CLASSNOTREG - -/* - * The requested object does not exist. - */ -#define DIERR_NOTFOUND \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND) - -/* - * The requested object does not exist. - */ -#define DIERR_OBJECTNOTFOUND \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND) - -/* - * An invalid parameter was passed to the returning function, - * or the object was not in a state that admitted the function - * to be called. - */ -#define DIERR_INVALIDPARAM E_INVALIDARG - -/* - * The specified interface is not supported by the object - */ -#define DIERR_NOINTERFACE E_NOINTERFACE - -/* - * An undetermined error occured inside the DInput subsystem - */ -#define DIERR_GENERIC E_FAIL - -/* - * The DInput subsystem couldn't allocate sufficient memory to complete the - * caller's request. - */ -#define DIERR_OUTOFMEMORY E_OUTOFMEMORY - -/* - * The function called is not supported at this time - */ -#define DIERR_UNSUPPORTED E_NOTIMPL - -/* - * This object has not been initialized - */ -#define DIERR_NOTINITIALIZED \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY) - -/* - * This object is already initialized - */ -#define DIERR_ALREADYINITIALIZED \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED) - -/* - * This object does not support aggregation - */ -#define DIERR_NOAGGREGATION CLASS_E_NOAGGREGATION - -/* - * Another app has a higher priority level, preventing this call from - * succeeding. - */ -#define DIERR_OTHERAPPHASPRIO E_ACCESSDENIED - -/* - * Access to the device has been lost. It must be re-acquired. - */ -#define DIERR_INPUTLOST \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT) - -/* - * The operation cannot be performed while the device is acquired. - */ -#define DIERR_ACQUIRED \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY) - -/* - * The operation cannot be performed unless the device is acquired. - */ -#define DIERR_NOTACQUIRED \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS) - -/* - * The specified property cannot be changed. - */ -#define DIERR_READONLY E_ACCESSDENIED - -/* - * The device already has an event notification associated with it. - */ -#define DIERR_HANDLEEXISTS E_ACCESSDENIED - -/* - * Data is not yet available. - */ -#ifndef E_PENDING -#define E_PENDING 0x80070007L -#endif - -/* - * Unable to IDirectInputJoyConfig_Acquire because the user - * does not have sufficient privileges to change the joystick - * configuration. - */ -#define DIERR_INSUFFICIENTPRIVS 0x80040200L - -/* - * The device is full. - */ -#define DIERR_DEVICEFULL 0x80040201L - -/* - * Not all the requested information fit into the buffer. - */ -#define DIERR_MOREDATA 0x80040202L - -/* - * The effect is not downloaded. - */ -#define DIERR_NOTDOWNLOADED 0x80040203L - -/* - * The device cannot be reinitialized because there are still effects - * attached to it. - */ -#define DIERR_HASEFFECTS 0x80040204L - -/* - * The operation cannot be performed unless the device is acquired - * in DISCL_EXCLUSIVE mode. - */ -#define DIERR_NOTEXCLUSIVEACQUIRED 0x80040205L - -/* - * The effect could not be downloaded because essential information - * is missing. For example, no axes have been associated with the - * effect, or no type-specific information has been created. - */ -#define DIERR_INCOMPLETEEFFECT 0x80040206L - -/* - * Attempted to read buffered device data from a device that is - * not buffered. - */ -#define DIERR_NOTBUFFERED 0x80040207L - -/* - * An attempt was made to modify parameters of an effect while it is - * playing. Not all hardware devices support altering the parameters - * of an effect while it is playing. - */ -#define DIERR_EFFECTPLAYING 0x80040208L - -#ifdef __cplusplus -}; -#endif - -#endif /* __DINPUT_INCLUDED__ */ - -/**************************************************************************** - * - * Definitions for non-IDirectInput (VJoyD) features defined more recently - * than the current sdk files - * - ****************************************************************************/ - -#ifdef _INC_MMSYSTEM -#ifndef MMNOJOY - -#ifndef __VJOYDX_INCLUDED__ -#define __VJOYDX_INCLUDED__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Flag to indicate that the dwReserved2 field of the JOYINFOEX structure - * contains mini-driver specific data to be passed by VJoyD to the mini- - * driver instead of doing a poll. - */ -#define JOY_PASSDRIVERDATA 0x10000000l - -/* - * Informs the joystick driver that the configuration has been changed - * and should be reloaded from the registery. - * dwFlags is reserved and should be set to zero - */ -WINMMAPI MMRESULT WINAPI joyConfigChanged( DWORD dwFlags ); - -/* - * Hardware Setting indicating that the device is a headtracker - */ -#define JOY_HWS_ISHEADTRACKER 0x02000000l - -/* - * Hardware Setting indicating that the VxD is used to replace - * the standard analog polling - */ -#define JOY_HWS_ISGAMEPORTDRIVER 0x04000000l - -/* - * Hardware Setting indicating that the driver needs a standard - * gameport in order to communicate with the device. - */ -#define JOY_HWS_ISANALOGPORTDRIVER 0x08000000l - -/* - * Hardware Setting indicating that VJoyD should not load this - * driver, it will be loaded externally and will register with - * VJoyD of it's own accord. - */ -#define JOY_HWS_AUTOLOAD 0x10000000l - -/* - * Hardware Setting indicating that the driver acquires any - * resources needed without needing a devnode through VJoyD. - */ -#define JOY_HWS_NODEVNODE 0x20000000l - -/* - * Hardware Setting indicating that the VxD can be used as - * a port 201h emulator. - */ -#define JOY_HWS_ISGAMEPORTEMULATOR 0x40000000l - - -/* - * Usage Setting indicating that the settings are volatile and - * should be removed if still present on a reboot. - */ -#define JOY_US_VOLATILE 0x00000008L - -#ifdef __cplusplus -}; -#endif - -#endif /* __VJOYDX_INCLUDED__ */ - -#endif /* not MMNOJOY */ -#endif /* _INC_MMSYSTEM */ - -/**************************************************************************** - * - * Definitions for non-IDirectInput (VJoyD) features defined more recently - * than the current ddk files - * - ****************************************************************************/ - -#ifndef DIJ_RINGZERO - -#ifdef _INC_MMDDK -#ifndef MMNOJOYDEV - -#ifndef __VJOYDXD_INCLUDED__ -#define __VJOYDXD_INCLUDED__ -/* - * Poll type in which the do_other field of the JOYOEMPOLLDATA - * structure contains mini-driver specific data passed from an app. - */ -#define JOY_OEMPOLL_PASSDRIVERDATA 7 - -#endif /* __VJOYDXD_INCLUDED__ */ - -#endif /* not MMNOJOYDEV */ -#endif /* _INC_MMDDK */ - -#endif /* DIJ_RINGZERO */ - diff --git a/include/vdplay.h b/include/vdplay.h deleted file mode 100644 index 2d94ae9..0000000 --- a/include/vdplay.h +++ /dev/null @@ -1,1711 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1994-1997 Microsoft Corporation. All Rights Reserved. - * - * File: dplay.h - * Content: DirectPlay include file - * - ***************************************************************************/ - -#ifndef __DPLAY_INCLUDED__ -#define __DPLAY_INCLUDED__ - -#include // for DECLARE_INTERFACE and HRESULT - -#define _FACDP 0x877 -#define MAKE_DPHRESULT( code ) MAKE_HRESULT( 1, _FACDP, code ) - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * GUIDS used by DirectPlay objects - */ -DEFINE_GUID(IID_IDirectPlay2, 0x2b74f7c0, 0x9154, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3); -DEFINE_GUID(IID_IDirectPlay2A,0x9d460580, 0xa822, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82); - -DEFINE_GUID(IID_IDirectPlay3, 0x133efe40, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); -DEFINE_GUID(IID_IDirectPlay3A,0x133efe41, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); - -// {D1EB6D20-8923-11d0-9D97-00A0C90A43CB} -DEFINE_GUID(CLSID_DirectPlay,0xd1eb6d20, 0x8923, 0x11d0, 0x9d, 0x97, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); - -/* - * GUIDS used by Service Providers shipped with DirectPlay - * Use these to identify Service Provider returned by EnumConnections - */ - -// GUID for IPX service provider -// {685BC400-9D2C-11cf-A9CD-00AA006886E3} -DEFINE_GUID(DPSPGUID_IPX, -0x685bc400, 0x9d2c, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3); - -// GUID for TCP/IP service provider -// 36E95EE0-8577-11cf-960C-0080C7534E82 -DEFINE_GUID(DPSPGUID_TCPIP, -0x36E95EE0, 0x8577, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82); - -// GUID for Serial service provider -// {0F1D6860-88D9-11cf-9C4E-00A0C905425E} -DEFINE_GUID(DPSPGUID_SERIAL, -0xf1d6860, 0x88d9, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -// GUID for Modem service provider -// {44EAA760-CB68-11cf-9C4E-00A0C905425E} -DEFINE_GUID(DPSPGUID_MODEM, -0x44eaa760, 0xcb68, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -/**************************************************************************** - * - * DirectPlay Structures - * - * Various structures used to invoke DirectPlay. - * - ****************************************************************************/ - -#ifndef IDIRECTPLAY2_OR_GREATER -typedef struct IDirectPlay FAR *LPDIRECTPLAY; -#else -typedef struct IUnknown FAR *LPDIRECTPLAY; -#endif - -typedef struct IDirectPlay2 FAR *LPDIRECTPLAY2; -typedef struct IDirectPlay2 FAR *LPDIRECTPLAY2A; -typedef struct IDirectPlay2 IDirectPlay2A; - -typedef struct IDirectPlay3 FAR *LPDIRECTPLAY3; -typedef struct IDirectPlay3 FAR *LPDIRECTPLAY3A; -typedef struct IDirectPlay3 IDirectPlay3A; - -/* - * DPID - * DirectPlay player and group ID - */ -typedef DWORD DPID, FAR *LPDPID; - -/* - * DPID that system messages come from - */ -#define DPID_SYSMSG 0 - -/* - * DPID representing all players in the session - */ -#define DPID_ALLPLAYERS 0 - -/* - * DPID representing the server player - */ -#define DPID_SERVERPLAYER 1 - -/* - * The player ID is unknown (used with e.g. DPSESSION_NOMESSAGEID) - */ -#define DPID_UNKNOWN 0xFFFFFFFF - -/* - * DPCAPS - * Used to obtain the capabilities of a DirectPlay object - */ -typedef struct -{ - DWORD dwSize; // Size of structure, in bytes - DWORD dwFlags; // DPCAPS_xxx flags - DWORD dwMaxBufferSize; // Maximum message size, in bytes, for this service provider - DWORD dwMaxQueueSize; // Obsolete. - DWORD dwMaxPlayers; // Maximum players/groups (local + remote) - DWORD dwHundredBaud; // Bandwidth in 100 bits per second units; - // i.e. 24 is 2400, 96 is 9600, etc. - DWORD dwLatency; // Estimated latency; 0 = unknown - DWORD dwMaxLocalPlayers; // Maximum # of locally created players allowed - DWORD dwHeaderLength; // Maximum header length, in bytes, on messages - // added by the service provider - DWORD dwTimeout; // Service provider's suggested timeout value - // This is how long DirectPlay will wait for - // responses to system messages -} DPCAPS, FAR *LPDPCAPS; - -/* - * This DirectPlay object is the session host. If the host exits the - * session, another application will become the host and receive a - * DPSYS_HOST system message. - */ -#define DPCAPS_ISHOST 0x00000002 - -/* - * The service provider bound to this DirectPlay object can optimize - * group messaging. - */ -#define DPCAPS_GROUPOPTIMIZED 0x00000008 - -/* - * The service provider bound to this DirectPlay object can optimize - * keep alives (see DPSESSION_KEEPALIVE) - */ -#define DPCAPS_KEEPALIVEOPTIMIZED 0x00000010 - -/* - * The service provider bound to this DirectPlay object can optimize - * guaranteed message delivery. - */ -#define DPCAPS_GUARANTEEDOPTIMIZED 0x00000020 - -/* - * This DirectPlay object supports guaranteed message delivery. - */ -#define DPCAPS_GUARANTEEDSUPPORTED 0x00000040 - -/* - * This DirectPlay object supports digital signing of messages. - */ -#define DPCAPS_SIGNINGSUPPORTED 0x00000080 - -/* - * This DirectPlay object supports encryption of messages. - */ -#define DPCAPS_ENCRYPTIONSUPPORTED 0x00000100 - - -/* - * DPSESSIONDESC2 - * Used to describe the properties of a DirectPlay - * session instance - */ -typedef struct -{ - DWORD dwSize; // Size of structure - DWORD dwFlags; // DPSESSION_xxx flags - GUID guidInstance; // ID for the session instance - GUID guidApplication; // GUID of the DirectPlay application. - // GUID_NULL for all applications. - DWORD dwMaxPlayers; // Maximum # players allowed in session - DWORD dwCurrentPlayers; // Current # players in session (read only) - union - { // Name of the session - LPWSTR lpszSessionName; // Unicode - LPSTR lpszSessionNameA; // ANSI - }; - union - { // Password of the session (optional) - LPWSTR lpszPassword; // Unicode - LPSTR lpszPasswordA; // ANSI - }; - DWORD dwReserved1; // Reserved for future MS use. - DWORD dwReserved2; - DWORD dwUser1; // For use by the application - DWORD dwUser2; - DWORD dwUser3; - DWORD dwUser4; -} DPSESSIONDESC2, FAR *LPDPSESSIONDESC2; - -/* - * LPCDPSESSIONDESC2 - * A constant pointer to DPSESSIONDESC2 - */ -typedef const DPSESSIONDESC2 FAR *LPCDPSESSIONDESC2; - -/* - * Applications cannot create new players in this session. - */ -#define DPSESSION_NEWPLAYERSDISABLED 0x00000001 - -/* - * If the DirectPlay object that created the session, the host, - * quits, then the host will attempt to migrate to another - * DirectPlay object so that new players can continue to be created - * and new applications can join the session. - */ -#define DPSESSION_MIGRATEHOST 0x00000004 - -/* - * This flag tells DirectPlay not to set the idPlayerTo and idPlayerFrom - * fields in player messages. This cuts two DWORD's off the message - * overhead. - */ -#define DPSESSION_NOMESSAGEID 0x00000008 - - -/* - * This flag tells DirectPlay to not allow any new applications to - * join the session. Applications already in the session can still - * create new players. - */ -#define DPSESSION_JOINDISABLED 0x00000020 - -/* - * This flag tells DirectPlay to detect when remote players - * exit abnormally (e.g. their computer or modem gets unplugged) - */ -#define DPSESSION_KEEPALIVE 0x00000040 - -/* - * This flag tells DirectPlay not to send a message to all players - * when a players remote data changes - */ -#define DPSESSION_NODATAMESSAGES 0x00000080 - -/* - * This flag indicates that the session belongs to a secure server - * and needs user authentication - */ -#define DPSESSION_SECURESERVER 0x00000100 - -/* - * This flag indicates that the session is private and requirs a password - * for EnumSessions as well as Open. - */ -#define DPSESSION_PRIVATE 0x00000200 - -/* - * This flag indicates that the session requires a password for joining. - */ -#define DPSESSION_PASSWORDREQUIRED 0x00000400 - -/* - * This flag tells DirectPlay to route all messages through the server - */ -#define DPSESSION_MULTICASTSERVER 0x00000800 - -/* - * This flag tells DirectPlay to only download information about the - * DPPLAYER_SERVERPLAYER. - */ -#define DPSESSION_CLIENTSERVER 0x00001000 - -/* - * DPNAME - * Used to hold the name of a DirectPlay entity - * like a player or a group - */ -typedef struct -{ - DWORD dwSize; // Size of structure - DWORD dwFlags; // Not used. Must be zero. - union - { // The short or friendly name - LPWSTR lpszShortName; // Unicode - LPSTR lpszShortNameA; // ANSI - }; - union - { // The long or formal name - LPWSTR lpszLongName; // Unicode - LPSTR lpszLongNameA; // ANSI - }; - -} DPNAME, FAR *LPDPNAME; - -/* - * LPCDPNAME - * A constant pointer to DPNAME - */ -typedef const DPNAME FAR *LPCDPNAME; - -/* - * DPCREDENTIALS - * Used to hold the user name and password of a DirectPlay user - */ -typedef struct -{ - DWORD dwSize; // Size of structure - DWORD dwFlags; // Not used. Must be zero. - union - { // User name of the account - LPWSTR lpszUsername; // Unicode - LPSTR lpszUsernameA; // ANSI - }; - union - { // Password of the account - LPWSTR lpszPassword; // Unicode - LPSTR lpszPasswordA; // ANSI - }; - union - { // Domain name of the account - LPWSTR lpszDomain; // Unicode - LPSTR lpszDomainA; // ANSI - }; -} DPCREDENTIALS, FAR *LPDPCREDENTIALS; - -typedef const DPCREDENTIALS FAR *LPCDPCREDENTIALS; - -/* - * DPSECURITYDESC - * Used to describe the security properties of a DirectPlay - * session instance - */ -typedef struct -{ - DWORD dwSize; // Size of structure - DWORD dwFlags; // Not used. Must be zero. - union - { // SSPI provider name - LPWSTR lpszSSPIProvider; // Unicode - LPSTR lpszSSPIProviderA; // ANSI - }; - union - { // CAPI provider name - LPWSTR lpszCAPIProvider; // Unicode - LPSTR lpszCAPIProviderA; // ANSI - }; - DWORD dwCAPIProviderType; // Crypto Service Provider type - DWORD dwEncryptionAlgorithm; // Encryption Algorithm type -} DPSECURITYDESC, FAR *LPDPSECURITYDESC; - -typedef const DPSECURITYDESC FAR *LPCDPSECURITYDESC; - -/* - * DPACCOUNTDESC - * Used to describe a user membership account - */ -typedef struct -{ - DWORD dwSize; // Size of structure - DWORD dwFlags; // Not used. Must be zero. - union - { // Account identifier - LPWSTR lpszAccountID; // Unicode - LPSTR lpszAccountIDA; // ANSI - }; -} DPACCOUNTDESC, FAR *LPDPACCOUNTDESC; - -typedef const DPACCOUNTDESC FAR *LPCDPACCOUNTDESC; - -/* - * LPCGUID - * A constant pointer to a guid - */ -typedef const GUID FAR *LPCGUID; - -/* - * DPLCONNECTION - * Used to hold all in the informaion needed to connect - * an application to a session or create a session - */ -typedef struct -{ - DWORD dwSize; // Size of this structure - DWORD dwFlags; // Flags specific to this structure - LPDPSESSIONDESC2 lpSessionDesc; // Pointer to session desc to use on connect - LPDPNAME lpPlayerName; // Pointer to Player name structure - GUID guidSP; // GUID of the DPlay SP to use - LPVOID lpAddress; // Address for service provider - DWORD dwAddressSize; // Size of address data -} DPLCONNECTION, FAR *LPDPLCONNECTION; - -/* - * LPCDPLCONNECTION - * A constant pointer to DPLCONNECTION - */ -typedef const DPLCONNECTION FAR *LPCDPLCONNECTION; - -/* - * DPCHAT - * Used to hold the a DirectPlay chat message - */ -typedef struct -{ - DWORD dwSize; - DWORD dwFlags; - union - { // Message string - LPWSTR lpszMessage; // Unicode - LPSTR lpszMessageA; // ANSI - }; -} DPCHAT, FAR * LPDPCHAT; - -/**************************************************************************** - * - * Prototypes for DirectPlay callback functions - * - ****************************************************************************/ - -/* - * Callback for IDirectPlay2::EnumSessions - */ -typedef BOOL (FAR PASCAL * LPDPENUMSESSIONSCALLBACK2)( - LPCDPSESSIONDESC2 lpThisSD, - LPDWORD lpdwTimeOut, - DWORD dwFlags, - LPVOID lpContext ); - -/* - * This flag is set on the EnumSessions callback dwFlags parameter when - * the time out has occurred. There will be no session data for this - * callback. If *lpdwTimeOut is set to a non-zero value and the - * EnumSessionsCallback function returns TRUE then EnumSessions will - * continue waiting until the next timeout occurs. Timeouts are in - * milliseconds. - */ -#define DPESC_TIMEDOUT 0x00000001 - - -/* - * Callback for IDirectPlay2::EnumPlayers - * IDirectPlay2::EnumGroups - * IDirectPlay2::EnumGroupPlayers - */ -typedef BOOL (FAR PASCAL *LPDPENUMPLAYERSCALLBACK2)( - DPID dpId, - DWORD dwPlayerType, - LPCDPNAME lpName, - DWORD dwFlags, - LPVOID lpContext ); - - -/* - * Unicode callback for DirectPlayEnumerate - * This callback prototype will be used if compiling - * for Unicode strings - */ -typedef BOOL (FAR PASCAL * LPDPENUMDPCALLBACK)( - LPGUID lpguidSP, - LPWSTR lpSPName, - DWORD dwMajorVersion, - DWORD dwMinorVersion, - LPVOID lpContext); - -/* - * ANSI callback for DirectPlayEnumerate - * This callback prototype will be used if compiling - * for ANSI strings - */ -typedef BOOL (FAR PASCAL * LPDPENUMDPCALLBACKA)( - LPGUID lpguidSP, - LPSTR lpSPName, - DWORD dwMajorVersion, - DWORD dwMinorVersion, - LPVOID lpContext); - -/* - * Callback for IDirectPlay3(A)::EnumConnections - */ -typedef BOOL (FAR PASCAL * LPDPENUMCONNECTIONSCALLBACK)( - LPCGUID lpguidSP, - LPVOID lpConnection, - DWORD dwConnectionSize, - LPCDPNAME lpName, - DWORD dwFlags, - LPVOID lpContext); - - -/* - * API's - */ - -#ifdef UNICODE -#define DirectPlayEnumerate DirectPlayEnumerateW -#else -#define DirectPlayEnumerate DirectPlayEnumerateA -#endif // UNICODE - -extern HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA, LPVOID ); -extern HRESULT WINAPI DirectPlayEnumerateW( LPDPENUMDPCALLBACK, LPVOID ); -extern HRESULT WINAPI DirectPlayCreate( LPGUID lpGUID, LPDIRECTPLAY *lplpDP, IUnknown *pUnk); - -/**************************************************************************** - * - * IDirectPlay2 (and IDirectPlay2A) Interface - * - ****************************************************************************/ - -#undef INTERFACE -#define INTERFACE IDirectPlay2 -DECLARE_INTERFACE_( IDirectPlay2, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlay2 methods ***/ - STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(Close) (THIS) PURE; - STDMETHOD(CreateGroup) (THIS_ LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPDPNAME,HANDLE,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE; - STDMETHOD(DestroyGroup) (THIS_ DPID) PURE; - STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE; - STDMETHOD(EnumGroupPlayers) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroups) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumPlayers) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC2,DWORD,LPDPENUMSESSIONSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(GetCaps) (THIS_ LPDPCAPS,DWORD) PURE; - STDMETHOD(GetGroupData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetGroupName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE; - STDMETHOD(GetPlayerAddress) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetPlayerCaps) (THIS_ DPID,LPDPCAPS,DWORD) PURE; - STDMETHOD(GetPlayerData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetPlayerName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetSessionDesc) (THIS_ LPVOID,LPDWORD) PURE; - STDMETHOD(Initialize) (THIS_ LPGUID) PURE; - STDMETHOD(Open) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; - STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE; - STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetGroupData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetGroupName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetPlayerData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetPlayerName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetSessionDesc) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; -}; - -/**************************************************************************** - * - * IDirectPlay2 interface macros - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlay2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay2_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlay2_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b) -#define IDirectPlay2_Close(p) (p)->lpVtbl->Close(p) -#define IDirectPlay2_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e) -#define IDirectPlay2_CreatePlayer(p,a,b,c,d,e,f) (p)->lpVtbl->CreatePlayer(p,a,b,c,d,e,f) -#define IDirectPlay2_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b) -#define IDirectPlay2_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a) -#define IDirectPlay2_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a) -#define IDirectPlay2_EnumGroupPlayers(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d,e) -#define IDirectPlay2_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d) -#define IDirectPlay2_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d) -#define IDirectPlay2_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e) -#define IDirectPlay2_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirectPlay2_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b) -#define IDirectPlay2_GetGroupData(p,a,b,c,d) (p)->lpVtbl->GetGroupData(p,a,b,c,d) -#define IDirectPlay2_GetGroupName(p,a,b,c) (p)->lpVtbl->GetGroupName(p,a,b,c) -#define IDirectPlay2_GetPlayerAddress(p,a,b,c) (p)->lpVtbl->GetPlayerAddress(p,a,b,c) -#define IDirectPlay2_GetPlayerCaps(p,a,b,c) (p)->lpVtbl->GetPlayerCaps(p,a,b,c) -#define IDirectPlay2_GetPlayerData(p,a,b,c,d) (p)->lpVtbl->GetPlayerData(p,a,b,c,d) -#define IDirectPlay2_GetPlayerName(p,a,b,c) (p)->lpVtbl->GetPlayerName(p,a,b,c) -#define IDirectPlay2_GetSessionDesc(p,a,b) (p)->lpVtbl->GetSessionDesc(p,a,b) -#define IDirectPlay2_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirectPlay2_Open(p,a,b) (p)->lpVtbl->Open(p,a,b) -#define IDirectPlay2_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e) -#define IDirectPlay2_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e) -#define IDirectPlay2_SetGroupData(p,a,b,c,d) (p)->lpVtbl->SetGroupData(p,a,b,c,d) -#define IDirectPlay2_SetGroupName(p,a,b,c) (p)->lpVtbl->SetGroupName(p,a,b,c) -#define IDirectPlay2_SetPlayerData(p,a,b,c,d) (p)->lpVtbl->SetPlayerData(p,a,b,c,d) -#define IDirectPlay2_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c) -#define IDirectPlay2_SetSessionDesc(p,a,b) (p)->lpVtbl->SetSessionDesc(p,a,b) - -#else /* C++ */ - -#define IDirectPlay2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay2_AddRef(p) (p)->AddRef() -#define IDirectPlay2_Release(p) (p)->Release() -#define IDirectPlay2_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b) -#define IDirectPlay2_Close(p) (p)->Close() -#define IDirectPlay2_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e) -#define IDirectPlay2_CreatePlayer(p,a,b,c,d,e,f) (p)->CreatePlayer(a,b,c,d,e,f) -#define IDirectPlay2_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b) -#define IDirectPlay2_DestroyGroup(p,a) (p)->DestroyGroup(a) -#define IDirectPlay2_DestroyPlayer(p,a) (p)->DestroyPlayer(a) -#define IDirectPlay2_EnumGroupPlayers(p,a,b,c,d,e) (p)->EnumGroupPlayers(a,b,c,d,e) -#define IDirectPlay2_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d) -#define IDirectPlay2_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d) -#define IDirectPlay2_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e) -#define IDirectPlay2_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirectPlay2_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b) -#define IDirectPlay2_GetGroupData(p,a,b,c,d) (p)->GetGroupData(a,b,c,d) -#define IDirectPlay2_GetGroupName(p,a,b,c) (p)->GetGroupName(a,b,c) -#define IDirectPlay2_GetPlayerAddress(p,a,b,c) (p)->GetPlayerAddress(a,b,c) -#define IDirectPlay2_GetPlayerCaps(p,a,b,c) (p)->GetPlayerCaps(a,b,c) -#define IDirectPlay2_GetPlayerData(p,a,b,c,d) (p)->GetPlayerData(a,b,c,d) -#define IDirectPlay2_GetPlayerName(p,a,b,c) (p)->GetPlayerName(a,b,c) -#define IDirectPlay2_GetSessionDesc(p,a,b) (p)->GetSessionDesc(a,b) -#define IDirectPlay2_Initialize(p,a) (p)->Initialize(a) -#define IDirectPlay2_Open(p,a,b) (p)->Open(a,b) -#define IDirectPlay2_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e) -#define IDirectPlay2_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e) -#define IDirectPlay2_SetGroupData(p,a,b,c,d) (p)->SetGroupData(a,b,c,d) -#define IDirectPlay2_SetGroupName(p,a,b,c) (p)->SetGroupName(a,b,c) -#define IDirectPlay2_SetPlayerData(p,a,b,c,d) (p)->SetPlayerData(a,b,c,d) -#define IDirectPlay2_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c) -#define IDirectPlay2_SetSessionDesc(p,a,b) (p)->SetSessionDesc(a,b) - -#endif - -/**************************************************************************** - * - * IDirectPlay3 (and IDirectPlay3A) Interface - * - ****************************************************************************/ - -#undef INTERFACE -#define INTERFACE IDirectPlay3 -DECLARE_INTERFACE_( IDirectPlay3, IDirectPlay2 ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlay2 methods ***/ - STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(Close) (THIS) PURE; - STDMETHOD(CreateGroup) (THIS_ LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPDPNAME,HANDLE,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE; - STDMETHOD(DestroyGroup) (THIS_ DPID) PURE; - STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE; - STDMETHOD(EnumGroupPlayers) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroups) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumPlayers) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC2,DWORD,LPDPENUMSESSIONSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(GetCaps) (THIS_ LPDPCAPS,DWORD) PURE; - STDMETHOD(GetGroupData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetGroupName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE; - STDMETHOD(GetPlayerAddress) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetPlayerCaps) (THIS_ DPID,LPDPCAPS,DWORD) PURE; - STDMETHOD(GetPlayerData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetPlayerName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetSessionDesc) (THIS_ LPVOID,LPDWORD) PURE; - STDMETHOD(Initialize) (THIS_ LPGUID) PURE; - STDMETHOD(Open) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; - STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE; - STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetGroupData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetGroupName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetPlayerData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetPlayerName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetSessionDesc) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; - /*** IDirectPlay3 methods ***/ - STDMETHOD(AddGroupToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(CreateGroupInGroup) (THIS_ DPID,LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DeleteGroupFromGroup) (THIS_ DPID,DPID) PURE; - STDMETHOD(EnumConnections) (THIS_ LPCGUID,LPDPENUMCONNECTIONSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroupsInGroup) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(GetGroupConnectionSettings)(THIS_ DWORD, DPID, LPVOID, LPDWORD) PURE; - STDMETHOD(InitializeConnection) (THIS_ LPVOID,DWORD) PURE; - STDMETHOD(SecureOpen) (THIS_ LPCDPSESSIONDESC2,DWORD,LPCDPSECURITYDESC,LPCDPCREDENTIALS) PURE; - STDMETHOD(SendChatMessage) (THIS_ DPID,DPID,DWORD,LPDPCHAT); - STDMETHOD(SetGroupConnectionSettings)(THIS_ DWORD,DPID,LPDPLCONNECTION) PURE; - STDMETHOD(StartSession) (THIS_ DWORD,DPID); - STDMETHOD(GetGroupFlags) (THIS_ DPID,LPDWORD); - STDMETHOD(GetGroupParent) (THIS_ DPID,LPDPID); - STDMETHOD(GetPlayerAccount) (THIS_ DPID, DWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(GetPlayerFlags) (THIS_ DPID,LPDWORD); -}; - -/**************************************************************************** - * - * IDirectPlay3 interface macros - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlay3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay3_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay3_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlay3_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b) -#define IDirectPlay3_Close(p) (p)->lpVtbl->Close(p) -#define IDirectPlay3_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e) -#define IDirectPlay3_CreatePlayer(p,a,b,c,d,e,f) (p)->lpVtbl->CreatePlayer(p,a,b,c,d,e,f) -#define IDirectPlay3_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b) -#define IDirectPlay3_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a) -#define IDirectPlay3_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a) -#define IDirectPlay3_EnumGroupPlayers(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d,e) -#define IDirectPlay3_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d) -#define IDirectPlay3_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d) -#define IDirectPlay3_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e) -#define IDirectPlay3_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirectPlay3_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b) -#define IDirectPlay3_GetGroupData(p,a,b,c,d) (p)->lpVtbl->GetGroupData(p,a,b,c,d) -#define IDirectPlay3_GetGroupName(p,a,b,c) (p)->lpVtbl->GetGroupName(p,a,b,c) -#define IDirectPlay3_GetPlayerAddress(p,a,b,c) (p)->lpVtbl->GetPlayerAddress(p,a,b,c) -#define IDirectPlay3_GetPlayerCaps(p,a,b,c) (p)->lpVtbl->GetPlayerCaps(p,a,b,c) -#define IDirectPlay3_GetPlayerData(p,a,b,c,d) (p)->lpVtbl->GetPlayerData(p,a,b,c,d) -#define IDirectPlay3_GetPlayerName(p,a,b,c) (p)->lpVtbl->GetPlayerName(p,a,b,c) -#define IDirectPlay3_GetSessionDesc(p,a,b) (p)->lpVtbl->GetSessionDesc(p,a,b) -#define IDirectPlay3_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirectPlay3_Open(p,a,b) (p)->lpVtbl->Open(p,a,b) -#define IDirectPlay3_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e) -#define IDirectPlay3_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e) -#define IDirectPlay3_SetGroupData(p,a,b,c,d) (p)->lpVtbl->SetGroupData(p,a,b,c,d) -#define IDirectPlay3_SetGroupName(p,a,b,c) (p)->lpVtbl->SetGroupName(p,a,b,c) -#define IDirectPlay3_SetPlayerData(p,a,b,c,d) (p)->lpVtbl->SetPlayerData(p,a,b,c,d) -#define IDirectPlay3_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c) -#define IDirectPlay3_SetSessionDesc(p,a,b) (p)->lpVtbl->SetSessionDesc(p,a,b) -#define IDirectPlay3_AddGroupToGroup(p,a,b) (p)->lpVtbl->AddGroupToGroup(p,a,b) -#define IDirectPlay3_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->lpVtbl->CreateGroupInGroup(p,a,b,c,d,e,f) -#define IDirectPlay3_DeleteGroupFromGroup(p,a,b) (p)->lpVtbl->DeleteGroupFromGroup(p,a,b) -#define IDirectPlay3_EnumConnections(p,a,b,c,d) (p)->lpVtbl->EnumConnections(p,a,b,c,d) -#define IDirectPlay3_EnumGroupsInGroup(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupsInGroup(p,a,b,c,d,e) -#define IDirectPlay3_GetGroupConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetGroupConnectionSettings(p,a,b,c,d) -#define IDirectPlay3_InitializeConnection(p,a,b) (p)->lpVtbl->InitializeConnection(p,a,b) -#define IDirectPlay3_SecureOpen(p,a,b,c,d) (p)->lpVtbl->SecureOpen(p,a,b,c,d) -#define IDirectPlay3_SendChatMessage(p,a,b,c,d) (p)->lpVtbl->SendChatMessage(p,a,b,c,d) -#define IDirectPlay3_SetGroupConnectionSettings(p,a,b,c) (p)->lpVtbl->SetGroupConnectionSettings(p,a,b,c) -#define IDirectPlay3_StartSession(p,a,b) (p)->lpVtbl->StartSession(p,a,b) -#define IDirectPlay3_GetGroupFlags(p,a,b) (p)->lpVtbl->GetGroupFlags(p,a,b) -#define IDirectPlay3_GetGroupParent(p,a,b) (p)->lpVtbl->GetGroupParent(p,a,b) -#define IDirectPlay3_GetPlayerAccount(p,a,b,c,d) (p)->lpVtbl->GetPlayerAccount(p,a,b,c,d) -#define IDirectPlay3_GetPlayerFlags(p,a,b) (p)->lpVtbl->GetPlayerFlags(p,a,b) - -#else /* C++ */ - -#define IDirectPlay3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay3_AddRef(p) (p)->AddRef() -#define IDirectPlay3_Release(p) (p)->Release() -#define IDirectPlay3_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b) -#define IDirectPlay3_Close(p) (p)->Close() -#define IDirectPlay3_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e) -#define IDirectPlay3_CreatePlayer(p,a,b,c,d,e,f) (p)->CreatePlayer(a,b,c,d,e,f) -#define IDirectPlay3_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b) -#define IDirectPlay3_DestroyGroup(p,a) (p)->DestroyGroup(a) -#define IDirectPlay3_DestroyPlayer(p,a) (p)->DestroyPlayer(a) -#define IDirectPlay3_EnumGroupPlayers(p,a,b,c,d,e) (p)->EnumGroupPlayers(a,b,c,d,e) -#define IDirectPlay3_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d) -#define IDirectPlay3_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d) -#define IDirectPlay3_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e) -#define IDirectPlay3_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirectPlay3_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b) -#define IDirectPlay3_GetGroupData(p,a,b,c,d) (p)->GetGroupData(a,b,c,d) -#define IDirectPlay3_GetGroupName(p,a,b,c) (p)->GetGroupName(a,b,c) -#define IDirectPlay3_GetPlayerAddress(p,a,b,c) (p)->GetPlayerAddress(a,b,c) -#define IDirectPlay3_GetPlayerCaps(p,a,b,c) (p)->GetPlayerCaps(a,b,c) -#define IDirectPlay3_GetPlayerData(p,a,b,c,d) (p)->GetPlayerData(a,b,c,d) -#define IDirectPlay3_GetPlayerName(p,a,b,c) (p)->GetPlayerName(a,b,c) -#define IDirectPlay3_GetSessionDesc(p,a,b) (p)->GetSessionDesc(a,b) -#define IDirectPlay3_Initialize(p,a) (p)->Initialize(a) -#define IDirectPlay3_Open(p,a,b) (p)->Open(a,b) -#define IDirectPlay3_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e) -#define IDirectPlay3_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e) -#define IDirectPlay3_SetGroupData(p,a,b,c,d) (p)->SetGroupData(a,b,c,d) -#define IDirectPlay3_SetGroupName(p,a,b,c) (p)->SetGroupName(a,b,c) -#define IDirectPlay3_SetPlayerData(p,a,b,c,d) (p)->SetPlayerData(a,b,c,d) -#define IDirectPlay3_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c) -#define IDirectPlay3_SetSessionDesc(p,a,b) (p)->SetSessionDesc(a,b) -#define IDirectPlay3_AddGroupToGroup(p,a,b) (p)->AddGroupToGroup(a,b) -#define IDirectPlay3_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->CreateGroupInGroup(a,b,c,d,e,f) -#define IDirectPlay3_DeleteGroupFromGroup(p,a,b) (p)->DeleteGroupFromGroup(a,b) -#define IDirectPlay3_EnumConnections(p,a,b,c,d) (p)->EnumConnections(a,b,c,d) -#define IDirectPlay3_EnumGroupsInGroup(p,a,b,c,d,e) (p)->EnumGroupsInGroup(a,b,c,d,e) -#define IDirectPlay3_GetGroupConnectionSettings(p,a,b,c,d) (p)->GetGroupConnectionSettings(a,b,c,d) -#define IDirectPlay3_InitializeConnection(p,a,b) (p)->InitializeConnection(a,b) -#define IDirectPlay3_SecureOpen(p,a,b,c,d) (p)->SecureOpen(a,b,c,d) -#define IDirectPlay3_SendChatMessage(p,a,b,c,d) (p)->SendChatMessage(a,b,c,d) -#define IDirectPlay3_SetGroupConnectionSettings(p,a,b,c) (p)->SetGroupConnectionSettings(a,b,c) -#define IDirectPlay3_StartSession(p,a,b) (p)->StartSession(a,b) -#define IDirectPlay3_GetGroupFlags(p,a,b) (p)->GetGroupFlags(a,b) -#define IDirectPlay3_GetGroupParent(p,a,b) (p)->GetGroupParent(a,b) -#define IDirectPlay3_GetPlayerAccount(p,a,b,c,d) (p)->GetPlayerAccount(a,b,c,d) -#define IDirectPlay3_GetPlayerFlags(p,a,b) (p)->GetPlayerFlags(a,b) - -#endif - -/**************************************************************************** - * - * EnumConnections API flags - * - ****************************************************************************/ - -/* - * Enumerate Service Providers - */ -#define DPCONNECTION_DIRECTPLAY 0x00000001 - -/* - * Enumerate Lobby Providers - */ -#define DPCONNECTION_DIRECTPLAYLOBBY 0x00000002 - - -/**************************************************************************** - * - * EnumPlayers API flags - * - ****************************************************************************/ - -/* - * Enumerate all players in the current session - */ -#define DPENUMPLAYERS_ALL 0x00000000 -#define DPENUMGROUPS_ALL DPENUMPLAYERS_ALL - - -/* - * Enumerate only local (created by this application) players - * or groups - */ -#define DPENUMPLAYERS_LOCAL 0x00000008 -#define DPENUMGROUPS_LOCAL DPENUMPLAYERS_LOCAL - -/* - * Enumerate only remote (non-local) players - * or groups - */ -#define DPENUMPLAYERS_REMOTE 0x00000010 -#define DPENUMGROUPS_REMOTE DPENUMPLAYERS_REMOTE - -/* - * Enumerate groups along with the players - */ -#define DPENUMPLAYERS_GROUP 0x00000020 - -/* - * Enumerate players or groups in another session - * (must supply lpguidInstance) - */ -#define DPENUMPLAYERS_SESSION 0x00000080 -#define DPENUMGROUPS_SESSION DPENUMPLAYERS_SESSION - -/* - * Enumerate server players - */ -#define DPENUMPLAYERS_SERVERPLAYER 0x00000100 - -/* - * Enumerate spectator players - */ -#define DPENUMPLAYERS_SPECTATOR 0x00000200 - -/* - * Enumerate shortcut groups - */ -#define DPENUMGROUPS_SHORTCUT 0x00000400 - -/* - * Enumerate staging area groups - */ -#define DPENUMGROUPS_STAGINGAREA 0x00000800 - -/**************************************************************************** - * - * CreatePlayer API flags - * - ****************************************************************************/ - -/* - * This flag indicates that this player should be designated - * the server player. The app should specify this at CreatePlayer. - */ -#define DPPLAYER_SERVERPLAYER DPENUMPLAYERS_SERVERPLAYER - -/* - * This flag indicates that this player should be designated - * a spectator. The app should specify this at CreatePlayer. - */ -#define DPPLAYER_SPECTATOR DPENUMPLAYERS_SPECTATOR - -/* - * This flag indicates that this player was created locally. - * (returned from GetPlayerFlags) - */ -#define DPPLAYER_LOCAL DPENUMPLAYERS_LOCAL - -/**************************************************************************** - * - * CreateGroup API flags - * - ****************************************************************************/ - - -/* - * This flag indicates that the StartSession can be called on the group. - * The app should specify this at CreateGroup, or CreateGroupInGroup. - */ -#define DPGROUP_STAGINGAREA DPENUMGROUPS_STAGINGAREA - -/* - * This flag indicates that this group was created locally. - * (returned from GetGroupFlags) - */ -#define DPGROUP_LOCAL DPENUMGROUPS_LOCAL - -/**************************************************************************** - * - * EnumSessions API flags - * - ****************************************************************************/ - -/* - * Enumerate sessions which can be joined - */ -#define DPENUMSESSIONS_AVAILABLE 0x00000001 - -/* - * Enumerate all sessions even if they can't be joined. - */ -#define DPENUMSESSIONS_ALL 0x00000002 - - - - -/* - * Start an asynchronous enum sessions - */ - #define DPENUMSESSIONS_ASYNC 0x00000010 - -/* - * Stop an asynchronous enum sessions - */ - #define DPENUMSESSIONS_STOPASYNC 0x00000020 - -/* - * Enumerate sessions even if they require a password - */ - #define DPENUMSESSIONS_PASSWORDREQUIRED 0x00000040 - -/* - * Return status about progress of enumeration instead of - * showing any status dialogs. - */ - #define DPENUMSESSIONS_RETURNSTATUS 0x00000080 - -/**************************************************************************** - * - * GetCaps and GetPlayerCaps API flags - * - ****************************************************************************/ - -/* - * The latency returned should be for guaranteed message sending. - * Default is non-guaranteed messaging. - */ -#define DPGETCAPS_GUARANTEED 0x00000001 - - -/**************************************************************************** - * - * GetGroupData, GetPlayerData API flags - * Remote and local Group/Player data is maintained separately. - * Default is DPGET_REMOTE. - * - ****************************************************************************/ - -/* - * Get the remote data (set by any DirectPlay object in - * the session using DPSET_REMOTE) - */ -#define DPGET_REMOTE 0x00000000 - -/* - * Get the local data (set by this DirectPlay object - * using DPSET_LOCAL) - */ -#define DPGET_LOCAL 0x00000001 - - -/**************************************************************************** - * - * Open API flags - * - ****************************************************************************/ - -/* - * Join the session that is described by the DPSESSIONDESC2 structure - */ -#define DPOPEN_JOIN 0x00000001 - -/* - * Create a new session as described by the DPSESSIONDESC2 structure - */ -#define DPOPEN_CREATE 0x00000002 - -/* - * Return status about progress of open instead of showing - * any status dialogs. - */ - #define DPOPEN_RETURNSTATUS DPENUMSESSIONS_RETURNSTATUS - -/**************************************************************************** - * - * DPLCONNECTION flags - * - ****************************************************************************/ - -/* - * This application should create a new session as - * described by the DPSESIONDESC structure - */ -#define DPLCONNECTION_CREATESESSION DPOPEN_CREATE - -/* - * This application should join the session described by - * the DPSESIONDESC structure with the lpAddress data - */ -#define DPLCONNECTION_JOINSESSION DPOPEN_JOIN - -/**************************************************************************** - * - * Receive API flags - * Default is DPRECEIVE_ALL - * - ****************************************************************************/ - -/* - * Get the first message in the queue - */ -#define DPRECEIVE_ALL 0x00000001 - -/* - * Get the first message in the queue directed to a specific player - */ -#define DPRECEIVE_TOPLAYER 0x00000002 - -/* - * Get the first message in the queue from a specific player - */ -#define DPRECEIVE_FROMPLAYER 0x00000004 - -/* - * Get the message but don't remove it from the queue - */ -#define DPRECEIVE_PEEK 0x00000008 - - -/**************************************************************************** - * - * Send API flags - * - ****************************************************************************/ - -/* - * Send the message using a guaranteed send method. - * Default is non-guaranteed. - */ -#define DPSEND_GUARANTEED 0x00000001 - - -/* - * This flag is obsolete. It is ignored by DirectPlay - */ -#define DPSEND_HIGHPRIORITY 0x00000002 - -/* - * This flag is obsolete. It is ignored by DirectPlay - */ -#define DPSEND_OPENSTREAM 0x00000008 - -/* - * This flag is obsolete. It is ignored by DirectPlay - */ -#define DPSEND_CLOSESTREAM 0x00000010 - -/* - * Send the message digitally signed to ensure authenticity. - */ -#define DPSEND_SIGNED 0x00000020 - -/* - * Send the message with encryption to ensure privacy. - */ -#define DPSEND_ENCRYPTED 0x00000040 - - -/**************************************************************************** - * - * SetGroupData, SetGroupName, SetPlayerData, SetPlayerName, - * SetSessionDesc API flags. - * Default is DPSET_REMOTE. - * - ****************************************************************************/ - -/* - * Propagate the data to all players in the session - */ -#define DPSET_REMOTE 0x00000000 - -/* - * Do not propagate the data to other players - */ -#define DPSET_LOCAL 0x00000001 - -/* - * Used with DPSET_REMOTE, use guaranteed message send to - * propagate the data - */ -#define DPSET_GUARANTEED 0x00000002 - - -/**************************************************************************** - * - * DirectPlay system messages and message data structures - * - * All system message come 'From' player DPID_SYSMSG. To determine what type - * of message it is, cast the lpData from Receive to DPMSG_GENERIC and check - * the dwType member against one of the following DPSYS_xxx constants. Once - * a match is found, cast the lpData to the corresponding of the DPMSG_xxx - * structures to access the data of the message. - * - ****************************************************************************/ - -/* - * A new player or group has been created in the session - * Use DPMSG_CREATEPLAYERORGROUP. Check dwPlayerType to see if it - * is a player or a group. - */ -#define DPSYS_CREATEPLAYERORGROUP 0x0003 - -/* - * A player has been deleted from the session - * Use DPMSG_DESTROYPLAYERORGROUP - */ -#define DPSYS_DESTROYPLAYERORGROUP 0x0005 - -/* - * A player has been added to a group - * Use DPMSG_ADDPLAYERTOGROUP - */ -#define DPSYS_ADDPLAYERTOGROUP 0x0007 - -/* - * A player has been removed from a group - * Use DPMSG_DELETEPLAYERFROMGROUP - */ -#define DPSYS_DELETEPLAYERFROMGROUP 0x0021 - -/* - * This DirectPlay object lost its connection with all the - * other players in the session. - * Use DPMSG_SESSIONLOST. - */ -#define DPSYS_SESSIONLOST 0x0031 - -/* - * The current host has left the session. - * This DirectPlay object is now the host. - * Use DPMSG_HOST. - */ -#define DPSYS_HOST 0x0101 - -/* - * The remote data associated with a player or - * group has changed. Check dwPlayerType to see - * if it is a player or a group - * Use DPMSG_SETPLAYERORGROUPDATA - */ -#define DPSYS_SETPLAYERORGROUPDATA 0x0102 - -/* - * The name of a player or group has changed. - * Check dwPlayerType to see if it is a player - * or a group. - * Use DPMSG_SETPLAYERORGROUPNAME - */ -#define DPSYS_SETPLAYERORGROUPNAME 0x0103 - -/* - * The session description has changed. - * Use DPMSG_SETSESSIONDESC - */ -#define DPSYS_SETSESSIONDESC 0x0104 - -/* - * A group has been added to a group - * Use DPMSG_ADDGROUPTOGROUP - */ -#define DPSYS_ADDGROUPTOGROUP 0x0105 - -/* - * A group has been removed from a group - * Use DPMSG_DELETEGROUPFROMGROUP - */ -#define DPSYS_DELETEGROUPFROMGROUP 0x0106 - -/* - * A secure player-player message has arrived. - * Use DPMSG_SECUREMESSAGE - */ -#define DPSYS_SECUREMESSAGE 0x0107 - -/* - * Start a new session. - * Use DPMSG_STARTSESSION - */ -#define DPSYS_STARTSESSION 0x0108 - -/* - * A chat message has arrived - * Use DPMSG_CHAT - */ -#define DPSYS_CHAT 0x0109 - -/* - * Used in the dwPlayerType field to indicate if it applies to a group - * or a player - */ -#define DPPLAYERTYPE_GROUP 0x00000000 -#define DPPLAYERTYPE_PLAYER 0x00000001 - - -/* - * DPMSG_GENERIC - * Generic message structure used to identify the message type. - */ -typedef struct -{ - DWORD dwType; // Message type -} DPMSG_GENERIC, FAR *LPDPMSG_GENERIC; - -/* - * DPMSG_CREATEPLAYERORGROUP - * System message generated when a new player or group - * created in the session with information about it. - */ -typedef struct -{ - DWORD dwType; // Message type - DWORD dwPlayerType; // Is it a player or group - DPID dpId; // ID of the player or group - DWORD dwCurrentPlayers; // current # players & groups in session - LPVOID lpData; // pointer to remote data - DWORD dwDataSize; // size of remote data - DPNAME dpnName; // structure with name info - // the following fields are only available when using - // the IDirectPlay3 interface or greater - DPID dpIdParent; // id of parent group - DWORD dwFlags; // player or group flags -} DPMSG_CREATEPLAYERORGROUP, FAR *LPDPMSG_CREATEPLAYERORGROUP; - -/* - * DPMSG_DESTROYPLAYERORGROUP - * System message generated when a player or group is being - * destroyed in the session with information about it. - */ -typedef struct -{ - DWORD dwType; // Message type - DWORD dwPlayerType; // Is it a player or group - DPID dpId; // player ID being deleted - LPVOID lpLocalData; // copy of players local data - DWORD dwLocalDataSize; // sizeof local data - LPVOID lpRemoteData; // copy of players remote data - DWORD dwRemoteDataSize; // sizeof remote data - // the following fields are only available when using - // the IDirectPlay3 interface or greater - DPNAME dpnName; // structure with name info - DPID dpIdParent; // id of parent group - DWORD dwFlags; // player or group flags -} DPMSG_DESTROYPLAYERORGROUP, FAR *LPDPMSG_DESTROYPLAYERORGROUP; - -/* - * DPMSG_ADDPLAYERTOGROUP - * System message generated when a player is being added - * to a group. - */ -typedef struct -{ - DWORD dwType; // Message type - DPID dpIdGroup; // group ID being added to - DPID dpIdPlayer; // player ID being added -} DPMSG_ADDPLAYERTOGROUP, FAR *LPDPMSG_ADDPLAYERTOGROUP; - -/* - * DPMSG_DELETEPLAYERFROMGROUP - * System message generated when a player is being - * removed from a group - */ -typedef DPMSG_ADDPLAYERTOGROUP DPMSG_DELETEPLAYERFROMGROUP; -typedef DPMSG_DELETEPLAYERFROMGROUP FAR *LPDPMSG_DELETEPLAYERFROMGROUP; - -/* - * DPMSG_ADDGROUPTOGROUP - * System message generated when a group is being added - * to a group. - */ -typedef struct -{ - DWORD dwType; // Message type - DPID dpIdParentGroup; // group ID being added to - DPID dpIdGroup; // group ID being added -} DPMSG_ADDGROUPTOGROUP, FAR *LPDPMSG_ADDGROUPTOGROUP; - -/* - * DPMSG_DELETEGROUPFROMGROUP - * System message generated when a GROUP is being - * removed from a group - */ -typedef DPMSG_ADDGROUPTOGROUP DPMSG_DELETEGROUPFROMGROUP; -typedef DPMSG_DELETEGROUPFROMGROUP FAR *LPDPMSG_DELETEGROUPFROMGROUP; - -/* - * DPMSG_SETPLAYERORGROUPDATA - * System message generated when remote data for a player or - * group has changed. - */ -typedef struct -{ - DWORD dwType; // Message type - DWORD dwPlayerType; // Is it a player or group - DPID dpId; // ID of player or group - LPVOID lpData; // pointer to remote data - DWORD dwDataSize; // size of remote data -} DPMSG_SETPLAYERORGROUPDATA, FAR *LPDPMSG_SETPLAYERORGROUPDATA; - -/* - * DPMSG_SETPLAYERORGROUPNAME - * System message generated when the name of a player or - * group has changed. - */ -typedef struct -{ - DWORD dwType; // Message type - DWORD dwPlayerType; // Is it a player or group - DPID dpId; // ID of player or group - DPNAME dpnName; // structure with new name info -} DPMSG_SETPLAYERORGROUPNAME, FAR *LPDPMSG_SETPLAYERORGROUPNAME; - -/* - * DPMSG_SETSESSIONDESC - * System message generated when session desc has changed - */ -typedef struct -{ - DWORD dwType; // Message type - DPSESSIONDESC2 dpDesc; // Session desc -} DPMSG_SETSESSIONDESC, FAR *LPDPMSG_SETSESSIONDESC; - -/* - * DPMSG_HOST - * System message generated when the host has migrated to this - * DirectPlay object. - * - */ -typedef DPMSG_GENERIC DPMSG_HOST; -typedef DPMSG_HOST FAR *LPDPMSG_HOST; - -/* - * DPMSG_SESSIONLOST - * System message generated when the connection to the session is lost. - * - */ -typedef DPMSG_GENERIC DPMSG_SESSIONLOST; -typedef DPMSG_SESSIONLOST FAR *LPDPMSG_SESSIONLOST; - -/* - * DPMSG_SECUREMESSAGE - * System message generated when a player requests a secure send - */ -typedef struct -{ - DWORD dwType; // Message Type - DWORD dwFlags; // Signed/Encrypted - DPID dpIdFrom; // ID of Sending Player - LPVOID lpData; // Player message - DWORD dwDataSize; // Size of player message -} DPMSG_SECUREMESSAGE, FAR *LPDPMSG_SECUREMESSAGE; - -/* - * DPMSG_STARTSESSION - * System message containing all information required to - * start a new session - */ -typedef struct -{ - DWORD dwType; // Message type - LPDPLCONNECTION lpConn; // DPLCONNECTION structure -} DPMSG_STARTSESSION, FAR *LPDPMSG_STARTSESSION; - -/* - * DPMSG_CHAT - * System message containing a chat message - */ -typedef struct -{ - DWORD dwType; // Message type - DWORD dwFlags; // Message flags - DPID idFromPlayer; // ID of the Sending Player - DPID idToPlayer; // ID of the To Player - DPID idToGroup; // ID of the To Group - LPDPCHAT lpChat; // Pointer to a structure containing the chat message -} DPMSG_CHAT, FAR *LPDPMSG_CHAT; - -/**************************************************************************** - * - * DIRECTPLAY ERRORS - * - * Errors are represented by negative values and cannot be combined. - * - ****************************************************************************/ -#define DP_OK S_OK -#define DPERR_ALREADYINITIALIZED MAKE_DPHRESULT( 5 ) -#define DPERR_ACCESSDENIED MAKE_DPHRESULT( 10 ) -#define DPERR_ACTIVEPLAYERS MAKE_DPHRESULT( 20 ) -#define DPERR_BUFFERTOOSMALL MAKE_DPHRESULT( 30 ) -#define DPERR_CANTADDPLAYER MAKE_DPHRESULT( 40 ) -#define DPERR_CANTCREATEGROUP MAKE_DPHRESULT( 50 ) -#define DPERR_CANTCREATEPLAYER MAKE_DPHRESULT( 60 ) -#define DPERR_CANTCREATESESSION MAKE_DPHRESULT( 70 ) -#define DPERR_CAPSNOTAVAILABLEYET MAKE_DPHRESULT( 80 ) -#define DPERR_EXCEPTION MAKE_DPHRESULT( 90 ) -#define DPERR_GENERIC E_FAIL -#define DPERR_INVALIDFLAGS MAKE_DPHRESULT( 120 ) -#define DPERR_INVALIDOBJECT MAKE_DPHRESULT( 130 ) -#define DPERR_INVALIDPARAM E_INVALIDARG -#define DPERR_INVALIDPARAMS DPERR_INVALIDPARAM -#define DPERR_INVALIDPLAYER MAKE_DPHRESULT( 150 ) -#define DPERR_INVALIDGROUP MAKE_DPHRESULT( 155 ) -#define DPERR_NOCAPS MAKE_DPHRESULT( 160 ) -#define DPERR_NOCONNECTION MAKE_DPHRESULT( 170 ) -#define DPERR_NOMEMORY E_OUTOFMEMORY -#define DPERR_OUTOFMEMORY DPERR_NOMEMORY -#define DPERR_NOMESSAGES MAKE_DPHRESULT( 190 ) -#define DPERR_NONAMESERVERFOUND MAKE_DPHRESULT( 200 ) -#define DPERR_NOPLAYERS MAKE_DPHRESULT( 210 ) -#define DPERR_NOSESSIONS MAKE_DPHRESULT( 220 ) -#define DPERR_PENDING E_PENDING -#define DPERR_SENDTOOBIG MAKE_DPHRESULT( 230 ) -#define DPERR_TIMEOUT MAKE_DPHRESULT( 240 ) -#define DPERR_UNAVAILABLE MAKE_DPHRESULT( 250 ) -#define DPERR_UNSUPPORTED E_NOTIMPL -#define DPERR_BUSY MAKE_DPHRESULT( 270 ) -#define DPERR_USERCANCEL MAKE_DPHRESULT( 280 ) -#define DPERR_NOINTERFACE E_NOINTERFACE -#define DPERR_CANNOTCREATESERVER MAKE_DPHRESULT( 290 ) -#define DPERR_PLAYERLOST MAKE_DPHRESULT( 300 ) -#define DPERR_SESSIONLOST MAKE_DPHRESULT( 310 ) -#define DPERR_UNINITIALIZED MAKE_DPHRESULT( 320 ) -#define DPERR_NONEWPLAYERS MAKE_DPHRESULT( 330 ) -#define DPERR_INVALIDPASSWORD MAKE_DPHRESULT( 340 ) -#define DPERR_CONNECTING MAKE_DPHRESULT( 350 ) - - -#define DPERR_BUFFERTOOLARGE MAKE_DPHRESULT( 1000 ) -#define DPERR_CANTCREATEPROCESS MAKE_DPHRESULT( 1010 ) -#define DPERR_APPNOTSTARTED MAKE_DPHRESULT( 1020 ) -#define DPERR_INVALIDINTERFACE MAKE_DPHRESULT( 1030 ) -#define DPERR_NOSERVICEPROVIDER MAKE_DPHRESULT( 1040 ) -#define DPERR_UNKNOWNAPPLICATION MAKE_DPHRESULT( 1050 ) -#define DPERR_NOTLOBBIED MAKE_DPHRESULT( 1070 ) -#define DPERR_SERVICEPROVIDERLOADED MAKE_DPHRESULT( 1080 ) -#define DPERR_ALREADYREGISTERED MAKE_DPHRESULT( 1090 ) -#define DPERR_NOTREGISTERED MAKE_DPHRESULT( 1100 ) - -// -// Security related errors -// -#define DPERR_AUTHENTICATIONFAILED MAKE_DPHRESULT( 2000 ) -#define DPERR_CANTLOADSSPI MAKE_DPHRESULT( 2010 ) -#define DPERR_ENCRYPTIONFAILED MAKE_DPHRESULT( 2020 ) -#define DPERR_SIGNFAILED MAKE_DPHRESULT( 2030 ) -#define DPERR_CANTLOADSECURITYPACKAGE MAKE_DPHRESULT( 2040 ) -#define DPERR_ENCRYPTIONNOTSUPPORTED MAKE_DPHRESULT( 2050 ) -#define DPERR_CANTLOADCAPI MAKE_DPHRESULT( 2060 ) -#define DPERR_NOTLOGGEDIN MAKE_DPHRESULT( 2070 ) -#define DPERR_LOGONDENIED MAKE_DPHRESULT( 2080 ) - - -/**************************************************************************** - * - * dplay 1.0 obsolete structures + interfaces - * Included for compatibility only. New apps should - * use IDirectPlay2 - * - ****************************************************************************/ - -// define this to ignore obsolete interfaces and constants -#ifndef IDIRECTPLAY2_OR_GREATER - -#define DPOPEN_OPENSESSION DPOPEN_JOIN -#define DPOPEN_CREATESESSION DPOPEN_CREATE - -#define DPENUMSESSIONS_PREVIOUS 0x00000004 - -#define DPENUMPLAYERS_PREVIOUS 0x00000004 - -#define DPSEND_GUARANTEE DPSEND_GUARANTEED -#define DPSEND_TRYONCE 0x00000004 - -#define DPCAPS_NAMESERVICE 0x00000001 -#define DPCAPS_NAMESERVER DPCAPS_ISHOST -#define DPCAPS_GUARANTEED 0x00000004 - -#define DPLONGNAMELEN 52 -#define DPSHORTNAMELEN 20 -#define DPSESSIONNAMELEN 32 -#define DPPASSWORDLEN 16 -#define DPUSERRESERVED 16 - -#define DPSYS_ADDPLAYER 0x0003 -#define DPSYS_DELETEPLAYER 0x0005 - -#define DPSYS_DELETEGROUP 0x0020 -#define DPSYS_DELETEPLAYERFROMGRP 0x0021 -#define DPSYS_CONNECT 0x484b - -typedef struct -{ - DWORD dwType; - DWORD dwPlayerType; - DPID dpId; - char szLongName[DPLONGNAMELEN]; - char szShortName[DPSHORTNAMELEN]; - DWORD dwCurrentPlayers; -} DPMSG_ADDPLAYER; - -typedef DPMSG_ADDPLAYER DPMSG_ADDGROUP; - -typedef struct -{ - DWORD dwType; - DPID dpIdGroup; - DPID dpIdPlayer; -} DPMSG_GROUPADD; - -typedef DPMSG_GROUPADD DPMSG_GROUPDELETE; -typedef struct -{ - DWORD dwType; - DPID dpId; -} DPMSG_DELETEPLAYER; - -typedef BOOL (PASCAL *LPDPENUMPLAYERSCALLBACK)( - DPID dpId, - LPSTR lpFriendlyName, - LPSTR lpFormalName, - DWORD dwFlags, - LPVOID lpContext ); - -typedef struct -{ - DWORD dwSize; - GUID guidSession; - DWORD dwSession; - DWORD dwMaxPlayers; - DWORD dwCurrentPlayers; - DWORD dwFlags; - char szSessionName[DPSESSIONNAMELEN]; - char szUserField[DPUSERRESERVED]; - DWORD dwReserved1; - char szPassword[DPPASSWORDLEN]; - DWORD dwReserved2; - DWORD dwUser1; - DWORD dwUser2; - DWORD dwUser3; - DWORD dwUser4; -} DPSESSIONDESC,*LPDPSESSIONDESC; - -typedef BOOL (PASCAL * LPDPENUMSESSIONSCALLBACK)( - LPDPSESSIONDESC lpDPSessionDesc, - LPVOID lpContext, - LPDWORD lpdwTimeOut, - DWORD dwFlags); - -/* - * IDirectPlay - */ -#undef INTERFACE -#define INTERFACE IDirectPlay -DECLARE_INTERFACE_( IDirectPlay, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlay methods ***/ - STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(Close) (THIS) PURE; - STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPSTR,LPSTR,LPHANDLE) PURE; - STDMETHOD(CreateGroup) (THIS_ LPDPID,LPSTR,LPSTR) PURE; - STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE; - STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE; - STDMETHOD(DestroyGroup) (THIS_ DPID) PURE; - STDMETHOD(EnableNewPlayers) (THIS_ BOOL) PURE; - STDMETHOD(EnumGroupPlayers) (THIS_ DPID, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroups) (THIS_ DWORD, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(EnumPlayers) (THIS_ DWORD, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC,DWORD,LPDPENUMSESSIONSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(GetCaps) (THIS_ LPDPCAPS) PURE; - STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE; - STDMETHOD(GetPlayerCaps) (THIS_ DPID, LPDPCAPS) PURE; - STDMETHOD(GetPlayerName) (THIS_ DPID,LPSTR,LPDWORD,LPSTR,LPDWORD) PURE; - STDMETHOD(Initialize) (THIS_ LPGUID) PURE; - STDMETHOD(Open) (THIS_ LPDPSESSIONDESC) PURE; - STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE; - STDMETHOD(SaveSession) (THIS_ LPSTR) PURE; - STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetPlayerName) (THIS_ DPID,LPSTR,LPSTR) PURE; -}; - -/**************************************************************************** - * - * IDirectPlay interface macros - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlay_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b) -#define IDirectPlay_Close(p) (p)->lpVtbl->Close(p) -#define IDirectPlay_CreateGroup(p,a,b,c) (p)->lpVtbl->CreateGroup(p,a,b,c) -#define IDirectPlay_CreatePlayer(p,a,b,c,d) (p)->lpVtbl->CreatePlayer(p,a,b,c,d) -#define IDirectPlay_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b) -#define IDirectPlay_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a) -#define IDirectPlay_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a) -#define IDirectPlay_EnableNewPlayers(p,a) (p)->lpVtbl->EnableNewPlayers(p,a) -#define IDirectPlay_EnumGroupPlayers(p,a,b,c,d) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d) -#define IDirectPlay_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d) -#define IDirectPlay_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d) -#define IDirectPlay_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e) -#define IDirectPlay_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirectPlay_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b) -#define IDirectPlay_GetPlayerCaps(p,a,b) (p)->lpVtbl->GetPlayerCaps(p,a,b) -#define IDirectPlay_GetPlayerName(p,a,b,c,d,e) (p)->lpVtbl->GetPlayerName(p,a,b,c,d,e) -#define IDirectPlay_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirectPlay_Open(p,a) (p)->lpVtbl->Open(p,a) -#define IDirectPlay_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e) -#define IDirectPlay_SaveSession(p,a) (p)->lpVtbl->SaveSession(p,a) -#define IDirectPlay_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e) -#define IDirectPlay_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c) - -#else /* C++ */ - -#define IDirectPlay_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b) -#define IDirectPlay_Close(p) (p)->Close() -#define IDirectPlay_CreateGroup(p,a,b,c) (p)->CreateGroup(a,b,c) -#define IDirectPlay_CreatePlayer(p,a,b,c,d) (p)->CreatePlayer(a,b,c,d) -#define IDirectPlay_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b) -#define IDirectPlay_DestroyGroup(p,a) (p)->DestroyGroup(a) -#define IDirectPlay_DestroyPlayer(p,a) (p)->DestroyPlayer(a) -#define IDirectPlay_EnableNewPlayers(p,a) (p)->EnableNewPlayers(a) -#define IDirectPlay_EnumGroupPlayers(p,a,b,c,d) (p)->EnumGroupPlayers(a,b,c,d) -#define IDirectPlay_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d) -#define IDirectPlay_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d) -#define IDirectPlay_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e) -#define IDirectPlay_GetCaps(p,a) (p)->GetCaps(a) -#define IDirectPlay_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b) -#define IDirectPlay_GetPlayerCaps(p,a,b) (p)->GetPlayerCaps(a,b) -#define IDirectPlay_GetPlayerName(p,a,b,c,d,e) (p)->GetPlayerName(a,b,c,d,e) -#define IDirectPlay_Initialize(p,a) (p)->Initialize(a) -#define IDirectPlay_Open(p,a) (p)->Open(a) -#define IDirectPlay_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e) -#define IDirectPlay_SaveSession(p,a) (p)->SaveSession(a) -#define IDirectPlay_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e) -#define IDirectPlay_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c) - -#endif - -DEFINE_GUID(IID_IDirectPlay, 0x5454e9a0, 0xdb65, 0x11ce, 0x92, 0x1c, 0x00, 0xaa, 0x00, 0x6c, 0x49, 0x72); - -#endif // IDIRECTPLAY2_OR_GREATER - -/**************************************************************************** - * - * IDirectPlay macros (included regardless of IDIRECTPLAY2_OR_GREATER flag) - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlay_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay_Release(p) (p)->lpVtbl->Release(p) - -#else - -#define IDirectPlay_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay_AddRef(p) (p)->AddRef() -#define IDirectPlay_Release(p) (p)->Release() - -#endif // IDirectPlay interface macros - -#ifdef __cplusplus -}; -#endif - -#endif - diff --git a/include/vdplobby.h b/include/vdplobby.h deleted file mode 100644 index e6448b4..0000000 --- a/include/vdplobby.h +++ /dev/null @@ -1,628 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved. - * - * File: dplobby.h - * Content: DirectPlayLobby include file - ***************************************************************************/ -#ifndef __DPLOBBY_INCLUDED__ -#define __DPLOBBY_INCLUDED__ - -#include "vdplay.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* - * GUIDS used by DirectPlay objects - */ - -/* {AF465C71-9588-11cf-A020-00AA006157AC} */ -DEFINE_GUID(IID_IDirectPlayLobby, 0xaf465c71, 0x9588, 0x11cf, 0xa0, 0x20, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac); -/* {26C66A70-B367-11cf-A024-00AA006157AC} */ -DEFINE_GUID(IID_IDirectPlayLobbyA, 0x26c66a70, 0xb367, 0x11cf, 0xa0, 0x24, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac); -/* {0194C220-A303-11d0-9C4F-00A0C905425E} */ -DEFINE_GUID(IID_IDirectPlayLobby2, 0x194c220, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); -/* {1BB4AF80-A303-11d0-9C4F-00A0C905425E} */ -DEFINE_GUID(IID_IDirectPlayLobby2A, 0x1bb4af80, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); -/* {2FE8F810-B2A5-11d0-A787-0000F803ABFC} */ -DEFINE_GUID(CLSID_DirectPlayLobby, 0x2fe8f810, 0xb2a5, 0x11d0, 0xa7, 0x87, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); - - -/**************************************************************************** - * - * IDirectPlayLobby Structures - * - * Various structures used to invoke DirectPlayLobby. - * - ****************************************************************************/ - -typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBY; -typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBYA; -typedef struct IDirectPlayLobby IDirectPlayLobbyA; - -typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2; -typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2A; -typedef struct IDirectPlayLobby2 IDirectPlayLobby2A; - - -/* - * DPLAPPINFO - * Used to hold information about a registered DirectPlay - * application - */ -typedef struct DPLAPPINFO -{ - DWORD dwSize; // Size of this structure - GUID guidApplication; // GUID of the Application - union - { - LPSTR lpszAppNameA; // Pointer to the Application Name - LPWSTR lpszAppName; - }; - -} DPLAPPINFO, FAR *LPDPLAPPINFO; - -/* - * LPCDPLAPPINFO - * A constant pointer to DPLAPPINFO - */ -typedef const DPLAPPINFO FAR *LPCDPLAPPINFO; - -/* - * DPCOMPOUNDADDRESSELEMENT - * - * An array of these is passed to CreateCompoundAddresses() - */ -typedef struct DPCOMPOUNDADDRESSELEMENT -{ - GUID guidDataType; - DWORD dwDataSize; - LPVOID lpData; -} DPCOMPOUNDADDRESSELEMENT, FAR *LPDPCOMPOUNDADDRESSELEMENT; - -/* - * LPCDPCOMPOUNDADDRESSELEMENT - * A constant pointer to DPCOMPOUNDADDRESSELEMENT - */ -typedef const DPCOMPOUNDADDRESSELEMENT FAR *LPCDPCOMPOUNDADDRESSELEMENT; - - -/**************************************************************************** - * - * Enumeration Method Callback Prototypes - * - ****************************************************************************/ - -/* - * Callback for EnumAddress() - */ -typedef BOOL (FAR PASCAL *LPDPENUMADDRESSCALLBACK)( - REFGUID guidDataType, - DWORD dwDataSize, - LPCVOID lpData, - LPVOID lpContext); - -/* - * Callback for EnumAddressTypes() - */ -typedef BOOL (FAR PASCAL *LPDPLENUMADDRESSTYPESCALLBACK)( - REFGUID guidDataType, - LPVOID lpContext, - DWORD dwFlags); - -/* - * Callback for EnumLocalApplications() - */ -typedef BOOL (FAR PASCAL * LPDPLENUMLOCALAPPLICATIONSCALLBACK)( - LPCDPLAPPINFO lpAppInfo, - LPVOID lpContext, - DWORD dwFlags); - - -/**************************************************************************** - * - * DirectPlayLobby API Prototypes - * - ****************************************************************************/ -#ifdef UNICODE -#define DirectPlayLobbyCreate DirectPlayLobbyCreateW -#else -#define DirectPlayLobbyCreate DirectPlayLobbyCreateA -#endif /* UNICODE */ - -extern HRESULT WINAPI DirectPlayLobbyCreateW(LPGUID, LPDIRECTPLAYLOBBY *, IUnknown *, LPVOID, DWORD ); -extern HRESULT WINAPI DirectPlayLobbyCreateA(LPGUID, LPDIRECTPLAYLOBBYA *, IUnknown *, LPVOID, DWORD ); - - -/**************************************************************************** - * - * IDirectPlayLobby (and IDirectPlayLobbyA) Interface - * - ****************************************************************************/ -#undef INTERFACE -#define INTERFACE IDirectPlayLobby -DECLARE_INTERFACE_( IDirectPlayLobby, IUnknown ) -{ - /* IUnknown Methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectPlayLobby Methods */ - STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE; - STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE; - STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE; - STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE; - STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE; - STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE; - STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE; - -}; - -/**************************************************************************** - * - * IDirectPlayLobby2 (and IDirectPlayLobby2A) Interface - * - ****************************************************************************/ -#undef INTERFACE -#define INTERFACE IDirectPlayLobby2 -DECLARE_INTERFACE_( IDirectPlayLobby2, IDirectPlayLobby ) -{ - /* IUnknown Methods */ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectPlayLobby Methods */ - STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE; - STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE; - STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE; - STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE; - STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE; - STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE; - STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE; - - /* IDirectPlayLobby2 Methods */ - STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE; -}; - -/**************************************************************************** - * - * IDirectPlayLobby interface macros - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlayLobby_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlayLobby_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlayLobby_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlayLobby_Connect(p,a,b,c) (p)->lpVtbl->Connect(p,a,b,c) -#define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->lpVtbl->CreateAddress(p,a,b,c,d,e,f) -#define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->lpVtbl->CreateCompoundAddress(p,a,b,c,d) -#define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->lpVtbl->EnumAddress(p,a,b,c,d) -#define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->lpVtbl->EnumAddressTypes(p,a,b,c,d) -#define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->lpVtbl->EnumLocalApplications(p,a,b,c) -#define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->lpVtbl->GetConnectionSettings(p,a,b,c) -#define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->lpVtbl->ReceiveLobbyMessage(p,a,b,c,d,e) -#define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->lpVtbl->RunApplication(p,a,b,c,d) -#define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->lpVtbl->SendLobbyMessage(p,a,b,c,d) -#define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c) -#define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->lpVtbl->SetLobbyMessageEvent(p,a,b,c) - -#else /* C++ */ - -#define IDirectPlayLobby_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlayLobby_AddRef(p) (p)->AddRef() -#define IDirectPlayLobby_Release(p) (p)->Release() -#define IDirectPlayLobby_Connect(p,a,b,c) (p)->Connect(a,b,c) -#define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->CreateAddress(a,b,c,d,e,f) -#define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->lpVtbl->CreateCompoundAddress(a,b,c,d) -#define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->EnumAddress(a,b,c,d) -#define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->EnumAddressTypes(a,b,c,d) -#define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->EnumLocalApplications(a,b,c) -#define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->GetConnectionSettings(a,b,c) -#define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->ReceiveLobbyMessage(a,b,c,d,e) -#define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->RunApplication(a,b,c,d) -#define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->SendLobbyMessage(a,b,c,d) -#define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c) -#define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->SetLobbyMessageEvent(a,b,c) - -#endif - -/**************************************************************************** - * - * DirectPlayLobby Flags - * - ****************************************************************************/ - -/* - * This is a message flag used by ReceiveLobbyMessage. It can be - * returned in the dwMessageFlags parameter to indicate a message from - * the system. - */ -#define DPLMSG_SYSTEM 0x00000001 - -/* - * This is a message flag used by ReceiveLobbyMessage and SendLobbyMessage. - * It is used to indicate that the message is a standard lobby message. - * DPLMSG_SETPROPERTY, DPLMSG_SETPROPERTYRESPONSE, DPLMSG_GETPROPERTY, - * DPLMSG_GETPROPERTYRESPONSE - */ -#define DPLMSG_STANDARD 0x00000002 - - -/**************************************************************************** - * - * DirectPlayLobby messages and message data structures - * - * All system messages have a dwMessageFlags value of DPLMSG_SYSTEM returned - * from a call to ReceiveLobbyMessage. - * - * All standard messages have a dwMessageFlags value of DPLMSG_STANDARD returned - * from a call to ReceiveLobbyMessage. - * - ****************************************************************************/ - -/* - * DPLMSG_GENERIC - * Generic message structure used to identify the message type. - */ -typedef struct _DPLMSG_GENERIC -{ - DWORD dwType; // Message type -} DPLMSG_GENERIC, FAR *LPDPLMSG_GENERIC; - -/* - * DPLMSG_SETPROPERTY - * Standard message sent by an application to a lobby to set a - * property - */ -typedef struct _DPLMSG_SETPROPERTY -{ - DWORD dwType; // Message type - DWORD dwRequestID; // Request ID (DPL_NOCONFIRMATION if no confirmation desired) - GUID guidPlayer; // Player GUID - GUID guidPropertyTag; // Property GUID - DWORD dwDataSize; // Size of data - DWORD dwPropertyData[1]; // Buffer containing data -} DPLMSG_SETPROPERTY, FAR *LPDPLMSG_SETPROPERTY; - -#define DPL_NOCONFIRMATION 0 - -/* - * DPLMSG_SETPROPERTYRESPONSE - * Standard message returned by a lobby to confirm a - * DPLMSG_SETPROPERTY message. - */ -typedef struct _DPLMSG_SETPROPERTYRESPONSE -{ - DWORD dwType; // Message type - DWORD dwRequestID; // Request ID - GUID guidPlayer; // Player GUID - GUID guidPropertyTag; // Property GUID - HRESULT hr; // Return Code -} DPLMSG_SETPROPERTYRESPONSE, FAR *LPDPLMSG_SETPROPERTYRESPONSE; - -/* - * DPLMSG_GETPROPERTY - * Standard message sent by an application to a lobby to request - * the current value of a property - */ -typedef struct _DPLMSG_GETPROPERTY -{ - DWORD dwType; // Message type - DWORD dwRequestID; // Request ID - GUID guidPlayer; // Player GUID - GUID guidPropertyTag; // Property GUID -} DPLMSG_GETPROPERTY, FAR *LPDPLMSG_GETPROPERTY; - -/* - * DPLMSG_GETPROPERTYRESPONSE - * Standard message returned by a lobby in response to a - * DPLMSG_GETPROPERTY message. - */ -typedef struct _DPLMSG_GETPROPERTYRESPONSE -{ - DWORD dwType; // Message type - DWORD dwRequestID; // Request ID - GUID guidPlayer; // Player GUID - GUID guidPropertyTag; // Property GUID - HRESULT hr; // Return Code - DWORD dwDataSize; // Size of data - DWORD dwPropertyData[1]; // Buffer containing data -} DPLMSG_GETPROPERTYRESPONSE, FAR *LPDPLMSG_GETPROPERTYRESPONSE; - - -/****************************************** - * - * DirectPlay Lobby message dwType values - * - *****************************************/ - -/* - * The application has read the connection settings. - * It is now O.K. for the lobby client to release - * its IDirectPlayLobby interface. - */ -#define DPLSYS_CONNECTIONSETTINGSREAD 0x00000001 - -/* - * The application's call to DirectPlayConnect failed - */ -#define DPLSYS_DPLAYCONNECTFAILED 0x00000002 - -/* - * The application has created a DirectPlay session. - */ -#define DPLSYS_DPLAYCONNECTSUCCEEDED 0x00000003 - -/* - * The application has terminated. - */ -#define DPLSYS_APPTERMINATED 0x00000004 - -/* - * The message is a DPLMSG_SETPROPERTY message. - */ -#define DPLSYS_SETPROPERTY 0x00000005 - -/* - * The message is a DPLMSG_SETPROPERTYRESPONSE message. - */ -#define DPLSYS_SETPROPERTYRESPONSE 0x00000006 - -/* - * The message is a DPLMSG_GETPROPERTY message. - */ -#define DPLSYS_GETPROPERTY 0x00000007 - -/* - * The message is a DPLMSG_GETPROPERTYRESPONSE message. - */ -#define DPLSYS_GETPROPERTYRESPONSE 0x00000008 - - -/**************************************************************************** - * - * DirectPlay defined property GUIDs and associated data structures - * - ****************************************************************************/ - -/* - * DPLPROPERTY_MessagesSupported - * - * Request whether the lobby supports standard. Lobby with respond with either - * TRUE or FALSE or may not respond at all. - * - * Property data is a single BOOL with TRUE or FALSE - */ -// {762CCDA1-D916-11d0-BA39-00C04FD7ED67} -DEFINE_GUID(DPLPROPERTY_MessagesSupported, -0x762ccda1, 0xd916, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67); - -/* - * DPLPROPERTY_LobbyGuid - * - * Request the GUID that identifies the lobby software that the application - * is communicating with. - * - * Property data is a single GUID. - */ -// {F56920A0-D218-11d0-BA39-00C04FD7ED67} -DEFINE_GUID(DPLPROPERTY_LobbyGuid, -0xf56920a0, 0xd218, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67); - -/* - * DPLPROPERTY_PlayerGuid - * - * Request the GUID that identifies the player on this machine for sending - * property data back to the lobby. - * - * Property data is the DPLDATA_PLAYERDATA structure - */ -// {B4319322-D20D-11d0-BA39-00C04FD7ED67} -DEFINE_GUID(DPLPROPERTY_PlayerGuid, -0xb4319322, 0xd20d, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67); - -/* - * DPLDATA_PLAYERGUID - * - * Data structure to hold the GUID of the player and player creation flags - * from the lobby. - */ -typedef struct _DPLDATA_PLAYERGUID -{ - GUID guidPlayer; - DWORD dwPlayerFlags; -} DPLDATA_PLAYERGUID, FAR *LPDPLDATA_PLAYERGUID; - -/* - * DPLPROPERTY_PlayerScore - * - * Used to send an array of long integers to the lobby indicating the - * score of a player. - * - * Property data is the DPLDATA_PLAYERSCORE structure. - */ -// {48784000-D219-11d0-BA39-00C04FD7ED67} -DEFINE_GUID(DPLPROPERTY_PlayerScore, -0x48784000, 0xd219, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67); - -/* - * DPLDATA_PLAYERSCORE - * - * Data structure to hold an array of long integers representing a player score. - * Application must allocate enough memory to hold all the scores. - */ -typedef struct _DPLDATA_PLAYERSCORE -{ - DWORD dwScoreCount; - LONG Score[1]; -} DPLDATA_PLAYERSCORE, FAR *LPDPLDATA_PLAYERSCORE; - -/**************************************************************************** - * - * DirectPlay Address ID's - * - ****************************************************************************/ - -/* DirectPlay Address - * - * A DirectPlay address consists of multiple chunks of data, each tagged - * with a GUID signifying the type of data in the chunk. The chunk also - * has a length so that unknown chunk types can be skipped. - * - * The EnumAddress() function is used to parse these address data chunks. - */ - -/* - * DPADDRESS - * - * Header for block of address data elements - */ -typedef struct _DPADDRESS -{ - GUID guidDataType; - DWORD dwDataSize; -} DPADDRESS; - -typedef DPADDRESS FAR *LPDPADDRESS; - -/* - * DPAID_TotalSize - * - * Chunk is a DWORD containing size of entire DPADDRESS structure - */ - -// {1318F560-912C-11d0-9DAA-00A0C90A43CB} -DEFINE_GUID(DPAID_TotalSize, -0x1318f560, 0x912c, 0x11d0, 0x9d, 0xaa, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); - -/* - * DPAID_ServiceProvider - * - * Chunk is a GUID describing the service provider that created the chunk. - * All addresses must contain this chunk. - */ - -// {07D916C0-E0AF-11cf-9C4E-00A0C905425E} -DEFINE_GUID(DPAID_ServiceProvider, -0x7d916c0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -/* - * DPAID_LobbyProvider - * - * Chunk is a GUID describing the lobby provider that created the chunk. - * All addresses must contain this chunk. - */ - -// {59B95640-9667-11d0-A77D-0000F803ABFC} -DEFINE_GUID(DPAID_LobbyProvider, -0x59b95640, 0x9667, 0x11d0, 0xa7, 0x7d, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); - -/* - * DPAID_Phone and DPAID_PhoneW - * - * Chunk is a string containing a phone number (i.e. "1-800-555-1212") - * in ANSI or UNICODE format - */ - -// {78EC89A0-E0AF-11cf-9C4E-00A0C905425E} -DEFINE_GUID(DPAID_Phone, -0x78ec89a0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -// {BA5A7A70-9DBF-11d0-9CC1-00A0C905425E} -DEFINE_GUID(DPAID_PhoneW, -0xba5a7a70, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -/* - * DPAID_Modem and DPAID_ModemW - * - * Chunk is a string containing a modem name registered with TAPI - * in ANSI or UNICODE format - */ - -// {F6DCC200-A2FE-11d0-9C4F-00A0C905425E} -DEFINE_GUID(DPAID_Modem, -0xf6dcc200, 0xa2fe, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -// {01FD92E0-A2FF-11d0-9C4F-00A0C905425E} -DEFINE_GUID(DPAID_ModemW, -0x1fd92e0, 0xa2ff, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -/* - * DPAID_Inet and DPAID_InetW - * - * Chunk is a string containing a TCP/IP host name or an IP address - * (i.e. "dplay.microsoft.com" or "137.55.100.173") in ANSI or UNICODE format - */ - -// {C4A54DA0-E0AF-11cf-9C4E-00A0C905425E} -DEFINE_GUID(DPAID_INet, -0xc4a54da0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -// {E63232A0-9DBF-11d0-9CC1-00A0C905425E} -DEFINE_GUID(DPAID_INetW, -0xe63232a0, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -/* - * DPCOMPORTADDRESS - * - * Used to specify com port settings. The constants that define baud rate, - * stop bits and parity are defined in WINBASE.H. The constants for flow - * control are given below. - */ - -#define DPCPA_NOFLOW 0 // no flow control -#define DPCPA_XONXOFFFLOW 1 // software flow control -#define DPCPA_RTSFLOW 2 // hardware flow control with RTS -#define DPCPA_DTRFLOW 3 // hardware flow control with DTR -#define DPCPA_RTSDTRFLOW 4 // hardware flow control with RTS and DTR - -typedef struct _DPCOMPORTADDRESS -{ - DWORD dwComPort; // COM port to use (1-4) - DWORD dwBaudRate; // baud rate (100-256k) - DWORD dwStopBits; // no. stop bits (1-2) - DWORD dwParity; // parity (none, odd, even, mark) - DWORD dwFlowControl; // flow control (none, xon/xoff, rts, dtr) -} DPCOMPORTADDRESS; - -typedef DPCOMPORTADDRESS FAR *LPDPCOMPORTADDRESS; - -/* - * DPAID_ComPort - * - * Chunk contains a DPCOMPORTADDRESS structure defining the serial port. - */ - -// {F2F0CE00-E0AF-11cf-9C4E-00A0C905425E} -DEFINE_GUID(DPAID_ComPort, -0xf2f0ce00, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -/**************************************************************************** - * - * dplobby 1.0 obsolete definitions - * Included for compatibility only. - * - ****************************************************************************/ -#define DPLAD_SYSTEM DPLMSG_SYSTEM - - -#ifdef __cplusplus -}; -#endif /* __cplusplus */ - -#endif /* __DPLOBBY_INCLUDED__ */ - diff --git a/include/vdsetup.h b/include/vdsetup.h deleted file mode 100644 index 566def1..0000000 --- a/include/vdsetup.h +++ /dev/null @@ -1,268 +0,0 @@ -/*========================================================================== - * - * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. - * - * File: dsetup.h - * Content: DirectXSetup, error codes and flags - ***************************************************************************/ - -#ifndef __DSETUP_H__ -#define __DSETUP_H__ - -#include // windows stuff - -#ifdef _WIN32 -#define COM_NO_WINDOWS_H -#include -#else -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -// DSETUP Error Codes, must remain compatible with previous setup. -#define DSETUPERR_SUCCESS_RESTART 1 -#define DSETUPERR_SUCCESS 0 -#define DSETUPERR_BADWINDOWSVERSION -1 -#define DSETUPERR_SOURCEFILENOTFOUND -2 -#define DSETUPERR_BADSOURCESIZE -3 -#define DSETUPERR_BADSOURCETIME -4 -#define DSETUPERR_NOCOPY -5 -#define DSETUPERR_OUTOFDISKSPACE -6 -#define DSETUPERR_CANTFINDINF -7 -#define DSETUPERR_CANTFINDDIR -8 -#define DSETUPERR_INTERNAL -9 -#define DSETUPERR_NTWITHNO3D -10 /* REM: obsolete, you'll never see this */ -#define DSETUPERR_UNKNOWNOS -11 -#define DSETUPERR_USERHITCANCEL -12 -#define DSETUPERR_NOTPREINSTALLEDONNT -13 - -// DSETUP flags. DirectX 5.0 apps should use these flags only. -#define DSETUP_DDRAWDRV 0x00000008 /* install DirectDraw Drivers */ -#define DSETUP_DSOUNDDRV 0x00000010 /* install DirectSound Drivers */ -#define DSETUP_DXCORE 0x00010000 /* install DirectX runtime */ -#define DSETUP_DIRECTX (DSETUP_DXCORE|DSETUP_DDRAWDRV|DSETUP_DSOUNDDRV) -#define DSETUP_TESTINSTALL 0x00020000 /* just test install, don't do anything */ - -// These OBSOLETE flags are here for compatibility with pre-DX5 apps only. -// They are present to allow DX3 apps to be recompiled with DX5 and still work. -// DO NOT USE THEM for DX5. They will go away in future DX releases. -#define DSETUP_DDRAW 0x00000001 /* OBSOLETE. install DirectDraw */ -#define DSETUP_DSOUND 0x00000002 /* OBSOLETE. install DirectSound */ -#define DSETUP_DPLAY 0x00000004 /* OBSOLETE. install DirectPlay */ -#define DSETUP_DPLAYSP 0x00000020 /* OBSOLETE. install DirectPlay Providers */ -#define DSETUP_DVIDEO 0x00000040 /* OBSOLETE. install DirectVideo */ -#define DSETUP_D3D 0x00000200 /* OBSOLETE. install Direct3D */ -#define DSETUP_DINPUT 0x00000800 /* OBSOLETE. install DirectInput */ -#define DSETUP_DIRECTXSETUP 0x00001000 /* OBSOLETE. install DirectXSetup DLL's */ -#define DSETUP_NOUI 0x00002000 /* OBSOLETE. install DirectX with NO UI */ -#define DSETUP_PROMPTFORDRIVERS 0x10000000 /* OBSOLETE. prompt when replacing display/audio drivers */ -#define DSETUP_RESTOREDRIVERS 0x20000000 /* OBSOLETE. restore display/audio drivers */ - - - -//****************************************************************** -// DirectX Setup Callback mechanism -//****************************************************************** - -// DSETUP Message Info Codes, passed to callback as Reason parameter. -#define DSETUP_CB_MSG_NOMESSAGE 0 -#define DSETUP_CB_MSG_CANTINSTALL_UNKNOWNOS 1 -#define DSETUP_CB_MSG_CANTINSTALL_NT 2 -#define DSETUP_CB_MSG_CANTINSTALL_BETA 3 -#define DSETUP_CB_MSG_CANTINSTALL_NOTWIN32 4 -#define DSETUP_CB_MSG_CANTINSTALL_WRONGLANGUAGE 5 -#define DSETUP_CB_MSG_CANTINSTALL_WRONGPLATFORM 6 -#define DSETUP_CB_MSG_PREINSTALL_NT 7 -#define DSETUP_CB_MSG_NOTPREINSTALLEDONNT 8 -#define DSETUP_CB_MSG_SETUP_INIT_FAILED 9 -#define DSETUP_CB_MSG_INTERNAL_ERROR 10 -#define DSETUP_CB_MSG_CHECK_DRIVER_UPGRADE 11 -#define DSETUP_CB_MSG_OUTOFDISKSPACE 12 -#define DSETUP_CB_MSG_BEGIN_INSTALL 13 -#define DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME 14 -#define DSETUP_CB_MSG_BEGIN_INSTALL_DRIVERS 15 -#define DSETUP_CB_MSG_BEGIN_RESTORE_DRIVERS 16 -#define DSETUP_CB_MSG_FILECOPYERROR 17 - - -#define DSETUP_CB_UPGRADE_TYPE_MASK 0x000F -#define DSETUP_CB_UPGRADE_KEEP 0x0001 -#define DSETUP_CB_UPGRADE_SAFE 0x0002 -#define DSETUP_CB_UPGRADE_FORCE 0x0004 -#define DSETUP_CB_UPGRADE_UNKNOWN 0x0008 - -#define DSETUP_CB_UPGRADE_HASWARNINGS 0x0100 -#define DSETUP_CB_UPGRADE_CANTBACKUP 0x0200 - -#define DSETUP_CB_UPGRADE_DEVICE_ACTIVE 0x0800 - -#define DSETUP_CB_UPGRADE_DEVICE_DISPLAY 0x1000 -#define DSETUP_CB_UPGRADE_DEVICE_MEDIA 0x2000 - - -typedef struct _DSETUP_CB_UPGRADEINFO -{ - DWORD UpgradeFlags; -} DSETUP_CB_UPGRADEINFO; - -typedef struct _DSETUP_CB_FILECOPYERROR -{ - DWORD dwError; -} DSETUP_CB_FILECOPYERROR; - - -#ifdef _WIN32 -// -// Data Structures -// -#ifndef UNICODE_ONLY -typedef struct _DIRECTXREGISTERAPPA { - DWORD dwSize; - DWORD dwFlags; - LPSTR lpszApplicationName; - LPGUID lpGUID; - LPSTR lpszFilename; - LPSTR lpszCommandLine; - LPSTR lpszPath; - LPSTR lpszCurrentDirectory; -} DIRECTXREGISTERAPPA, *PDIRECTXREGISTERAPPA, *LPDIRECTXREGISTERAPPA; -#endif //!UNICODE_ONLY -#ifndef ANSI_ONLY -typedef struct _DIRECTXREGISTERAPPW { - DWORD dwSize; - DWORD dwFlags; - LPWSTR lpszApplicationName; - LPGUID lpGUID; - LPWSTR lpszFilename; - LPWSTR lpszCommandLine; - LPWSTR lpszPath; - LPWSTR lpszCurrentDirectory; -} DIRECTXREGISTERAPPW, *PDIRECTXREGISTERAPPW, *LPDIRECTXREGISTERAPPW; -#endif //!ANSI_ONLY -#ifdef UNICODE -typedef DIRECTXREGISTERAPPW DIRECTXREGISTERAPP; -typedef PDIRECTXREGISTERAPPW PDIRECTXREGISTERAPP; -typedef LPDIRECTXREGISTERAPPW LPDIRECTXREGISTERAPP; -#else -typedef DIRECTXREGISTERAPPA DIRECTXREGISTERAPP; -typedef PDIRECTXREGISTERAPPA PDIRECTXREGISTERAPP; -typedef LPDIRECTXREGISTERAPPA LPDIRECTXREGISTERAPP; -#endif // UNICODE - - -// -// API -// -#ifndef UNICODE_ONLY -INT -WINAPI -DirectXSetupA( - HWND hWnd, - LPSTR lpszRootPath, - DWORD dwFlags - ); -#endif //!UNICODE_ONLY -#ifndef ANSI_ONLY -INT -WINAPI -DirectXSetupW( - HWND hWnd, - LPWSTR lpszRootPath, - DWORD dwFlags - ); -#endif //!ANSI_ONLY -#ifdef UNICODE -#define DirectXSetup DirectXSetupW -#else -#define DirectXSetup DirectXSetupA -#endif // !UNICODE - -#ifndef UNICODE_ONLY -INT -WINAPI -DirectXDeviceDriverSetupA( - HWND hWnd, - LPSTR lpszDriverClass, - LPSTR lpszDriverPath, - DWORD dwFlags - ); -#endif //!UNICODE_ONLY -#ifndef ANSI_ONLY -INT -WINAPI -DirectXDeviceDriverSetupW( - HWND hWnd, - LPWSTR lpszDriverClass, - LPWSTR lpszDriverPath, - DWORD dwFlags - ); -#endif //!ANSI_ONLY -#ifdef UNICODE -#define DirectXDeviceDriverSetup DirectXDeviceDriverSetupW -#else -#define DirectXDeviceDriverSetup DirectXDeviceDriverSetupA -#endif // !UNICODE - -#ifndef UNICODE_ONLY -INT -WINAPI -DirectXRegisterApplicationA( - HWND hWnd, - LPDIRECTXREGISTERAPPA lpDXRegApp - ); -#endif //!UNICODE_ONLY -#ifndef ANSI_ONLY -INT -WINAPI -DirectXRegisterApplicationW( - HWND hWnd, - LPDIRECTXREGISTERAPPW lpDXRegApp - ); -#endif //!ANSI_ONLY -#ifdef UNICODE -#define DirectXRegisterApplication DirectXRegisterApplicationW -#else -#define DirectXRegisterApplication DirectXRegisterApplicationA -#endif // !UNICODE - -INT -WINAPI -DirectXUnRegisterApplication( - HWND hWnd, - LPGUID lpGUID - ); - -// -// Function Pointers -// -#ifdef UNICODE -typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPWSTR, DWORD); -typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPWSTR, LPSTR, DWORD); -typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPDIRECTXREGISTERAPPW); -#else -typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPSTR, DWORD); -typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPSTR, LPSTR, DWORD); -typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPDIRECTXREGISTERAPPA); -#endif // UNICODE - -typedef DWORD (FAR PASCAL * DSETUP_CALLBACK)(DWORD Reason, - DWORD MsgType, /* Same as flags to MessageBox */ - LPSTR szMessage, - LPSTR szName, - void *pInfo); - -INT WINAPI DirectXSetupSetCallback(DSETUP_CALLBACK Callback); -INT WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion); - -#endif // WIN32 - - -#ifdef __cplusplus -}; -#endif - -#endif - diff --git a/include/vdsound.h b/include/vdsound.h deleted file mode 100644 index 878cd5a..0000000 --- a/include/vdsound.h +++ /dev/null @@ -1,864 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1995,1996 Microsoft Corporation. All Rights Reserved. - * - * File: dsound.h - * Content: DirectSound include file - * - **************************************************************************/ - -#ifndef __DSOUND_INCLUDED__ -#define __DSOUND_INCLUDED__ - -#include "vd3dtypes.h" - -#define COM_NO_WINDOWS_H -#include - -#define _FACDS 0x878 -#define MAKE_DSHRESULT(code) MAKE_HRESULT(1, _FACDS, code) - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -// Direct Sound Component GUID {47D4D946-62E8-11cf-93BC-444553540000} -DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); - -// DirectSound Capture Component GUID {B0210780-89CD-11d0-AF08-00A0C925CD16} -DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); - -// -// Structures -// - -#ifdef __cplusplus -// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined -struct IDirectSound; -struct IDirectSoundBuffer; -struct IDirectSound3DListener; -struct IDirectSound3DBuffer; -struct IDirectSoundCapture; -struct IDirectSoundCaptureBuffer; -struct IDirectSoundNotify; -#endif // __cplusplus - -typedef struct IDirectSound *LPDIRECTSOUND; -typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER; -typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER; -typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER; -typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE; -typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER; -typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY; - -typedef struct _DSCAPS -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwMinSecondarySampleRate; - DWORD dwMaxSecondarySampleRate; - DWORD dwPrimaryBuffers; - DWORD dwMaxHwMixingAllBuffers; - DWORD dwMaxHwMixingStaticBuffers; - DWORD dwMaxHwMixingStreamingBuffers; - DWORD dwFreeHwMixingAllBuffers; - DWORD dwFreeHwMixingStaticBuffers; - DWORD dwFreeHwMixingStreamingBuffers; - DWORD dwMaxHw3DAllBuffers; - DWORD dwMaxHw3DStaticBuffers; - DWORD dwMaxHw3DStreamingBuffers; - DWORD dwFreeHw3DAllBuffers; - DWORD dwFreeHw3DStaticBuffers; - DWORD dwFreeHw3DStreamingBuffers; - DWORD dwTotalHwMemBytes; - DWORD dwFreeHwMemBytes; - DWORD dwMaxContigFreeHwMemBytes; - DWORD dwUnlockTransferRateHwBuffers; - DWORD dwPlayCpuOverheadSwBuffers; - DWORD dwReserved1; - DWORD dwReserved2; -} DSCAPS, *LPDSCAPS; - -typedef const DSCAPS *LPCDSCAPS; - -typedef struct _DSBCAPS -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwBufferBytes; - DWORD dwUnlockTransferRate; - DWORD dwPlayCpuOverhead; -} DSBCAPS, *LPDSBCAPS; - -typedef const DSBCAPS *LPCDSBCAPS; - -typedef struct _DSBUFFERDESC -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwBufferBytes; - DWORD dwReserved; - LPWAVEFORMATEX lpwfxFormat; -} DSBUFFERDESC, *LPDSBUFFERDESC; - -typedef const DSBUFFERDESC *LPCDSBUFFERDESC; - -typedef struct _DS3DBUFFER -{ - DWORD dwSize; - D3DVECTOR vPosition; - D3DVECTOR vVelocity; - DWORD dwInsideConeAngle; - DWORD dwOutsideConeAngle; - D3DVECTOR vConeOrientation; - LONG lConeOutsideVolume; - D3DVALUE flMinDistance; - D3DVALUE flMaxDistance; - DWORD dwMode; -} DS3DBUFFER, *LPDS3DBUFFER; - -typedef const DS3DBUFFER *LPCDS3DBUFFER; - -typedef struct _DS3DLISTENER -{ - DWORD dwSize; - D3DVECTOR vPosition; - D3DVECTOR vVelocity; - D3DVECTOR vOrientFront; - D3DVECTOR vOrientTop; - D3DVALUE flDistanceFactor; - D3DVALUE flRolloffFactor; - D3DVALUE flDopplerFactor; -} DS3DLISTENER, *LPDS3DLISTENER; - -typedef const DS3DLISTENER *LPCDS3DLISTENER; - -typedef struct _DSCCAPS -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwFormats; - DWORD dwChannels; -} DSCCAPS, *LPDSCCAPS; - -typedef const DSCCAPS *LPCDSCCAPS; - -typedef struct _DSCBUFFERDESC -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwBufferBytes; - DWORD dwReserved; - LPWAVEFORMATEX lpwfxFormat; -} DSCBUFFERDESC, *LPDSCBUFFERDESC; - -typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC; - -typedef struct _DSCBCAPS -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwBufferBytes; - DWORD dwReserved; -} DSCBCAPS, *LPDSCBCAPS; - -typedef const DSCBCAPS *LPCDSCBCAPS; - -typedef struct _DSBPOSITIONNOTIFY -{ - DWORD dwOffset; - HANDLE hEventNotify; -} DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY; - -typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY; - -// -// Compatibility typedefs -// - -typedef LPDIRECTSOUND *LPLPDIRECTSOUND; -typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER; -typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER; -typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER; -typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE; -typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER; -typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY; -typedef LPVOID *LPLPVOID; -typedef const WAVEFORMATEX *LPCWAVEFORMATEX; - -// -// DirectSound API -// - -typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID); -typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID); - -extern HRESULT WINAPI DirectSoundCreate(LPGUID, LPDIRECTSOUND *, LPUNKNOWN); -extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID); -extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID); - -extern HRESULT WINAPI DirectSoundCaptureCreate(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN); -extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID); -extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID); - -#ifdef UNICODE -#define LPDSENUMCALLBACK LPDSENUMCALLBACKW -#define DirectSoundEnumerate DirectSoundEnumerateW -#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW -#else // UNICODE -#define LPDSENUMCALLBACK LPDSENUMCALLBACKA -#define DirectSoundEnumerate DirectSoundEnumerateA -#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA -#endif // UNICODE - -// -// IDirectSound -// - -DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); - -#undef INTERFACE -#define INTERFACE IDirectSound - -DECLARE_INTERFACE_(IDirectSound, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSound methods - STDMETHOD(CreateSoundBuffer) (THIS_ LPCDSBUFFERDESC, LPDIRECTSOUNDBUFFER *, LPUNKNOWN) PURE; - STDMETHOD(GetCaps) (THIS_ LPDSCAPS) PURE; - STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER, LPDIRECTSOUNDBUFFER *) PURE; - STDMETHOD(SetCooperativeLevel) (THIS_ HWND, DWORD) PURE; - STDMETHOD(Compact) (THIS) PURE; - STDMETHOD(GetSpeakerConfig) (THIS_ LPDWORD) PURE; - STDMETHOD(SetSpeakerConfig) (THIS_ DWORD) PURE; - STDMETHOD(Initialize) (THIS_ LPGUID) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSound_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectSound_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectSound_Release(p) (p)->lpVtbl->Release(p) -#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c) -#define IDirectSound_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b) -#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) -#define IDirectSound_Compact(p) (p)->lpVtbl->Compact(p) -#define IDirectSound_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a) -#define IDirectSound_SetSpeakerConfig(p,b) (p)->lpVtbl->SetSpeakerConfig(p,b) -#define IDirectSound_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSound_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectSound_AddRef(p) (p)->AddRef() -#define IDirectSound_Release(p) (p)->Release() -#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c) -#define IDirectSound_GetCaps(p,a) (p)->GetCaps(a) -#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b) -#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) -#define IDirectSound_Compact(p) (p)->Compact() -#define IDirectSound_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a) -#define IDirectSound_SetSpeakerConfig(p,b) (p)->SetSpeakerConfig(b) -#define IDirectSound_Initialize(p,a) (p)->Initialize(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSoundBuffer -// - -DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); - -#undef INTERFACE -#define INTERFACE IDirectSoundBuffer - -DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundBuffer methods - STDMETHOD(GetCaps) (THIS_ LPDSBCAPS) PURE; - STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD) PURE; - STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD) PURE; - STDMETHOD(GetVolume) (THIS_ LPLONG) PURE; - STDMETHOD(GetPan) (THIS_ LPLONG) PURE; - STDMETHOD(GetFrequency) (THIS_ LPDWORD) PURE; - STDMETHOD(GetStatus) (THIS_ LPDWORD) PURE; - STDMETHOD(Initialize) (THIS_ LPDIRECTSOUND, LPCDSBUFFERDESC) PURE; - STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE; - STDMETHOD(Play) (THIS_ DWORD, DWORD, DWORD) PURE; - STDMETHOD(SetCurrentPosition) (THIS_ DWORD) PURE; - STDMETHOD(SetFormat) (THIS_ LPCWAVEFORMATEX) PURE; - STDMETHOD(SetVolume) (THIS_ LONG) PURE; - STDMETHOD(SetPan) (THIS_ LONG) PURE; - STDMETHOD(SetFrequency) (THIS_ DWORD) PURE; - STDMETHOD(Stop) (THIS) PURE; - STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(Restore) (THIS) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectSoundBuffer_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectSoundBuffer_Release(p) (p)->lpVtbl->Release(p) -#define IDirectSoundBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b) -#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c) -#define IDirectSoundBuffer_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a) -#define IDirectSoundBuffer_GetPan(p,a) (p)->lpVtbl->GetPan(p,a) -#define IDirectSoundBuffer_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a) -#define IDirectSoundBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a) -#define IDirectSoundBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g) -#define IDirectSoundBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c) -#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a) -#define IDirectSoundBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a) -#define IDirectSoundBuffer_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a) -#define IDirectSoundBuffer_SetPan(p,a) (p)->lpVtbl->SetPan(p,a) -#define IDirectSoundBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a) -#define IDirectSoundBuffer_Stop(p) (p)->lpVtbl->Stop(p) -#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d) -#define IDirectSoundBuffer_Restore(p) (p)->lpVtbl->Restore(p) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectSoundBuffer_AddRef(p) (p)->AddRef() -#define IDirectSoundBuffer_Release(p) (p)->Release() -#define IDirectSoundBuffer_GetCaps(p,a) (p)->GetCaps(a) -#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b) -#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c) -#define IDirectSoundBuffer_GetVolume(p,a) (p)->GetVolume(a) -#define IDirectSoundBuffer_GetPan(p,a) (p)->GetPan(a) -#define IDirectSoundBuffer_GetFrequency(p,a) (p)->GetFrequency(a) -#define IDirectSoundBuffer_GetStatus(p,a) (p)->GetStatus(a) -#define IDirectSoundBuffer_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g) -#define IDirectSoundBuffer_Play(p,a,b,c) (p)->Play(a,b,c) -#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a) -#define IDirectSoundBuffer_SetFormat(p,a) (p)->SetFormat(a) -#define IDirectSoundBuffer_SetVolume(p,a) (p)->SetVolume(a) -#define IDirectSoundBuffer_SetPan(p,a) (p)->SetPan(a) -#define IDirectSoundBuffer_SetFrequency(p,a) (p)->SetFrequency(a) -#define IDirectSoundBuffer_Stop(p) (p)->Stop() -#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d) -#define IDirectSoundBuffer_Restore(p) (p)->Restore() -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSound3DListener -// - -DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); - -#undef INTERFACE -#define INTERFACE IDirectSound3DListener - -DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSound3D methods - STDMETHOD(GetAllParameters) (THIS_ LPDS3DLISTENER) PURE; - STDMETHOD(GetDistanceFactor) (THIS_ LPD3DVALUE) PURE; - STDMETHOD(GetDopplerFactor) (THIS_ LPD3DVALUE) PURE; - STDMETHOD(GetOrientation) (THIS_ LPD3DVECTOR, LPD3DVECTOR) PURE; - STDMETHOD(GetPosition) (THIS_ LPD3DVECTOR) PURE; - STDMETHOD(GetRolloffFactor) (THIS_ LPD3DVALUE) PURE; - STDMETHOD(GetVelocity) (THIS_ LPD3DVECTOR) PURE; - STDMETHOD(SetAllParameters) (THIS_ LPCDS3DLISTENER, DWORD) PURE; - STDMETHOD(SetDistanceFactor) (THIS_ D3DVALUE, DWORD) PURE; - STDMETHOD(SetDopplerFactor) (THIS_ D3DVALUE, DWORD) PURE; - STDMETHOD(SetOrientation) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE; - STDMETHOD(SetPosition) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE; - STDMETHOD(SetRolloffFactor) (THIS_ D3DVALUE, DWORD) PURE; - STDMETHOD(SetVelocity) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE; - STDMETHOD(CommitDeferredSettings) (THIS) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectSound3DListener_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectSound3DListener_Release(p) (p)->lpVtbl->Release(p) -#define IDirectSound3DListener_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) -#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->lpVtbl->GetDistanceFactor(p,a) -#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->lpVtbl->GetDopplerFactor(p,a) -#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->lpVtbl->GetOrientation(p,a,b) -#define IDirectSound3DListener_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a) -#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->lpVtbl->GetRolloffFactor(p,a) -#define IDirectSound3DListener_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a) -#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b) -#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->lpVtbl->SetDistanceFactor(p,a,b) -#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->lpVtbl->SetDopplerFactor(p,a,b) -#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g) -#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d) -#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->lpVtbl->SetRolloffFactor(p,a,b) -#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d) -#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->lpVtbl->CommitDeferredSettings(p) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectSound3DListener_AddRef(p) (p)->AddRef() -#define IDirectSound3DListener_Release(p) (p)->Release() -#define IDirectSound3DListener_GetAllParameters(p,a) (p)->GetAllParameters(a) -#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->GetDistanceFactor(a) -#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->GetDopplerFactor(a) -#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->GetOrientation(a,b) -#define IDirectSound3DListener_GetPosition(p,a) (p)->GetPosition(a) -#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->GetRolloffFactor(a) -#define IDirectSound3DListener_GetVelocity(p,a) (p)->GetVelocity(a) -#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b) -#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->SetDistanceFactor(a,b) -#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->SetDopplerFactor(a,b) -#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g) -#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d) -#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->SetRolloffFactor(a,b) -#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d) -#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->CommitDeferredSettings() -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSound3DBuffer -// - -DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); - -#undef INTERFACE -#define INTERFACE IDirectSound3DBuffer - -DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundBuffer3D methods - STDMETHOD(GetAllParameters) (THIS_ LPDS3DBUFFER) PURE; - STDMETHOD(GetConeAngles) (THIS_ LPDWORD, LPDWORD) PURE; - STDMETHOD(GetConeOrientation) (THIS_ LPD3DVECTOR) PURE; - STDMETHOD(GetConeOutsideVolume) (THIS_ LPLONG) PURE; - STDMETHOD(GetMaxDistance) (THIS_ LPD3DVALUE) PURE; - STDMETHOD(GetMinDistance) (THIS_ LPD3DVALUE) PURE; - STDMETHOD(GetMode) (THIS_ LPDWORD) PURE; - STDMETHOD(GetPosition) (THIS_ LPD3DVECTOR) PURE; - STDMETHOD(GetVelocity) (THIS_ LPD3DVECTOR) PURE; - STDMETHOD(SetAllParameters) (THIS_ LPCDS3DBUFFER, DWORD) PURE; - STDMETHOD(SetConeAngles) (THIS_ DWORD, DWORD, DWORD) PURE; - STDMETHOD(SetConeOrientation) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE; - STDMETHOD(SetConeOutsideVolume) (THIS_ LONG, DWORD) PURE; - STDMETHOD(SetMaxDistance) (THIS_ D3DVALUE, DWORD) PURE; - STDMETHOD(SetMinDistance) (THIS_ D3DVALUE, DWORD) PURE; - STDMETHOD(SetMode) (THIS_ DWORD, DWORD) PURE; - STDMETHOD(SetPosition) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE; - STDMETHOD(SetVelocity) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectSound3DBuffer_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectSound3DBuffer_Release(p) (p)->lpVtbl->Release(p) -#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) -#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->lpVtbl->GetConeAngles(p,a,b) -#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->lpVtbl->GetConeOrientation(p,a) -#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->lpVtbl->GetConeOutsideVolume(p,a) -#define IDirectSound3DBuffer_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a) -#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->lpVtbl->GetMinDistance(p,a) -#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->lpVtbl->GetMaxDistance(p,a) -#define IDirectSound3DBuffer_GetMode(p,a) (p)->lpVtbl->GetMode(p,a) -#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a) -#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b) -#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->lpVtbl->SetConeAngles(p,a,b,c) -#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d) -#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->lpVtbl->SetConeOutsideVolume(p,a,b) -#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d) -#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->lpVtbl->SetMinDistance(p,a,b) -#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->lpVtbl->SetMaxDistance(p,a,b) -#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->lpVtbl->SetMode(p,a,b) -#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectSound3DBuffer_AddRef(p) (p)->AddRef() -#define IDirectSound3DBuffer_Release(p) (p)->Release() -#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->GetAllParameters(a) -#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->GetConeAngles(a,b) -#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->GetConeOrientation(a) -#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->GetConeOutsideVolume(a) -#define IDirectSound3DBuffer_GetPosition(p,a) (p)->GetPosition(a) -#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->GetMinDistance(a) -#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->GetMaxDistance(a) -#define IDirectSound3DBuffer_GetMode(p,a) (p)->GetMode(a) -#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->GetVelocity(a) -#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b) -#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->SetConeAngles(a,b,c) -#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d) -#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->SetConeOutsideVolume(a,b) -#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d) -#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->SetMinDistance(a,b) -#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->SetMaxDistance(a,b) -#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->SetMode(a,b) -#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSoundCapture -// - -DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); - -#undef INTERFACE -#define INTERFACE IDirectSoundCapture - -DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundCapture methods - STDMETHOD(CreateCaptureBuffer) (THIS_ LPCDSCBUFFERDESC, LPDIRECTSOUNDCAPTUREBUFFER *, LPUNKNOWN) PURE; - STDMETHOD(GetCaps) (THIS_ LPDSCCAPS ) PURE; - STDMETHOD(Initialize) (THIS_ LPGUID) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectSoundCapture_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectSoundCapture_Release(p) (p)->lpVtbl->Release(p) -#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c) -#define IDirectSoundCapture_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirectSoundCapture_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectSoundCapture_AddRef(p) (p)->AddRef() -#define IDirectSoundCapture_Release(p) (p)->Release() -#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c) -#define IDirectSoundCapture_GetCaps(p,a) (p)->GetCaps(a) -#define IDirectSoundCapture_Initialize(p,a) (p)->Initialize(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSoundCaptureBuffer -// - -DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); - -#undef INTERFACE -#define INTERFACE IDirectSoundCaptureBuffer - -DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundCaptureBuffer methods - STDMETHOD(GetCaps) (THIS_ LPDSCBCAPS ) PURE; - STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD ) PURE; - STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD ) PURE; - STDMETHOD(GetStatus) (THIS_ LPDWORD ) PURE; - STDMETHOD(Initialize) (THIS_ LPDIRECTSOUNDCAPTURE, LPCDSCBUFFERDESC) PURE; - STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE; - STDMETHOD(Start) (THIS_ DWORD) PURE; - STDMETHOD(Stop) (THIS) PURE; - STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectSoundCaptureBuffer_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectSoundCaptureBuffer_Release(p) (p)->lpVtbl->Release(p) -#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b) -#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c) -#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a) -#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g) -#define IDirectSoundCaptureBuffer_Start(p,a) (p)->lpVtbl->Start(p,a) -#define IDirectSoundCaptureBuffer_Stop(p) (p)->lpVtbl->Stop(p) -#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectSoundCaptureBuffer_AddRef(p) (p)->AddRef() -#define IDirectSoundCaptureBuffer_Release(p) (p)->Release() -#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->GetCaps(a) -#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b) -#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c) -#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->GetStatus(a) -#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g) -#define IDirectSoundCaptureBuffer_Start(p,a) (p)->Start(a) -#define IDirectSoundCaptureBuffer_Stop(p) (p)->Stop() -#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSoundNotify -// - -DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); - -#undef INTERFACE -#define INTERFACE IDirectSoundNotify - -DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundNotify methods - STDMETHOD(SetNotificationPositions) (THIS_ DWORD, LPCDSBPOSITIONNOTIFY) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectSoundNotify_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectSoundNotify_Release(p) (p)->lpVtbl->Release(p) -#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectSoundNotify_AddRef(p) (p)->AddRef() -#define IDirectSoundNotify_Release(p) (p)->Release() -#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IKsPropertySet -// - -#ifndef _IKsPropertySet_ -#define _IKsPropertySet_ - -#ifdef __cplusplus -// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined -struct IKsPropertySet; -#endif // __cplusplus - -typedef struct IKsPropertySet *LPKSPROPERTYSET; - -#define KSPROPERTY_SUPPORT_GET 0x00000001 -#define KSPROPERTY_SUPPORT_SET 0x00000002 - -DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93); - -#undef INTERFACE -#define INTERFACE IKsPropertySet - -DECLARE_INTERFACE_(IKsPropertySet, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IKsPropertySet methods - STDMETHOD(Get) (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG, PULONG) PURE; - STDMETHOD(Set) (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG) PURE; - STDMETHOD(QuerySupport) (THIS_ REFGUID, ULONG, PULONG) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IKsPropertySet_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IKsPropertySet_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IKsPropertySet_Release(p) (p)->lpVtbl->Release(p) -#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->lpVtbl->Get(p,a,b,c,d,e,f,g) -#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->lpVtbl->Set(p,a,b,c,d,e,f) -#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IKsPropertySet_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IKsPropertySet_AddRef(p) (p)->AddRef() -#define IKsPropertySet_Release(p) (p)->Release() -#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->Get(a,b,c,d,e,f,g) -#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->Set(a,b,c,d,e,f) -#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->QuerySupport(a,b,c) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -#endif // _IKsPropertySet_ - -// -// Return Codes -// - -#define DS_OK 0 - -// The call failed because resources (such as a priority level) -// were already being used by another caller. -#define DSERR_ALLOCATED MAKE_DSHRESULT(10) - -// The control (vol,pan,etc.) requested by the caller is not available. -#define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30) - -// An invalid parameter was passed to the returning function -#define DSERR_INVALIDPARAM E_INVALIDARG - -// This call is not valid for the current state of this object -#define DSERR_INVALIDCALL MAKE_DSHRESULT(50) - -// An undetermined error occured inside the DirectSound subsystem -#define DSERR_GENERIC E_FAIL - -// The caller does not have the priority level required for the function to -// succeed. -#define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70) - -// Not enough free memory is available to complete the operation -#define DSERR_OUTOFMEMORY E_OUTOFMEMORY - -// The specified WAVE format is not supported -#define DSERR_BADFORMAT MAKE_DSHRESULT(100) - -// The function called is not supported at this time -#define DSERR_UNSUPPORTED E_NOTIMPL - -// No sound driver is available for use -#define DSERR_NODRIVER MAKE_DSHRESULT(120) - -// This object is already initialized -#define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130) - -// This object does not support aggregation -#define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION - -// The buffer memory has been lost, and must be restored. -#define DSERR_BUFFERLOST MAKE_DSHRESULT(150) - -// Another app has a higher priority level, preventing this call from -// succeeding. -#define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160) - -// This object has not been initialized -#define DSERR_UNINITIALIZED MAKE_DSHRESULT(170) - -// The requested COM interface is not available -#define DSERR_NOINTERFACE E_NOINTERFACE - -// -// Flags -// - -#define DSCAPS_PRIMARYMONO 0x00000001 -#define DSCAPS_PRIMARYSTEREO 0x00000002 -#define DSCAPS_PRIMARY8BIT 0x00000004 -#define DSCAPS_PRIMARY16BIT 0x00000008 -#define DSCAPS_CONTINUOUSRATE 0x00000010 -#define DSCAPS_EMULDRIVER 0x00000020 -#define DSCAPS_CERTIFIED 0x00000040 -#define DSCAPS_SECONDARYMONO 0x00000100 -#define DSCAPS_SECONDARYSTEREO 0x00000200 -#define DSCAPS_SECONDARY8BIT 0x00000400 -#define DSCAPS_SECONDARY16BIT 0x00000800 - -#define DSBPLAY_LOOPING 0x00000001 - -#define DSBSTATUS_PLAYING 0x00000001 -#define DSBSTATUS_BUFFERLOST 0x00000002 -#define DSBSTATUS_LOOPING 0x00000004 - -#define DSBLOCK_FROMWRITECURSOR 0x00000001 -#define DSBLOCK_ENTIREBUFFER 0x00000002 - -#define DSSCL_NORMAL 0x00000001 -#define DSSCL_PRIORITY 0x00000002 -#define DSSCL_EXCLUSIVE 0x00000003 -#define DSSCL_WRITEPRIMARY 0x00000004 - -#define DS3DMODE_NORMAL 0x00000000 -#define DS3DMODE_HEADRELATIVE 0x00000001 -#define DS3DMODE_DISABLE 0x00000002 - -#define DS3D_IMMEDIATE 0x00000000 -#define DS3D_DEFERRED 0x00000001 - -#define DS3D_MINDISTANCEFACTOR 0.0f -#define DS3D_MAXDISTANCEFACTOR 10.0f -#define DS3D_DEFAULTDISTANCEFACTOR 1.0f - -#define DS3D_MINROLLOFFFACTOR 0.0f -#define DS3D_MAXROLLOFFFACTOR 10.0f -#define DS3D_DEFAULTROLLOFFFACTOR 1.0f - -#define DS3D_MINDOPPLERFACTOR 0.0f -#define DS3D_MAXDOPPLERFACTOR 10.0f -#define DS3D_DEFAULTDOPPLERFACTOR 1.0f - -#define DS3D_DEFAULTMINDISTANCE 1.0f -#define DS3D_DEFAULTMAXDISTANCE 1000000000.0f - -#define DS3D_MINCONEANGLE 0 -#define DS3D_MAXCONEANGLE 360 -#define DS3D_DEFAULTCONEANGLE 360 - -#define DS3D_DEFAULTCONEOUTSIDEVOLUME 0 - -#define DSBCAPS_PRIMARYBUFFER 0x00000001 -#define DSBCAPS_STATIC 0x00000002 -#define DSBCAPS_LOCHARDWARE 0x00000004 -#define DSBCAPS_LOCSOFTWARE 0x00000008 -#define DSBCAPS_CTRL3D 0x00000010 -#define DSBCAPS_CTRLFREQUENCY 0x00000020 -#define DSBCAPS_CTRLPAN 0x00000040 -#define DSBCAPS_CTRLVOLUME 0x00000080 -#define DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100 -#define DSBCAPS_CTRLDEFAULT 0x000000E0 -#define DSBCAPS_CTRLALL 0x000001F0 -#define DSBCAPS_STICKYFOCUS 0x00004000 -#define DSBCAPS_GLOBALFOCUS 0x00008000 -#define DSBCAPS_GETCURRENTPOSITION2 0x00010000 -#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000 - -#define DSCBCAPS_WAVEMAPPED 0x80000000 - -#define DSSPEAKER_HEADPHONE 0x00000001 -#define DSSPEAKER_MONO 0x00000002 -#define DSSPEAKER_QUAD 0x00000003 -#define DSSPEAKER_STEREO 0x00000004 -#define DSSPEAKER_SURROUND 0x00000005 - -#define DSSPEAKER_GEOMETRY_MIN 0x00000005 // 5 degrees -#define DSSPEAKER_GEOMETRY_NARROW 0x0000000A // 10 degrees -#define DSSPEAKER_GEOMETRY_WIDE 0x00000014 // 20 degrees -#define DSSPEAKER_GEOMETRY_MAX 0x000000B4 // 180 degrees - -#define DSSPEAKER_COMBINED(c, g) ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16)) -#define DSSPEAKER_CONFIG(a) ((BYTE)(a)) -#define DSSPEAKER_GEOMETRY(a) ((BYTE)(((DWORD)(a) >> 16) & 0x00FF)) - -#define DSCCAPS_EMULDRIVER 0x00000020 - -#define DSCBLOCK_ENTIREBUFFER 0x00000001 - -#define DSCBSTATUS_CAPTURING 0x00000001 -#define DSCBSTATUS_LOOPING 0x00000002 - -#define DSCBSTART_LOOPING 0x00000001 - -#define DSBFREQUENCY_MIN 100 -#define DSBFREQUENCY_MAX 100000 -#define DSBFREQUENCY_ORIGINAL 0 - -#define DSBPAN_LEFT -10000 -#define DSBPAN_CENTER 0 -#define DSBPAN_RIGHT 10000 - -#define DSBVOLUME_MIN -10000 -#define DSBVOLUME_MAX 0 - -#define DSBSIZE_MIN 4 -#define DSBSIZE_MAX 0x0FFFFFFF - -#define DSBPN_OFFSETSTOP 0xFFFFFFFF - -#ifdef __cplusplus -}; -#endif // __cplusplus - -#endif // __DSOUND_INCLUDED__ - diff --git a/include/vdvp.h b/include/vdvp.h deleted file mode 100644 index 66061b8..0000000 --- a/include/vdvp.h +++ /dev/null @@ -1,832 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved. - * - * File: dvp.h - * Content: DirectDrawVideoPort include file - * - ***************************************************************************/ - -#ifndef __DVP_INCLUDED__ -#define __DVP_INCLUDED__ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#define COM_NO_WINDOWS_H -#include -#else -#define IUnknown void -#undef CO_E_NOTINITIALIZED -#define CO_E_NOTINITIALIZED 0x800401F0L -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * GUIDS used by DirectDrawVideoPort objects - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -DEFINE_GUID( IID_IDDVideoPortContainer, 0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawVideoPort, 0xB36D93E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 ); - -DEFINE_GUID( DDVPTYPE_E_HREFH_VREFH, 0x54F39980L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); -DEFINE_GUID( DDVPTYPE_E_HREFH_VREFL, 0x92783220L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); -DEFINE_GUID( DDVPTYPE_E_HREFL_VREFH, 0xA07A02E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); -DEFINE_GUID( DDVPTYPE_E_HREFL_VREFL, 0xE09C77E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); -DEFINE_GUID( DDVPTYPE_CCIR656, 0xFCA326A0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); -DEFINE_GUID( DDVPTYPE_BROOKTREE, 0x1352A560L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); -DEFINE_GUID( DDVPTYPE_PHILIPS, 0x332CF160L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); - -/* - * GUIDS used to describe connections - */ - -#endif - -/*============================================================================ - * - * DirectDraw Structures - * - * Various structures used to invoke DirectDraw. - * - *==========================================================================*/ - -struct IDirectDraw; -struct IDirectDrawSurface; -struct IDirectDrawPalette; -struct IDirectDrawClipper; - -typedef struct IDDVideoPortContainer FAR *LPDDVIDEOPORTCONTAINER; -typedef struct IDirectDrawVideoPort FAR *LPDIRECTDRAWVIDEOPORT; - -typedef struct _DDVIDEOPORTCONNECT FAR *LPDDVIDEOPORTCONNECT; -typedef struct _DDVIDEOPORTCAPS FAR *LPDDVIDEOPORTCAPS; -typedef struct _DDVIDEOPORTDESC FAR *LPDDVIDEOPORTDESC; -typedef struct _DDVIDEOPORTINFO FAR *LPDDVIDEOPORTINFO; -typedef struct _DDVIDEOPORTBANDWIDTH FAR *LPDDVIDEOPORTBANDWIDTH; -typedef struct _DDVIDEOPORTSTATUS FAR *LPDDVIDEOPORTSTATUS; - -typedef struct IDDVideoPortContainerVtbl DDVIDEOPORTCONTAINERCALLBACKS; -typedef struct IDirectDrawVideoPortVtbl DIRECTDRAWVIDEOPORTCALLBACKS; - - -/* - * API's - */ -typedef HRESULT (FAR PASCAL * LPDDENUMVIDEOCALLBACK)(LPDDVIDEOPORTCAPS, LPVOID); - - -/* - * INTERACES FOLLOW: - * IDirectDrawVideoPort - * IVideoPort - */ - -/* - * IDirectDrawVideoPortContainer - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDDVideoPortContainer -DECLARE_INTERFACE_( IDDVideoPortContainer, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawVideoPort methods ***/ - STDMETHOD(CreateVideoPort)(THIS_ DWORD, LPDDVIDEOPORTDESC, LPDIRECTDRAWVIDEOPORT FAR *, IUnknown FAR *) PURE; - STDMETHOD(EnumVideoPorts)(THIS_ DWORD, LPDDVIDEOPORTCAPS, LPVOID,LPDDENUMVIDEOCALLBACK ) PURE; - STDMETHOD(GetVideoPortConnectInfo)(THIS_ DWORD, LPDWORD, LPDDVIDEOPORTCONNECT ) PURE; - STDMETHOD(QueryVideoPortStatus)(THIS_ DWORD, LPDDVIDEOPORTSTATUS ) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IVideoPortContainer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IVideoPortContainer_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IVideoPortContainer_Release(p) (p)->lpVtbl->Release(p) -#define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->lpVtbl->CreateVideoPort(p, a, b, c, d) -#define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->lpVtbl->EnumVideoPorts(p, a, b, c, d) -#define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->lpVtbl->GetVideoPortConnectInfo(p, a, b, c) -#define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->lpVtbl->QueryVideoPortStatus(p, a, b) -#else -#define IVideoPortContainer_QueryInterface(p, a, b) (p)->QueryInterface(a, b) -#define IVideoPortContainer_AddRef(p) (p)->AddRef() -#define IVideoPortContainer_Release(p) (p)->Release() -#define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->CreateVideoPort(a, b, c, d) -#define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->EnumVideoPorts(a, b, c, d) -#define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->GetVideoPortConnectInfo(a, b, c) -#define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->QueryVideoPortStatus(a, b) -#endif - -#endif - - -/* - * IDirectDrawVideoPort - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawVideoPort -DECLARE_INTERFACE_( IDirectDrawVideoPort, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IVideoPort methods ***/ - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE; - STDMETHOD(GetBandwidthInfo)(THIS_ LPDDPIXELFORMAT, DWORD, DWORD, DWORD, LPDDVIDEOPORTBANDWIDTH) PURE; - STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; - STDMETHOD(GetInputFormats)(THIS_ LPDWORD, LPDDPIXELFORMAT, DWORD) PURE; - STDMETHOD(GetOutputFormats)(THIS_ LPDDPIXELFORMAT, LPDWORD, LPDDPIXELFORMAT, DWORD) PURE; - STDMETHOD(GetFieldPolarity)(THIS_ LPBOOL) PURE; - STDMETHOD(GetVideoLine)(THIS_ LPDWORD) PURE; - STDMETHOD(GetVideoSignalStatus)(THIS_ LPDWORD) PURE; - STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; - STDMETHOD(SetTargetSurface)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE; - STDMETHOD(StartVideo)(THIS_ LPDDVIDEOPORTINFO) PURE; - STDMETHOD(StopVideo)(THIS) PURE; - STDMETHOD(UpdateVideo)(THIS_ LPDDVIDEOPORTINFO) PURE; - STDMETHOD(WaitForSync)(THIS_ DWORD, DWORD, DWORD) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IVideoPort_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IVideoPort_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IVideoPort_Release(p) (p)->lpVtbl->Release(p) -#define IVideoPort_SetTargetSurface(p,a,b) (p)->lpVtbl->SetTargetSurface(p,a,b) -#define IVideoPort_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->lpVtbl->GetBandwidthInfo(p,a,b,c,d,e) -#define IVideoPort_GetColorControls(p,a) (p)->lpVtbl->GetColorControls(p,a) -#define IVideoPort_GetInputFormats(p,a,b,c) (p)->lpVtbl->GetInputFormats(p,a,b,c) -#define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->lpVtbl->GetOutputFormats(p,a,b,c,d) -#define IVideoPort_GetFieldPolarity(p,a) (p)->lpVtbl->GetFieldPolarity(p,a) -#define IVideoPort_GetVideoLine(p,a) (p)->lpVtbl->GetVideoLine(p,a) -#define IVideoPort_GetVideoSignalStatus(p,a) (p)->lpVtbl->GetVideoSignalStatus(p,a) -#define IVideoPort_SetColorControls(p,a) (p)->lpVtbl->SetColorControls(p,a) -#define IVideoPort_StartVideo(p,a) (p)->lpVtbl->StartVideo(p,a) -#define IVideoPort_StopVideo(p) (p)->lpVtbl->StopVideo(p) -#define IVideoPort_UpdateVideo(p,a) (p)->lpVtbl->UpdateVideo(p,a) -#define IVideoPort_WaitForSync(p,a,b,c) (p)->lpVtbl->WaitForSync(p,a,b,c) -#else -#define IVideoPort_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IVideoPort_AddRef(p) (p)->AddRef() -#define IVideoPort_Release(p) (p)->Release() -#define IVideoPort_SetTargetSurface(p,a,b) (p)->SetTargetSurface(a,b) -#define IVideoPort_Flip(p,a,b) (p)->Flip(a,b) -#define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->GetBandwidthInfo(a,b,c,d,e) -#define IVideoPort_GetColorControls(p,a) (p)->GetColorControls(a) -#define IVideoPort_GetInputFormats(p,a,b,c) (p)->GetInputFormats(a,b,c) -#define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->GetOutputFormats(a,b,c,d) -#define IVideoPort_GetFieldPolarity(p,a) (p)->GetFieldPolarity(a) -#define IVideoPort_GetVideoLine(p,a) (p)->GetVideoLine(a) -#define IVideoPort_GetVideoSignalStatus(p,a) (p)->GetVideoSignalStatus(a) -#define IVideoPort_SetColorControls(p,a) (p)->SetColorControls(a) -#define IVideoPort_StartVideo(p,a) (p)->StartVideo(a) -#define IVideoPort_StopVideo(p) (p)->StopVideo() -#define IVideoPort_UpdateVideo(p,a) (p)->UpdateVideo(a) -#define IVideoPort_WaitForSync(p,a,b,c) (p)->WaitForSync(a,b,c) -#endif - -#endif - - -/* - * DDVIDEOPORTCONNECT - */ -typedef struct _DDVIDEOPORTCONNECT -{ - DWORD dwSize; // size of the DDVIDEOPORTCONNECT structure - DWORD dwPortWidth; // Width of the video port - GUID guidTypeID; // Description of video port connection - DWORD dwFlags; // Connection flags - DWORD dwReserved1; // Reserved, set to zero. -} DDVIDEOPORTCONNECT; - - -/* - * DDVIDEOPORTCAPS - */ -typedef struct _DDVIDEOPORTCAPS -{ - DWORD dwSize; // size of the DDVIDEOPORTCAPS structure - DWORD dwFlags; // indicates which fields contain data - DWORD dwMaxWidth; // max width of the video port field - DWORD dwMaxVBIWidth; // max width of the VBI data - DWORD dwMaxHeight; // max height of the video port field - DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1)) - DWORD dwCaps; // Video port capabilities - DWORD dwFX; // More video port capabilities - DWORD dwNumAutoFlipSurfaces; // Number of autoflippable surfaces - DWORD dwAlignVideoPortBoundary; // Byte restriction of placement within the surface - DWORD dwAlignVideoPortPrescaleWidth;// Byte restriction of width after prescaling - DWORD dwAlignVideoPortCropBoundary; // Byte restriction of left cropping - DWORD dwAlignVideoPortCropWidth; // Byte restriction of cropping width - DWORD dwPreshrinkXStep; // Width can be shrunk in steps of 1/x - DWORD dwPreshrinkYStep; // Height can be shrunk in steps of 1/x - DWORD dwNumVBIAutoFlipSurfaces; // Number of VBI autoflippable surfaces - DWORD dwReserved1; // Reserved for future use - DWORD dwReserved2; // Reserved for future use -} DDVIDEOPORTCAPS; - -/* - * The dwMaxWidth and dwMaxVBIWidth members are valid - */ -#define DDVPD_WIDTH 0x00000001l - -/* - * The dwMaxHeight member is valid - */ -#define DDVPD_HEIGHT 0x00000002l - -/* - * The dwVideoPortID member is valid - */ -#define DDVPD_ID 0x00000004l - -/* - * The dwCaps member is valid - */ -#define DDVPD_CAPS 0x00000008l - -/* - * The dwFX member is valid - */ -#define DDVPD_FX 0x00000010l - -/* - * The dwNumAutoFlipSurfaces member is valid - */ -#define DDVPD_AUTOFLIP 0x00000020l - -/* - * All of the alignment members are valid - */ -#define DDVPD_ALIGN 0x00000040l - - -/* - * DDVIDEOPORTDESC - */ -typedef struct _DDVIDEOPORTDESC -{ - DWORD dwSize; // size of the DDVIDEOPORTDESC structure - DWORD dwFieldWidth; // width of the video port field - DWORD dwVBIWidth; // width of the VBI data - DWORD dwFieldHeight; // height of the video port field - DWORD dwMicrosecondsPerField; // Microseconds per video field - DWORD dwMaxPixelsPerSecond; // Maximum pixel rate per second - DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1)) - DWORD dwReserved1; // Reserved for future use - set to zero - DDVIDEOPORTCONNECT VideoPortType; // Description of video port connection - DWORD dwReserved2; // Reserved for future use - set to zero - DWORD dwReserved3; // Reserved for future use - set to zero -} DDVIDEOPORTDESC; - - -/* - * DDVIDEOPORTINFO - */ -typedef struct _DDVIDEOPORTINFO -{ - DWORD dwSize; // Size of the structure - DWORD dwOriginX; // Placement of the video data within the surface. - DWORD dwOriginY; // Placement of the video data within the surface. - DWORD dwVPFlags; // Video port options - RECT rCrop; // Cropping rectangle (optional). - DWORD dwPrescaleWidth; // Determines pre-scaling/zooming in the X direction (optional). - DWORD dwPrescaleHeight; // Determines pre-scaling/zooming in the Y direction (optional). - LPDDPIXELFORMAT lpddpfInputFormat; // Video format written to the video port - LPDDPIXELFORMAT lpddpfVBIInputFormat; // Input format of the VBI data - LPDDPIXELFORMAT lpddpfVBIOutputFormat;// Output format of the data - DWORD dwVBIHeight; // Specifies the number of lines of data within the vertical blanking interval. - DWORD dwReserved1; // Reserved for future use - set to zero - DWORD dwReserved2; // Reserved for future use - set to zero -} DDVIDEOPORTINFO; - - -/* - * DDVIDEOPORTBANDWIDTH - */ -typedef struct _DDVIDEOPORTBANDWIDTH -{ - DWORD dwSize; // Size of the structure - DWORD dwCaps; - DWORD dwOverlay; // Zoom factor at which overlay is supported - DWORD dwColorkey; // Zoom factor at which overlay w/ colorkey is supported - DWORD dwYInterpolate; // Zoom factor at which overlay w/ Y interpolation is supported - DWORD dwYInterpAndColorkey; // Zoom factor at which ovelray w/ Y interpolation and colorkeying is supported - DWORD dwReserved1; // Reserved for future use - set to zero - DWORD dwReserved2; // Reserved for future use - set to zero -} DDVIDEOPORTBANDWIDTH; - - -/* - * DDVIDEOPORTSTATUS - */ -typedef struct _DDVIDEOPORTSTATUS -{ - DWORD dwSize; // Size of the structure - BOOL bInUse; // TRUE if video port is currently being used - DWORD dwFlags; // Currently not used - DWORD dwReserved1; // Reserved for future use - DDVIDEOPORTCONNECT VideoPortType; // Information about the connection - DWORD dwReserved2; // Reserved for future use - DWORD dwReserved3; // Reserved for future use -} DDVIDEOPORTSTATUS; - -/*============================================================================ - * - * Video Port Flags - * - * All flags are bit flags. - * - *==========================================================================*/ - -/**************************************************************************** - * - * VIDEOPORT DDVIDEOPORTCONNECT FLAGS - * - ****************************************************************************/ - -/* - * When this is set by the driver and passed to the client, this - * indicates that the video port is capable of double clocking the data. - * When this is set by the client, this indicates that the video port - * should enable double clocking. This flag is only valid with external - * syncs. - */ -#define DDVPCONNECT_DOUBLECLOCK 0x00000001l - -/* - * When this is set by the driver and passed to the client, this - * indicates that the video port is capable of using an external VACT - * signal. When this is set by the client, this indicates that the - * video port should use the external VACT signal. - */ -#define DDVPCONNECT_VACT 0x00000002l - -/* - * When this is set by the driver and passed to the client, this - * indicates that the video port is capable of treating even fields - * like odd fields and visa versa. When this is set by the client, - * this indicates that the video port should treat even fields like odd - * fields. - */ -#define DDVPCONNECT_INVERTPOLARITY 0x00000004l - -/* - * Indicates that any data written to the video port during the VREF - * period will not be written into the frame buffer. This flag is read only. - */ -#define DDVPCONNECT_DISCARDSVREFDATA 0x00000008l - -/* - * Device will write half lines into the frame buffer, sometimes causing - * the data to not be displayed correctly. - */ -#define DDVPCONNECT_HALFLINE 0x00000010l - -/* - * Indicates that the signal is interlaced. This flag is only - * set by the client. - */ -#define DDVPCONNECT_INTERLACED 0x00000020l - -/* - * Indicates that video port is shareable and that this video port - * will use the even fields. This flag is only set by the client. - */ -#define DDVPCONNECT_SHAREEVEN 0x00000040l - -/* - * Indicates that video port is shareable and that this video port - * will use the odd fields. This flag is only set by the client. - */ -#define DDVPCONNECT_SHAREODD 0x00000080l - -/**************************************************************************** - * - * VIDEOPORT DDVIDEOPORTDESC CAPS - * - ****************************************************************************/ - -/* - * Flip can be performed automatically to avoid tearing. - */ -#define DDVPCAPS_AUTOFLIP 0x00000001l - -/* - * Supports interlaced video - */ -#define DDVPCAPS_INTERLACED 0x00000002l - -/* - * Supports non-interlaced video - */ -#define DDVPCAPS_NONINTERLACED 0x00000004l - -/* - * Indicates that the device can return whether the current field - * of an interlaced signal is even or odd. - */ -#define DDVPCAPS_READBACKFIELD 0x00000008l - -/* - * Indicates that the device can return the current line of video - * being written into the frame buffer. - */ -#define DDVPCAPS_READBACKLINE 0x00000010l - -/* - * Allows two gen-locked video streams to share a single video port, - * where one stream uses the even fields and the other uses the odd - * fields. Separate parameters (including address, scaling, - * cropping, etc.) are maintained for both fields.) - */ -#define DDVPCAPS_SHAREABLE 0x00000020l - -/* - * Even fields of video can be automatically discarded. - */ -#define DDVPCAPS_SKIPEVENFIELDS 0x00000040l - -/* - * Odd fields of video can be automatically discarded. - */ -#define DDVPCAPS_SKIPODDFIELDS 0x00000080l - -/* - * Indicates that the device is capable of driving the graphics - * VSYNC with the video port VSYNC. - */ -#define DDVPCAPS_SYNCMASTER 0x00000100l - -/* - * Indicates that data within the vertical blanking interval can - * be written to a different surface. - */ -#define DDVPCAPS_VBISURFACE 0x00000200l - -/* - * Indicates that the video port can perform color operations - * on the incoming data before it is written to the frame buffer. - */ -#define DDVPCAPS_COLORCONTROL 0x00000400l - -/* - * Indicates that the video port can accept VBI data in a different - * width or format than the regular video data. - */ -#define DDVPCAPS_OVERSAMPLEDVBI 0x00000800l - -/* - * Indicates that the video port can write data directly to system memory - */ -#define DDVPCAPS_SYSTEMMEMORY 0x00001000l - - -/**************************************************************************** - * - * VIDEOPORT DDVIDEOPORTDESC FX - * - ****************************************************************************/ - -/* - * Limited cropping is available to crop out the vertical interval data. - */ -#define DDVPFX_CROPTOPDATA 0x00000001l - -/* - * Incoming data can be cropped in the X direction before it is written - * to the surface. - */ -#define DDVPFX_CROPX 0x00000002l - -/* - * Incoming data can be cropped in the Y direction before it is written - * to the surface. - */ -#define DDVPFX_CROPY 0x00000004l - -/* - * Supports interleaving interlaced fields in memory. - */ -#define DDVPFX_INTERLEAVE 0x00000008l - -/* - * Supports mirroring left to right as the video data is written - * into the frame buffer. - */ -#define DDVPFX_MIRRORLEFTRIGHT 0x00000010l - -/* - * Supports mirroring top to bottom as the video data is written - * into the frame buffer. - */ -#define DDVPFX_MIRRORUPDOWN 0x00000020l - -/* - * Data can be arbitrarily shrunk in the X direction before it - * is written to the surface. - */ -#define DDVPFX_PRESHRINKX 0x00000040l - -/* - * Data can be arbitrarily shrunk in the Y direction before it - * is written to the surface. - */ -#define DDVPFX_PRESHRINKY 0x00000080l - -/* - * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the X - * direction before it is written to the surface. - */ -#define DDVPFX_PRESHRINKXB 0x00000100l - -/* - * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the Y - * direction before it is written to the surface. - */ -#define DDVPFX_PRESHRINKYB 0x00000200l - -/* - * Data can be shrunk in increments of 1/x in the X direction - * (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkXStep) - * before it is written to the surface. - */ -#define DDVPFX_PRESHRINKXS 0x00000400l - -/* - * Data can be shrunk in increments of 1/x in the Y direction - * (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkYStep) - * before it is written to the surface. - */ -#define DDVPFX_PRESHRINKYS 0x00000800l - -/* - * Data can be arbitrarily stretched in the X direction before - * it is written to the surface. - */ -#define DDVPFX_PRESTRETCHX 0x00001000l - -/* - * Data can be arbitrarily stretched in the Y direction before - * it is written to the surface. - */ -#define DDVPFX_PRESTRETCHY 0x00002000l - -/* - * Data can be integer stretched in the X direction before it is - * written to the surface. - */ -#define DDVPFX_PRESTRETCHXN 0x00004000l - -/* - * Data can be integer stretched in the Y direction before it is - * written to the surface. - */ -#define DDVPFX_PRESTRETCHYN 0x00008000l - -/* - * Indicates that data within the vertical blanking interval can - * be converted independently of the remaining video data. - */ -#define DDVPFX_VBICONVERT 0x00010000l - -/* - * Indicates that scaling can be disabled for data within the - * vertical blanking interval. - */ -#define DDVPFX_VBINOSCALE 0x00020000l - -/* - * Indicates that the video data can ignore the left and right - * cropping coordinates when cropping oversampled VBI data. - */ -#define DDVPFX_IGNOREVBIXCROP 0x00040000l - - -/**************************************************************************** - * - * VIDEOPORT DDVIDEOPORTINFO FLAGS - * - ****************************************************************************/ - -/* - * Perform automatic flipping. Auto-flipping is performed between - * the overlay surface that was attached to the video port using - * IDirectDrawVideoPort::AttachSurface and the overlay surfaces that - * are attached to the surface via the IDirectDrawSurface::AttachSurface - * method. The flip order is the order in which the overlay surfaces - * were. attached. - */ -#define DDVP_AUTOFLIP 0x00000001l - -/* - * Perform conversion using the ddpfOutputFormat information. - */ -#define DDVP_CONVERT 0x00000002l - -/* - * Perform cropping using the specified rectangle. - */ -#define DDVP_CROP 0x00000004l - -/* - * Indicates that interlaced fields should be interleaved in memory. - */ -#define DDVP_INTERLEAVE 0x00000008l - -/* - * Indicates that the data should be mirrored left to right as it's - * written into the frame buffer. - */ -#define DDVP_MIRRORLEFTRIGHT 0x00000010l - -/* - * Indicates that the data should be mirrored top to bottom as it's - * written into the frame buffer. - */ -#define DDVP_MIRRORUPDOWN 0x00000020l - -/* - * Perform pre-scaling/zooming based on the pre-scale parameters. - */ -#define DDVP_PRESCALE 0x00000040l - -/* - * Ignore input of even fields. - */ -#define DDVP_SKIPEVENFIELDS 0x00000080l - -/* - * Ignore input of odd fields. - */ -#define DDVP_SKIPODDFIELDS 0x00000100l - -/* - * Drive the graphics VSYNCs using the video port VYSNCs. - */ -#define DDVP_SYNCMASTER 0x00000200l - -/* - * The ddpfVBIOutputFormatFormat member contains data that should be used - * to convert the data within the vertical blanking interval. - */ -#define DDVP_VBICONVERT 0x00000400l - -/* - * Indicates that data within the vertical blanking interval - * should not be scaled. - */ -#define DDVP_VBINOSCALE 0x00000800l - -/* - * Indicates that these bob/weave decisions should not be - * overriden by other interfaces. - */ -#define DDVP_OVERRIDEBOBWEAVE 0x00001000l - -/* - * Indicates that the video data should ignore the left and right - * cropping coordinates when cropping the VBI data. - */ -#define DDVP_IGNOREVBIXCROP 0x00002000l - - -/**************************************************************************** - * - * DIRIRECTDRAWVIDEOPORT GETINPUTFORMAT/GETOUTPUTFORMAT FLAGS - * - ****************************************************************************/ - -/* - * Return formats for the video data - */ -#define DDVPFORMAT_VIDEO 0x00000001l - -/* - * Return formats for the VBI data - */ -#define DDVPFORMAT_VBI 0x00000002l - - -/**************************************************************************** - * - * DIRIRECTDRAWVIDEOPORT SETTARGETSURFACE FLAGS - * - ****************************************************************************/ - -/* - * Surface should receive video data (and VBI data if a surface - * is not explicitly attached for that purpose) - */ -#define DDVPTARGET_VIDEO 0x00000001l - -/* - * Surface should receive VBI data - */ -#define DDVPTARGET_VBI 0x00000002l - - -/**************************************************************************** - * - * DIRIRECTDRAWVIDEOPORT WAITFORSYNC FLAGS - * - ****************************************************************************/ - -/* - * Waits until the beginning of the next VSYNC - */ -#define DDVPWAIT_BEGIN 0x00000001l - -/* - * Waits until the end of the next/current VSYNC - */ -#define DDVPWAIT_END 0x00000002l - -/* - * Waits until the beginning of the specified line - */ -#define DDVPWAIT_LINE 0x00000003l - -/**************************************************************************** - * - * DIRECTDRAWVIDEOPORT FLIP FLAGS - * - ****************************************************************************/ - -/* - * Flips the normal video surface - */ -#define DDVPFLIP_VIDEO 0x00000001l - -/* - * Flips the VBI surface - */ -#define DDVPFLIP_VBI 0x00000002l - -/**************************************************************************** - * - * DIRIRECTDRAWVIDEOPORT GETVIDEOSIGNALSTATUS VALUES - * - ****************************************************************************/ - -/* - * No video signal is present at the video port - */ -#define DDVPSQ_NOSIGNAL 0x00000001l - -/* - * A valid video signal is present at the video port - */ -#define DDVPSQ_SIGNALOK 0x00000002l - -/**************************************************************************** - * - * VIDEOPORTBANDWIDTH Flags - * - ****************************************************************************/ - -/* - * The specified height/width refer to the size of the video port data - * written into memory, after prescaling has occured. - */ -#define DDVPB_VIDEOPORT 0x00000001l - -/* - * The specified height/width refer to the source size of the overlay. - */ -#define DDVPB_OVERLAY 0x00000002l - -/* - * This is a query for the device to return which caps this device requires. - */ -#define DDVPB_TYPE 0x00000004l - -/**************************************************************************** - * - * VIDEOPORTBANDWIDTH Caps - * - ****************************************************************************/ - -/* - * The bandwidth for this device is dependant on the overlay source size. - */ -#define DDVPBCAPS_SOURCE 0x00000001l - -/* - * The bandwidth for this device is dependant on the overlay destination - * size. - */ -#define DDVPBCAPS_DESTINATION 0x00000002l - - -#ifdef __cplusplus -}; -#endif - -#endif - diff --git a/includes.cmake b/includes.cmake index e73110d..a593c71 100644 --- a/includes.cmake +++ b/includes.cmake @@ -22,7 +22,6 @@ set(fs_INCLUDES include/barracks.h include/beam.h include/bgbitmapdlg.h - include/bitblt.h include/bmpman.h include/briefingeditordlg.h include/campaigneditordlg.h @@ -36,12 +35,10 @@ set(fs_INCLUDES include/chatbox.h include/childfrm.h include/chttpget.h - include/circle.h include/cmdbrief.h include/cmdline.h include/cmeasure.h include/codec1.h - include/colors.h include/contexthelp.h include/controlsconfig.h include/convert.h @@ -76,26 +73,14 @@ set(fs_INCLUDES include/freespace.h include/freespaceresource.h include/fvi.h - include/fxdll.h - include/fxglob.h include/gameplayhelp.h include/gamesequence.h include/gamesnd.h - include/glide.h - include/glidesys.h - include/glideutl.h - include/gradient.h - include/grd3d.h - include/grd3dinternal.h - include/grdirectdraw.h - include/grglide.h - include/grglideinternal.h include/grid.h include/grinternal.h include/gropengl1.h include/gropengl.h include/gropenglinternal.h - include/grsoft.h include/helpeddoc.h include/helped.h include/helpedline.h @@ -220,7 +205,6 @@ set(fs_INCLUDES include/particle.h include/pcxutils.h include/physics.h - include/pixel.h include/player.h include/playermenu.h include/playerstarteditor.h @@ -240,12 +224,10 @@ set(fs_INCLUDES include/reinforcementeditordlg.h include/resource.h include/rtvoice.h - include/scaler.h include/scoring.h include/scramble.h include/sexp.h include/sexp_tree.h - include/shade.h include/shieldsysdlg.h include/shipchecklistbox.h include/shipclasseditordlg.h @@ -262,7 +244,6 @@ set(fs_INCLUDES include/snazzyui.h include/sound.h include/spline.h - include/sst1vid.h include/stand_gui.h include/starfieldeditor.h include/starfield.h @@ -272,7 +253,6 @@ set(fs_INCLUDES include/subsysdamage.h include/supernova.h include/swarm.h - include/sw_force.h include/systemvars.h include/techmenu.h include/textviewdlg.h @@ -280,28 +260,11 @@ set(fs_INCLUDES include/tgautils.h include/timer.h include/tmapper.h - include/tmapscanline.h include/trails.h include/trainingmenu.h include/uidefs.h include/ui.h include/unix.h - include/vasync.h - include/vd3dcaps.h - include/vd3d.h - include/vd3di.h - include/vd3drmdef.h - include/vd3drm.h - include/vd3drmobj.h - include/vd3drmwin.h - include/vd3dtypes.h - include/vddraw.h - include/vdinput.h - include/vdplay.h - include/vdplobby.h - include/vdsetup.h - include/vdsound.h - include/vdvp.h include/vecmat.h include/version.h include/waypointpathdlg.h diff --git a/src/freespace2/freespace.cpp b/src/freespace2/freespace.cpp index ce887c0..5fb7ef3 100644 --- a/src/freespace2/freespace.cpp +++ b/src/freespace2/freespace.cpp @@ -701,9 +701,6 @@ #include "version.h" #include "mainhalltemp.h" #include "exceptionhandler.h" -#ifndef PLAT_UNIX -#include "glide.h" -#endif #include "supernova.h" #include "hudshield.h" // #include "names.h" @@ -1656,7 +1653,6 @@ void game_level_close() shield_hit_close(); mission_event_shutdown(); asteroid_level_close(); - model_cache_reset(); // Reset/free all the model caching stuff flak_level_close(); // unload flak stuff neb2_level_close(); // shutdown gaseous nebula stuff ct_level_close(); @@ -2439,17 +2435,6 @@ void game_init() exit(1); } - if(!Is_standalone){ - if(!SDL_strcasecmp(ptr, "Aucune acc�l�ration 3D") || !SDL_strcasecmp(ptr, "Keine 3D-Beschleunigerkarte") || !SDL_strcasecmp(ptr, "No 3D acceleration")){ -#ifndef PLAT_UNIX - MessageBox((HWND)os_get_window(), XSTR("Warning, Freespace 2 requires Glide or Direct3D hardware accleration. You will not be able to run Freespace 2 without it.", 1448), XSTR("Warning", 1449), MB_OK); -#else - STUB_FUNCTION; -#endif - exit(1); - } - } - // check for hi res pack file int has_sparky_hi = 0; @@ -2464,62 +2449,7 @@ void game_init() } #endif -#ifndef PLAT_UNIX - if (!Is_standalone && ptr && (strstr(ptr, NOX("3DFX Glide")))) { -#ifdef E3_BUILD - // always 640 for E3 - gr_init(GR_640, GR_GLIDE); -#else - // regular or hi-res ? -#ifdef NDEBUG - if(has_sparky_hi && strstr(ptr, NOX("(1024x768)"))){ -#else - if(strstr(ptr, NOX("(1024x768)"))){ -#endif // NDEBUG - gr_init(GR_1024, GR_GLIDE); - } else { - gr_init(GR_640, GR_GLIDE); - } -#endif // E3_BUILD - } else if (!Is_standalone && ptr && (strstr(ptr, NOX("Direct 3D -") ))) { -#ifdef E3_BUILD - // always 640 for E3 - trying_d3d = 1; - gr_init(GR_640, GR_DIRECT3D, depth); -#else - // regular or hi-res ? -#ifdef NDEBUG - if(has_sparky_hi && strstr(ptr, NOX("(1024x768)"))){ -#else - if(strstr(ptr, NOX("(1024x768)"))){ -#endif // NDEBUG - // Direct 3D - trying_d3d = 1; - gr_init(GR_1024, GR_DIRECT3D, depth); - } else { - // Direct 3D - trying_d3d = 1; - gr_init(GR_640, GR_DIRECT3D, depth); - } -#endif // E3_BUILD - } else { - // Software -#ifndef NDEBUG - if ( Use_fullscreen_at_startup && !Is_standalone) { - gr_init(GR_640, GR_DIRECTDRAW); - } else { - gr_init(GR_640, GR_SOFTWARE); - } -#else - if ( !Is_standalone ) { - gr_init(GR_640, GR_DIRECTDRAW); - } else { - gr_init(GR_640, GR_SOFTWARE); - } -#endif // !NDEBUG - } -#else - if (!Is_standalone /* && ptr && (strstr(ptr, NOX("OpenGL"))) */) { + if ( !Is_standalone && ptr && strstr(ptr, NOX("OpenGL")) ) { if(has_sparky_hi && strstr(ptr, NOX("(1024x768)"))){ gr_init(GR_1024, GR_OPENGL); } else { @@ -2527,9 +2457,9 @@ void game_init() } } else { STUB_FUNCTION; - gr_init(GR_640, GR_SDL); + Int3(); + //gr_init(GR_640, GR_OPENGL); } -#endif // !PLAT_UNIX // Set the gamma ptr = os_config_read_string(NULL,NOX("Gamma"),NOX("1.80")); @@ -5289,15 +5219,7 @@ void game_process_event( int current_state, int event ) break; case GS_EVENT_TOGGLE_FULLSCREEN: - #ifndef HARDWARE_ONLY - #ifndef NDEBUG - if ( gr_screen.mode == GR_SOFTWARE ) { - gr_init( GR_640, GR_DIRECTDRAW ); - } else if ( gr_screen.mode == GR_DIRECTDRAW ) { - gr_init( GR_640, GR_SOFTWARE ); - } - #endif - #endif + gr_toggle_fullscreen(); break; case GS_EVENT_TOGGLE_GLIDE: @@ -8029,16 +7951,6 @@ void demo_upsell_next_screen() } else { Demo_upsell_show_next_bitmap_time = timer_get_milliseconds() + DEMO_UPSELL_SCREEN_DELAY; } - - /* - if ( Demo_upsell_screen_number < NUM_DEMO_UPSELL_SCREENS ) { - if ( Demo_upsell_bitmap_filenames[gr_screen.res][Demo_upsell_screen_number] >= 0 ) { -#ifndef HARDWARE_ONLY - palette_use_bm_palette(Demo_upsell_bitmaps[gr_screen.res][Demo_upsell_screen_number]); -#endif - } - } - */ } void demo_upsell_load_bitmaps() diff --git a/src/globalincs/systemvars.cpp b/src/globalincs/systemvars.cpp index 3517af7..7e96d3c 100644 --- a/src/globalincs/systemvars.cpp +++ b/src/globalincs/systemvars.cpp @@ -240,10 +240,6 @@ int Interface_last_tick = -1; // last timer tick on flip // for notifying players of unknown ship types int Fred_found_unknown_ship_during_parsing = 0; -// If true, then we are using Direct3D hardware. This is used for game type stuff -// that changes when you're using hardware. -int D3D_enabled = 0; - // Values used for noise for thruster animations float Noise[NOISE_NUM_FRAMES] = { 0.468225f, diff --git a/src/graphics/2d.cpp b/src/graphics/2d.cpp index d77894f..171ce02 100644 --- a/src/graphics/2d.cpp +++ b/src/graphics/2d.cpp @@ -484,17 +484,8 @@ #include "systemvars.h" #include "cmdline.h" -// 3dnow stuff -// #include "amd3d.h" - // Includes for different rendering systems -#include "grsoft.h" -#include "grd3d.h" -#ifndef PLAT_UNIX -#include "grglide.h" -#endif #include "gropengl.h" -#include "grdirectdraw.h" screen gr_screen; @@ -530,113 +521,20 @@ void gr_close() palette_flush(); - switch( gr_screen.mode ) { -#ifndef PLAT_UNIX - case GR_SOFTWARE: - gr_soft_cleanup(); - break; - case GR_DIRECTDRAW: - Int3(); - gr_directdraw_cleanup(); - break; - case GR_DIRECT3D: - gr_d3d_cleanup(); - break; - case GR_GLIDE: - gr_glide_cleanup(); - break; -#endif - case GR_OPENGL: - gr_opengl_cleanup(); - break; - default: - Int3(); // Invalid graphics mode - break; - } - - gr_font_close(); - - Gr_inited = 0; -} - -//XSTR:OFF -DCF(gr,"Changes graphics mode") -{ -#ifndef HARDWARE_ONLY - int mode = gr_screen.mode; - - if ( Dc_command ) { - dc_get_arg(ARG_STRING); - - if ( !strcmp( Dc_arg, "a")) { - Int3(); - mode = GR_SOFTWARE; - } else if ( !strcmp( Dc_arg, "b")) { - Int3(); - mode = GR_DIRECTDRAW; - } else if ( !strcmp( Dc_arg, "d")) { - mode = GR_DIRECT3D; - } else if ( !strcmp( Dc_arg, "g")) { -#ifndef PLAT_UNIX - mode = GR_GLIDE; -#endif - } else if ( !strcmp( Dc_arg, "o")) { - mode = GR_OPENGL; - } else { - // print usage, not stats - Dc_help = 1; - } - - /* - if ( mode != gr_screen.mode ) { - dc_printf( "Setting new video mode...\n" ); - int errcode = gr_init( gr_screen.max_w, gr_screen.max_h, mode ); - if (errcode) { - dc_printf( "Error %d. Graphics unchanged.\n", errcode ); - } - } - */ - } - - if ( Dc_help ) { - dc_printf( "Usage: gr mode\n" ); - dc_printf( "The options can be:\n" ); - dc_printf( "Macros: A=software win32 window (obsolete)\n" ); - dc_printf( " B=software directdraw fullscreen (obsolete)\n" ); - dc_printf( " D=Direct3d\n" ); - dc_printf( " G=Glide\n" ); - dc_printf( " O=OpenGl (obsolete)\n" ); - Dc_status = 0; // don't print status if help is printed. Too messy. - } - - if ( Dc_status ) { - switch( gr_screen.mode ) { - case GR_SOFTWARE: - Int3(); - dc_printf( "Win32 software windowed\n" ); - break; - case GR_DIRECTDRAW: - Int3(); - dc_printf( "DirectDraw software windowed\n" ); - break; - case GR_DIRECT3D: - dc_printf( "Direct3D\n" ); - break; - case GR_GLIDE: -#ifndef PLAT_UNIX - dc_printf( "3Dfx Glide\n" ); -#endif - break; + switch (gr_screen.mode) { case GR_OPENGL: - dc_printf( "OpenGl\n" ); + gr_opengl_cleanup(); break; + default: Int3(); // Invalid graphics mode - } + break; } -#endif + + gr_font_close(); + + Gr_inited = 0; } -//XSTR:ON // set screen clear color DCF(clear_color, "set clear color r, g, b") @@ -722,24 +620,13 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y) case GR_OPENGL: gr_opengl_cleanup(); break; + default: Int3(); // Invalid graphics mode break; } } -#if defined(HARDWARE_ONLY) -#ifndef PLAT_UNIX - if(!Fred_running && !Pofview_running && !Nebedit_running && !Is_standalone){ - if((mode != GR_GLIDE) && (mode != GR_DIRECT3D) && (mode != GR_OPENGL)){ - mprintf(("Forcing glide startup!\n")); - mode = GR_GLIDE; - } - } -#endif -#endif - - D3D_enabled = 0; Gr_inited = 1; max_w = -1; @@ -854,6 +741,15 @@ void gr_force_fullscreen() } } +void gr_toggle_fullscreen() +{ + if ( !Gr_inited ) { + return; + } + + STUB_FUNCTION; +} + void gr_activate(int active) { if ( !Gr_inited ) { diff --git a/src/graphics/font.cpp b/src/graphics/font.cpp index 32b166e..e726537 100644 --- a/src/graphics/font.cpp +++ b/src/graphics/font.cpp @@ -466,204 +466,6 @@ void gr_get_string_size(int *w1, int *h1, const char *text, int len) MONITOR( FontChars ); -/* - -void gr8_char(int x,int y,int letter) -{ - font_char *ch; - - ch = &Current_font->char_data[letter]; - - gr_aabitmap_ex( x, y, ch->byte_width, Current_font->h, Current_font->u[letter], Current_font->v[letter] ); - -// mprintf(( "String = %s\n", text )); -} - - -void gr8_string( int sx, int sy, char *s ) -{ - int width, spacing, letter; - int x, y; - - if ( !Current_font ) return; - if ( !s ) return; - - gr_set_bitmap(Current_font->bitmap); - - x = sx; - y = sy; - - if (sx==0x8000) { //centered - x = get_centered_x(s); - } else { - x = sx; - } - - while (*s) { - while (*s== '\n' ) { - s++; - y += Current_font->h; - if (sx==0x8000) { //centered - x = get_centered_x(s); - } else { - x = sx; - } - } - if (*s == 0 ) break; - - letter = get_char_width(s[0],s[1],&width,&spacing); - - if (letter<0) { //not in font, draw as space - x += spacing; - s++; - continue; - } - gr8_char( x, y, letter ); - - x += spacing; - s++; - } -} -*/ - -void gr8_string(int sx, int sy, const char *s ) -{ - int row,width, spacing, letter; - int x, y; - - if ( !Current_font ) return; - if ( !s ) return; - - x = sx; - y = sy; - - if (sx==0x8000) { //centered - x = get_centered_x(s); - } else { - x = sx; - } - - spacing = 0; - - gr_lock(); - - - while (*s) { - MONITOR_INC( FontChars, 1 ); - - x += spacing; - while (*s== '\n' ) { - s++; - y += Current_font->h; - if (sx==0x8000) { //centered - x = get_centered_x(s); - } else { - x = sx; - } - } - if (*s == 0 ) break; - - letter = get_char_width(s[0],s[1],&width,&spacing); - s++; - - //If not in font, draw as space - if (letter<0) continue; - - int xd, yd, xc, yc; - int wc, hc; - - // Check if this character is totally clipped - if ( x + width < gr_screen.clip_left ) continue; - if ( y + Current_font->h < gr_screen.clip_top ) continue; - if ( x > gr_screen.clip_right ) continue; - if ( y > gr_screen.clip_bottom ) continue; - - xd = yd = 0; - if ( x < gr_screen.clip_left ) xd = gr_screen.clip_left - x; - if ( y < gr_screen.clip_top ) yd = gr_screen.clip_top - y; - xc = x+xd; - yc = y+yd; - - wc = width - xd; hc = Current_font->h - yd; - if ( xc + wc > gr_screen.clip_right ) wc = gr_screen.clip_right - xc; - if ( yc + hc > gr_screen.clip_bottom ) hc = gr_screen.clip_bottom - yc; - - if ( wc < 1 ) continue; - if ( hc < 1 ) continue; - - ubyte *fp = Current_font->pixel_data + Current_font->char_data[letter].offset + xd + yd*width; - ubyte *dptr = GR_SCREEN_PTR(ubyte, xc, yc); - -#ifndef HARDWARE_ONLY - if ( Current_alphacolor ) { - for (row=0; rowtable.lookup[0][0]; - _asm mov edx, lookup - _asm xor eax, eax - _asm mov ecx, wc - _asm xor ebx, ebx - _asm mov edi, dptr - _asm mov esi, fp - _asm shr ecx, 1 - _asm jz OnlyOne - _asm pushf - InnerFontLoop: - _asm mov al, [edi] - _asm mov bl, [edi+1] - _asm add edi,2 - - _asm mov ah, [esi] - _asm mov bh, [esi+1] - _asm add esi,2 - - _asm mov al, [edx+eax] - _asm mov ah, [edx+ebx] - - _asm mov [edi-2], ax - - _asm dec ecx - _asm jnz InnerFontLoop - - _asm popf - _asm jnc NotOdd - - OnlyOne: - _asm mov al, [edi] - _asm mov ah, [esi] - _asm mov al, [edx+eax] - _asm mov [edi], al - - NotOdd: - dptr += gr_screen.rowsize; - fp += width; - #else - int i; - for (i=0; i< wc; i++ ) { - *dptr++ = Current_alphacolor->table.lookup[*fp++][*dptr]; - } - fp += width - wc; - dptr += gr_screen.rowsize - wc; - #endif - } - } else { // No alpha color -#endif - for (row=0; row 5 ) - *dptr = gr_screen.current_color.raw8; - dptr++; - fp++; - } - fp += width - wc; - dptr += gr_screen.rowsize - wc; - } - // } - } - gr_unlock(); -} - #ifndef PLAT_UNIX HFONT MyhFont = NULL; extern HDC hDibDC; @@ -963,7 +765,7 @@ int gr_create_font(const char * typeface) return fontnum; } -void grx_set_font(int fontnum) +void gr_set_font(int fontnum) { if ( fontnum < 0 ) { Current_font = NULL; diff --git a/src/graphics/gropengl.cpp b/src/graphics/gropengl.cpp index 3e9512e..5ae2c25 100644 --- a/src/graphics/gropengl.cpp +++ b/src/graphics/gropengl.cpp @@ -352,8 +352,6 @@ void gr_opengl_init() mprintf(("\n")); - extern int D3D_enabled; - D3D_enabled = 1; switch (bpp) { case 15: diff --git a/src/graphics/gropengl1.cpp b/src/graphics/gropengl1.cpp index 75e2a6c..ec00435 100644 --- a/src/graphics/gropengl1.cpp +++ b/src/graphics/gropengl1.cpp @@ -115,7 +115,6 @@ static void opengl1_init_func_pointers() gr_screen.gf_flip = gr_opengl1_flip; gr_screen.gf_set_clip = gr_opengl1_set_clip; gr_screen.gf_reset_clip = gr_opengl1_reset_clip; - gr_screen.gf_set_font = grx_set_font; gr_screen.gf_set_color = gr_opengl_set_color; gr_screen.gf_set_bitmap = gr_opengl_set_bitmap; diff --git a/src/hud/hudreticle.cpp b/src/hud/hudreticle.cpp index 4672893..e8c7d70 100644 --- a/src/hud/hudreticle.cpp +++ b/src/hud/hudreticle.cpp @@ -196,7 +196,6 @@ #include "hudreticle.h" #include "hud.h" -#include "pixel.h" #include "math.h" #include "player.h" #include "ship.h" diff --git a/src/menuui/mainhallmenu.cpp b/src/menuui/mainhallmenu.cpp index 6366c02..f31f9d5 100644 --- a/src/menuui/mainhallmenu.cpp +++ b/src/menuui/mainhallmenu.cpp @@ -863,11 +863,6 @@ void main_hall_init(int main_hall_num) // remove any multiplayer flags from the game mode Game_mode &= ~(GM_MULTIPLAYER); - // set the interface palette -#ifndef HARDWARE_ONLY - palette_use_bm_palette(Main_hall_bitmap); -#endif - Main_hall_mask_w = -1; Main_hall_mask_h = -1; diff --git a/src/menuui/playermenu.cpp b/src/menuui/playermenu.cpp index d3da298..b2f6069 100644 --- a/src/menuui/playermenu.cpp +++ b/src/menuui/playermenu.cpp @@ -354,7 +354,6 @@ UI_INPUTBOX Player_select_input_box; // input box for adding new pilot name int Player_select_background_bitmap; // bitmap for this screen // int Player_select_palette; // palette bitmap for this screen int Player_select_autoaccept = 0; -// int Player_select_palette_set = 0; // flag indicating if this is the absolute first pilot created and selected. Used to determine // if the main hall should display the help overlay screen @@ -456,9 +455,6 @@ void player_select_init() /* Demo_title_bitmap = bm_load(Demo_title_bitmap_filename); if ( Demo_title_bitmap >= 0 ) { -#ifndef HARDWARE_ONLY - palette_use_bm_palette(Demo_title_bitmap); -#endif Demo_title_active = 1; Demo_title_expire_timestamp = timestamp(5000); } else { @@ -631,14 +627,6 @@ void player_select_do() } #endif - //if ( !Player_select_palette_set ) { - // SDL_assert(Player_select_palette >= 0); -//#ifndef HARDWARE_ONLY -// palette_use_bm_palette(Player_select_palette); -//#endif -// Player_select_palette_set = 1; -// } - // set the input box at the "virtual" line 0 to be active so the player can enter a callsign if (Player_select_input_mode){ Player_select_input_box.set_focus(); diff --git a/src/missionui/missionscreencommon.cpp b/src/missionui/missionscreencommon.cpp index c3476a8..9d40756 100644 --- a/src/missionui/missionscreencommon.cpp +++ b/src/missionui/missionscreencommon.cpp @@ -660,10 +660,6 @@ void common_set_interface_palette(const char *filename) Error(LOCATION, "Could not load in \"%s\"!", filename); } #endif - -#ifndef HARDWARE_ONLY - palette_use_bm_palette(InterfacePaletteBitmap); -#endif } // release the interface palette .pcx file, and restore the game palette diff --git a/src/model/modelinterp.cpp b/src/model/modelinterp.cpp index ec07531..a8f1fc1 100644 --- a/src/model/modelinterp.cpp +++ b/src/model/modelinterp.cpp @@ -687,41 +687,25 @@ void model_interp_flatpoly(ubyte * p,polymodel * pm) Interp_list[i] = &Interp_points[verts[i*2]]; if ( Interp_flags & MR_NO_LIGHTING ) { - if ( D3D_enabled ) { - Interp_list[i]->r = 191; - Interp_list[i]->g = 191; - Interp_list[i]->b = 191; - } else { - Interp_list[i]->b = 191; - } + Interp_list[i]->r = 191; + Interp_list[i]->g = 191; + Interp_list[i]->b = 191; } else { int vertnum = verts[i*2+0]; int norm = verts[i*2+1]; if ( Interp_flags & MR_NO_SMOOTHING ) { - if ( D3D_enabled ) { - light_apply_rgb( &Interp_list[i]->r, &Interp_list[i]->g, &Interp_list[i]->b, Interp_verts[vertnum], vp(p+8), Interp_light ); - } else { - Interp_list[i]->b = light_apply( Interp_verts[vertnum], vp(p+8), Interp_light ); - } + light_apply_rgb( &Interp_list[i]->r, &Interp_list[i]->g, &Interp_list[i]->b, Interp_verts[vertnum], vp(p+8), Interp_light ); } else { // if we're not using saved lighting if ( !Interp_use_saved_lighting && !Interp_light_applied[norm] ) { - if ( D3D_enabled ) { - light_apply_rgb( &Interp_lighting->r[norm], &Interp_lighting->g[norm], &Interp_lighting->b[norm], Interp_verts[vertnum], vp(p+8), Interp_light ); - } else { - Interp_lighting->b[norm] = light_apply( Interp_verts[vertnum], Interp_norms[norm], Interp_light ); - } + light_apply_rgb( &Interp_lighting->r[norm], &Interp_lighting->g[norm], &Interp_lighting->b[norm], Interp_verts[vertnum], vp(p+8), Interp_light ); Interp_light_applied[norm] = 1; } - if ( D3D_enabled ) { - Interp_list[i]->r = Interp_lighting->r[norm]; - Interp_list[i]->g = Interp_lighting->g[norm]; - Interp_list[i]->b = Interp_lighting->b[norm]; - } else { - Interp_list[i]->b = Interp_lighting->b[norm]; - } + Interp_list[i]->r = Interp_lighting->r[norm]; + Interp_list[i]->g = Interp_lighting->g[norm]; + Interp_list[i]->b = Interp_lighting->b[norm]; } } } @@ -732,11 +716,7 @@ void model_interp_flatpoly(ubyte * p,polymodel * pm) } if ( !(Interp_flags & MR_NO_POLYS)) { - if ( D3D_enabled ) { - g3_draw_poly( nv, Interp_list, TMAP_FLAG_GOURAUD | TMAP_FLAG_RGB ); - } else { - g3_draw_poly( nv, Interp_list, TMAP_FLAG_GOURAUD | TMAP_FLAG_RAMP ); - } + g3_draw_poly( nv, Interp_list, TMAP_FLAG_GOURAUD | TMAP_FLAG_RGB ); } if (Interp_flags & (MR_SHOW_OUTLINE|MR_SHOW_OUTLINE_PRESET)) { @@ -825,69 +805,26 @@ void model_interp_tmappoly(ubyte * p,polymodel * pm) // SDL_assert( verts[i].normnum == verts[i].vertnum ); if ( Interp_flags & MR_NO_LIGHTING ) { - if ( D3D_enabled ) { - Interp_list[i]->r = 191; - Interp_list[i]->g = 191; - Interp_list[i]->b = 191; - } else { - Interp_list[i]->b = 191; - } + Interp_list[i]->r = 191; + Interp_list[i]->g = 191; + Interp_list[i]->b = 191; } else { int vertnum = verts[i].vertnum; int norm = verts[i].normnum; if ( Interp_flags & MR_NO_SMOOTHING ) { - if ( D3D_enabled ) { - light_apply_rgb( &Interp_list[i]->r, &Interp_list[i]->g, &Interp_list[i]->b, Interp_verts[vertnum], vp(p+8), Interp_light ); - } else { - Interp_list[i]->b = light_apply( Interp_verts[vertnum], vp(p+8), Interp_light ); - } + light_apply_rgb( &Interp_list[i]->r, &Interp_list[i]->g, &Interp_list[i]->b, Interp_verts[vertnum], vp(p+8), Interp_light ); } else { // if we're applying lighting as normal, and not using saved lighting if ( !Interp_use_saved_lighting && !Interp_light_applied[norm] ) { - - if ( D3D_enabled ) { - light_apply_rgb( &Interp_lighting->r[norm], &Interp_lighting->g[norm], &Interp_lighting->b[norm], Interp_verts[vertnum], Interp_norms[norm], Interp_light ); - - } else { - int li; - ubyte l; - l = light_apply( Interp_verts[vertnum], Interp_norms[norm], Interp_light ); - - - if ( Detail.lighting > 1 ) { - // Add in precalculated muzzle flashes - float fl = i2fl(l)/255.0f; - ubyte *tmp = &Interp_lights[norm*pm->num_lights]; - - for ( li=0; linum_lights; li++ ) { - fl += i2fl(tmp[li])*pm->lights[li].value; - } - - if ( fl < 0.0f ) { - fl = 0.0f; - } else if ( fl > 1.0f ) { - fl = 1.0f; - } - - l = (ubyte)fl2i(fl*255.0f); - - } - - Interp_lighting->b[norm] = l; - } - + light_apply_rgb( &Interp_lighting->r[norm], &Interp_lighting->g[norm], &Interp_lighting->b[norm], Interp_verts[vertnum], Interp_norms[norm], Interp_light ); Interp_light_applied[norm] = 1; } - if ( D3D_enabled ) { - Interp_list[i]->r = Interp_lighting->r[norm]; - Interp_list[i]->g = Interp_lighting->g[norm]; - Interp_list[i]->b = Interp_lighting->b[norm]; - } else { - Interp_list[i]->b = Interp_lighting->b[norm]; - } + Interp_list[i]->r = Interp_lighting->r[norm]; + Interp_list[i]->g = Interp_lighting->g[norm]; + Interp_list[i]->b = Interp_lighting->b[norm]; } } } @@ -920,7 +857,7 @@ void model_interp_tmappoly(ubyte * p,polymodel * pm) // all textured polys go through here if ( Interp_tmap_flags & TMAP_FLAG_TEXTURED ) { // subspace special case - if ( Interp_subspace && D3D_enabled ) { + if (Interp_subspace) { gr_set_bitmap( pm->textures[w(p+40)], GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.2f, -1, -1); } // all other textures @@ -1704,77 +1641,6 @@ MONITOR( NumMedModelsRend ); MONITOR( NumLowModelsRend ); -typedef struct model_cache { - int model_num; - //matrix orient; - vector pos; - int num_lights; - - float last_dot; - - float cr; - - int w, h; - ubyte *data; - int cached_valid; - int bitmap_id; - - angles angs; - - // thrust stuff - float thrust_scale; - int thrust_bitmap; - int thrust_glow_bitmap; - float thrust_glow_noise; - - int last_frame_rendered; // last frame in which this model was rendered not from the cache -} model_cache; - -#define MAX_MODEL_CACHE MAX_OBJECTS -model_cache Model_cache[MAX_MODEL_CACHE]; // Indexed by objnum -int Model_cache_inited = 0; - - - -// Returns 0 if not valid points -int model_cache_calc_coords(vector *pnt,float rad, float *cx, float *cy, float *cr) -{ - vertex pt; - ubyte flags; - - flags = g3_rotate_vertex(&pt,pnt); - - if (flags == 0) { - - g3_project_vertex(&pt); - - if (!(pt.flags & (PF_OVERFLOW|CC_BEHIND))) { - - *cx = pt.sx; - *cy = pt.sy; - *cr = rad*Matrix_scale.xyz.x*Canv_w2/pt.z; - - if ( *cr < 1.0f ) { - *cr = 1.0f; - } - - int x1, x2, y1, y2; - - x1 = fl2i(*cx-*cr); - if ( x1 < gr_screen.clip_left ) return 0; - x2 = fl2i(*cx+*cr); - if ( x2 > gr_screen.clip_right ) return 0; - y1 = fl2i(*cy-*cr); - if ( y1 < gr_screen.clip_top ) return 0; - y2 = fl2i(*cy+*cr); - if ( y2 > gr_screen.clip_bottom ) return 0; - - return 1; - } - } - return 0; -} - void model_really_render(int model_num, matrix *orient, vector * pos, uint flags, int light_ignore_id ); @@ -1848,49 +1714,6 @@ int model_get_rotated_bitmap_points(vertex *pnt,float angle, float rad, vertex * } -int Model_caching = 1; -DCF_BOOL( model_caching, Model_caching ); - -extern int Tmap_scan_read; // 0 = normal mapper, 1=read, 2=write - -#define MODEL_MAX_BITMAP_SIZE 128 -ubyte tmp_bitmap[MODEL_MAX_BITMAP_SIZE*MODEL_MAX_BITMAP_SIZE]; - -void mc_get_bmp( ubyte *data, int x, int y, int w, int h ) -{ - gr_lock(); - - int i,j; - - for (i = 0; i < h; i++) { - ubyte *dptr = GR_SCREEN_PTR(ubyte,x,i+y); - ubyte *sptr = data+(i*w); - for (j=0; jrad ); - } else { - num_lights = light_filter_push( objnum, pos, pm->rad ); - } + num_lights = light_filter_push( objnum, pos, pm->rad ); } - model_try_cache_render(model_num, orient, pos, flags, objnum, num_lights ); + model_really_render(model_num, orient, pos, flags, objnum); if ( !(flags & MR_NO_LIGHTING ) ) { light_filter_pop(); @@ -1998,42 +1815,6 @@ void model_render(int model_num, matrix *orient, vector * pos, uint flags, int o } } - -void model_cache_init() -{ - if ( !Model_cache_inited ) { - int i; - - Model_cache_inited = 1; - - for (i=0; i-1) && (objnum 3) ) { - if ( mc ) { - mc->cached_valid = 0; - } - model_really_render(model_num, orient, pos, flags, objnum ); - return; - } - - SDL_assert( mc != NULL ); - - // Fake the detail level based on framerate. - if ( 1.0f / flFrametime < Mc_framerate_lo[Model_object_caching_tmp] ) { - Model_object_caching_tmp--; - // mprintf(( "Model cache level bumped down to %d\n", Model_object_caching )); - } else if ( 1.0f / flFrametime > Mc_framerate_hi[Model_object_caching_tmp] ) { - Model_object_caching_tmp++; - // mprintf(( "Model cache level bumped up to %d\n", Model_object_caching )); - } - - int tmp_detail_level = Model_object_caching_tmp + Mc_detail_add[Detail.object_caching]; - - if ( tmp_detail_level < 0 ) { - tmp_detail_level = 0; - } else if (tmp_detail_level > MAX_DETAIL_LEVEL ) { - tmp_detail_level = MAX_DETAIL_LEVEL; - } - - if ( tmp_detail_level > 3 ) { - if ( mc ) { - mc->cached_valid = 0; - } - model_really_render(model_num, orient, pos, flags, objnum ); - return; - } - - -// static int last_one = -1; -// if ( last_one != tmp_detail_level ) { -// last_one = tmp_detail_level; -// mprintf(( "Detail level %d\n", tmp_detail_level )); -// } - -// if ( key_pressed(SDLK_LSHIFT) ) { -// mc->cached_valid = 0; -// model_really_render(model_num, orient, pos, flags, objnum ); -// return; -// } - - -// mprintf(( "Rendering cache model\n" )); - - polymodel *pm = model_get(model_num); - vertex v[4]; - vertex *vertlist[4] = { &v[0], &v[1], &v[2], &v[3] }; - float cx, cy, cr; - vertex pt; - ubyte ccflags; - - matrix tempm, tempm2; - angles new_angles; - - vm_copy_transpose_matrix(&tempm2,orient); - vm_matrix_x_matrix(&tempm,&tempm2,&Eye_matrix); - vm_extract_angles_matrix(&new_angles, &tempm ); - - if ( !model_cache_calc_coords(pos,pm->rad, &cx, &cy, &cr) ) { - // Not onscreen, do a real render and exit - mc->cached_valid = 0; - model_really_render(model_num, orient, pos, flags, objnum ); - return; - } - - //================================================================ - // A bunch of checks to see if we need to redraw the model or not - - - vector ship_to_eye; - - vm_vec_sub( &ship_to_eye, &Eye_position, pos ); - vm_vec_normalize_safe(&ship_to_eye); - float this_dot = vm_vec_dot( &ship_to_eye, &orient->fvec ); - this_dot += vm_vec_dot( &ship_to_eye, &orient->rvec ); - - float diff = 0.0f; - - if ( !mc->cached_valid ) { - // Nothing cached - goto RedrawIt; - } - - SDL_assert( mc->data != NULL ); - - if (Framecount - mc->last_frame_rendered > 1 + 2*(MAX_DETAIL_LEVEL - Detail.object_caching - 1)) { - goto RedrawIt; - } - - diff = fl_abs( this_dot - mc->last_dot ); - - if ( diff > Mc_viewer_pos_factor[tmp_detail_level] ) { -// mprintf(( "Redraw!!! %.4f\n", diff )); - goto RedrawIt; - } - -// if ( key_pressed(SDLK_LSHIFT) ) { -// goto RedrawIt; -// } - - if (tmp_detail_level > 2) { - if ( mc->thrust_glow_bitmap != Interp_thrust_glow_bitmap ) { - // Engline glow bitmap changed - // mprintf(( "MC: Glow bitmap changed! %d -> %d\n", mc->thrust_glow_bitmap, Interp_thrust_glow_bitmap )); - goto RedrawIt; - } - } - - if (tmp_detail_level > 2) { - if ( cr > 4.0f ) { - float diff = fl_abs( mc->thrust_scale - Interp_thrust_scale ); - - if ( diff > 0.1f ) { - // Thruster size has changed - //mprintf(( "MC: Thruster size changed! %.2f -> %.2f\n", mc->thrust_scale, Interp_thrust_scale )); - goto RedrawIt; - } - } - } - -// if (0) { -// float diff = fl_abs( mc->thrust_glow_noise - Interp_thrust_glow_noise ); - -// if ( diff > 0.1f ) { - // Glow noise has changed - //mprintf(( "MC: Thruster glow changed! %.2f -> %.2f\n", mc->thrust_glow_noise, Interp_thrust_glow_noise )); -// goto RedrawIt; -// } -// } - - - if ( mc->model_num != model_num ) { - // Model changed - goto RedrawIt; - } - - if ( cr>mc->cr*Mc_size_factor[tmp_detail_level] ) { - // Scaling up too far - goto RedrawIt; - } - - if (tmp_detail_level > 2) { - if ( cr > 4.0f ) { - if ( !(Interp_flags & MR_NO_LIGHTING ) ) { - if (mc->num_lights != num_lights) { - // Lighting changed - goto RedrawIt; - } - } - } - } - - // This method is correct, but rotating ship makes things redraw which is too slow. - #if 0 - if ( cr > 4.0f ) { - // Check orientation - float angle_error = max( fl_abs( mc->angs.p-new_angles.p ),fl_abs( mc->angs.h-new_angles.h )); - - // Exact - //if ( angle_error > 0.075f ) { - - // Rough - if ( angle_error > 0.40f ) { - // Ship/view turned too much - //mprintf(( "Ship/view turned too much %.4f\n", angle_error )); - - goto RedrawIt; - } - } - #endif - - -// mprintf(( "Dot = %.5f\n", dot )); - -#if 0 - if (0) { - float dx, dy, dz; - - dx = vm_vec_dot( &orient->rvec, &mc->orient.rvec )+1.0f; - dy = vm_vec_dot( &orient->uvec, &mc->orient.uvec )+1.0f; - dz = vm_vec_dot( &orient->fvec, &mc->orient.fvec )+1.0f; - - float angle_error = (dx+dy+dz)*1000.0f/6.0f; - - //mprintf(( "Angle_error = %.4f\n", angle_error )); - - // Compare it to 999.75f at R = 64.0f - // 0.0000f at R = 0.0f - - float cmp_val = 999.75f; // old -// if ( is_asteroid ) { -// cmp_val = scale_it( 0.0f, 999.75f, cr, 0.0f, 64.0f ); -// } - - if ( angle_error < cmp_val ) { - // Ship turned too much - goto RedrawIt; - } - } -#endif - - - // Have a valid cache entry, mc - ccflags = g3_rotate_vertex(&pt,pos); - - if ( ccflags ) { - // offscreen - goto RedrawIt; - } - - if ( model_get_rotated_bitmap_points(&pt,mc->angs.b - new_angles.b, pm->rad, v )) { - // offscreen - goto RedrawIt; - } - - - gr_set_bitmap( mc->bitmap_id ); - - Tmap_scan_read = 2; - g3_draw_poly(4, vertlist, TMAP_FLAG_TEXTURED ); - Tmap_scan_read = 0; - - // if ( key_pressed(SDLK_LSHIFT) ) { - // gr_set_color( 255, 0, 0 ); - // gr_pixel( fl2i(v[0].sx), fl2i(v[0].sy) ); - // } - - //if ( key_pressed(SDLK_RSHIFT) ) { - // gr_line( fl2i(v[0].sx), fl2i(v[0].sy), fl2i(v[1].sx), fl2i(v[1].sy) ); - // gr_line( fl2i(v[1].sx), fl2i(v[1].sy), fl2i(v[2].sx), fl2i(v[2].sy) ); - // gr_line( fl2i(v[2].sx), fl2i(v[2].sy), fl2i(v[3].sx), fl2i(v[3].sy) ); - // gr_line( fl2i(v[3].sx), fl2i(v[3].sy), fl2i(v[0].sx), fl2i(v[0].sy) ); - //} - - - return; - - - //========================================================== - // Cache is bad for model, so draw it and save it -RedrawIt: - - -// if ( mc->data != NULL ) { -// free(mc->data); -// mc->data = NULL; -// } - - if ( mc->bitmap_id != -1 ) { - bm_release(mc->bitmap_id); - mc->bitmap_id = -1; - } - - mc->cached_valid = 0; - mc->model_num = model_num; - mc->pos = *pos; - //mc->orient = *orient; - mc->cr = cr; - mc->angs = new_angles; //-Physics_viewer_bank; - - mc->thrust_scale = Interp_thrust_scale; - mc->thrust_bitmap = Interp_thrust_bitmap; - mc->thrust_glow_bitmap = Interp_thrust_glow_bitmap; - mc->thrust_glow_noise = Interp_thrust_glow_noise; - - mc->last_dot = this_dot; - - if ( cr > MODEL_MAX_BITMAP_SIZE/2-1 ) - goto JustDrawIt; - - //Physics_viewer_bank - - ccflags = g3_rotate_vertex(&pt,pos); - - if ( ccflags ) { - goto JustDrawIt; - } - - model_get_rotated_bitmap_points(&pt,0.0f, pm->rad, v ); - - int x1, y1, x2, y2, w, h; - - x1 = fl_round_2048( v[0].sx ); - y1 = fl_round_2048( v[0].sy ); - - x2 = fl_round_2048( v[2].sx ); //+0.5f ); - y2 = fl_round_2048( v[2].sy ); //+0.5f ); - - if ( x1 < gr_screen.clip_left) - goto JustDrawIt; - - if ( y1 < gr_screen.clip_top ) - goto JustDrawIt; - - if ( x2 > gr_screen.clip_right) - goto JustDrawIt; - - if ( y2 > gr_screen.clip_bottom) - goto JustDrawIt; - - w = x2 - x1 + 1; - if ( w < 0 ) - Int3(); - - if ( w < 2 ) - w = 2; - - h = y2 - y1 + 1; - - if ( h < 0 ) - Int3(); - - if ( h < 2 ) - h = 2; - - if ( w > MODEL_MAX_BITMAP_SIZE ) - goto JustDrawIt; - - if ( h > MODEL_MAX_BITMAP_SIZE ) - goto JustDrawIt; - - mc->w = w; - mc->h = h; - -// mprintf(( "Mallocing a %dx%d bitmap\n", w, h )); - - if ( mc->data == NULL ) { - mc->data = (ubyte *)malloc( MODEL_MAX_BITMAP_SIZE * MODEL_MAX_BITMAP_SIZE ); - } - -// mprintf(( "Done mallocing a %dx%d bitmap\n", w, h )); - - if ( mc->data == NULL ) { - goto JustDrawIt; - } - for (i = 0; i < w*h; i++) { - mc->data[i] = 255; - } - - - mc->bitmap_id = bm_create( 8, mc->w, mc->h, mc->data, 0 ); - - if ( mc->bitmap_id < 0 ) { - goto JustDrawIt; - } - - // Save stars and stuff on screen - mc_get_bmp( tmp_bitmap, x1, y1, w, h ); - - mc->num_lights = num_lights; - - // Didn't render a cached one... so render it and then save it in the cache - - // Turn on stippling - model_really_render(model_num, orient, pos, flags, objnum ); - - // Save screen to bitmap - gr_set_bitmap( mc->bitmap_id ); - Tmap_scan_read = 1; - g3_draw_poly(4, vertlist, TMAP_FLAG_TEXTURED ); - Tmap_scan_read = 0; - - // Restore stars and stuff to screen - mc_put_bmp( tmp_bitmap, x1, y1, w, h ); - - // Draw the model - gr_set_bitmap( mc->bitmap_id ); - Tmap_scan_read = 2; - g3_draw_poly(4, vertlist, TMAP_FLAG_TEXTURED ); - Tmap_scan_read = 0; - - mc->cached_valid = 1; - mc->last_frame_rendered = Framecount; - return; - -JustDrawIt: - - // Too big to save - model_really_render(model_num, orient, pos, flags, objnum ); - */ -} - // Find the distance from p0 to the closest point on a box. // The box's dimensions from 'min' to 'max'. float interp_closest_dist_to_box( vector *hitpt, vector *p0, vector *min, vector *max ) @@ -2532,8 +1896,6 @@ DCF(tiling, "") } } -extern void d3d_zbias(int bias); -extern void opengl_zbias(int bias); void model_really_render(int model_num, matrix *orient, vector * pos, uint flags, int light_ignore_id ) { int i, detail_level; @@ -2571,11 +1933,7 @@ void model_really_render(int model_num, matrix *orient, vector * pos, uint flags pm = model_get(model_num); // Set the flags we will pass to the tmapper - if ( D3D_enabled ) { - Interp_tmap_flags = TMAP_FLAG_GOURAUD | TMAP_FLAG_RGB; - } else { - Interp_tmap_flags = TMAP_FLAG_GOURAUD | TMAP_FLAG_RAMP; - } + Interp_tmap_flags = TMAP_FLAG_GOURAUD | TMAP_FLAG_RGB; // if we're in nebula mode if((The_mission.flags & MISSION_FLAG_FULLNEB) && (Neb2_render_mode != NEB2_RENDER_NONE)){ @@ -2892,11 +2250,7 @@ void submodel_render(int model_num, int submodel_num, matrix *orient, vector * p pm = model_get(model_num); // Set the flags we will pass to the tmapper - if ( D3D_enabled ) { - Interp_tmap_flags = TMAP_FLAG_GOURAUD | TMAP_FLAG_RGB; - } else { - Interp_tmap_flags = TMAP_FLAG_GOURAUD | TMAP_FLAG_RAMP; - } + Interp_tmap_flags = TMAP_FLAG_GOURAUD | TMAP_FLAG_RGB; // if we're in nebula mode if((The_mission.flags & MISSION_FLAG_FULLNEB) && (Neb2_render_mode != NEB2_RENDER_NONE)){ @@ -2915,11 +2269,7 @@ void submodel_render(int model_num, int submodel_num, matrix *orient, vector * p } if ( !(Interp_flags & MR_NO_LIGHTING ) ) { - if ( D3D_enabled ) { - light_filter_push( -1, pos, pm->submodel[submodel_num].rad ); - } else { - light_filter_push( light_ignore_id, pos, pm->submodel[submodel_num].rad ); - } + light_filter_push( -1, pos, pm->submodel[submodel_num].rad ); } g3_start_instance_matrix(pos,orient); diff --git a/src/model/modelread.cpp b/src/model/modelread.cpp index 792a4c2..7ccedef 100644 --- a/src/model/modelread.cpp +++ b/src/model/modelread.cpp @@ -892,9 +892,6 @@ void model_init() Polygon_models[i] = NULL; } - // Init the model caching system - model_cache_init(); - atexit( model_free_all ); model_initted = 1; } diff --git a/src/network/multi_pinfo.cpp b/src/network/multi_pinfo.cpp index de4415c..79752b7 100644 --- a/src/network/multi_pinfo.cpp +++ b/src/network/multi_pinfo.cpp @@ -779,9 +779,6 @@ void multi_pinfo_do_medals() // load up and use the proper palette void multi_pinfo_set_palette() { -#ifndef HARDWARE_ONLY - palette_use_bm_palette(Multi_pinfo_bitmap); -#endif } // build the stats value strings for this player diff --git a/src/network/multiui.cpp b/src/network/multiui.cpp index b701659..29634b1 100644 --- a/src/network/multiui.cpp +++ b/src/network/multiui.cpp @@ -894,12 +894,6 @@ void multi_common_set_palette() if(Multi_common_interface_palette == -1){ multi_common_load_palette(); } - - if(Multi_common_interface_palette != -1){ -#ifndef HARDWARE_ONLY - palette_use_bm_palette(Multi_common_interface_palette); -#endif - } } // unload the bitmap palette diff --git a/src/object/object.cpp b/src/object/object.cpp index bde3cdf..c9d8597 100644 --- a/src/object/object.cpp +++ b/src/object/object.cpp @@ -1201,16 +1201,7 @@ void obj_move_call_physics(object *objp, float frametime) goto obj_maybe_fire; } - if ( (objp->type == OBJ_ASTEROID) && (Model_caching && (!D3D_enabled) ) ) { - // If we're doing model caching, don't rotate asteroids - vector tmp = objp->phys_info.rotvel; - - objp->phys_info.rotvel = vmd_zero_vector; - physics_sim(&objp->pos, &objp->orient, &objp->phys_info, frametime ); // simulate the physics - objp->phys_info.rotvel = tmp; - } else { - physics_sim(&objp->pos, &objp->orient, &objp->phys_info, frametime ); // simulate the physics - } + physics_sim(&objp->pos, &objp->orient, &objp->phys_info, frametime ); // simulate the physics // This code seems to have no effect - DB 1/12/99 //if ( MULTIPLAYER_CLIENT && (objp != Player_obj) ){ @@ -1480,24 +1471,20 @@ void obj_move_all_post(object *objp, float frametime) } if ( cast_light ) { - if ( D3D_enabled ) { - weapon_info * wi = &Weapon_info[Weapons[objp->instance].weapon_info_index]; + weapon_info * wi = &Weapon_info[Weapons[objp->instance].weapon_info_index]; - if ( wi->render_type == WRT_LASER ) { - color c; - float r,g,b; + if ( wi->render_type == WRT_LASER ) { + color c; + float r,g,b; - // get the laser color - weapon_get_laser_color(&c, objp); + // get the laser color + weapon_get_laser_color(&c, objp); - r = i2fl(c.red)/255.0f; - g = i2fl(c.green)/255.0f; - b = i2fl(c.blue)/255.0f; - light_add_point( &objp->pos, 10.0f, 20.0f, 1.0f, r, g, b, objp->parent ); - //light_add_point( &objp->pos, 10.0f, 20.0f, 1.0f, 0.0f, 0.0f, 1.0f, objp->parent ); - } else { - light_add_point( &objp->pos, 10.0f, 20.0f, 1.0f, 1.0f, 1.0f, 1.0f, objp->parent ); - } + r = i2fl(c.red)/255.0f; + g = i2fl(c.green)/255.0f; + b = i2fl(c.blue)/255.0f; + light_add_point( &objp->pos, 10.0f, 20.0f, 1.0f, r, g, b, objp->parent ); + //light_add_point( &objp->pos, 10.0f, 20.0f, 1.0f, 0.0f, 0.0f, 1.0f, objp->parent ); } else { light_add_point( &objp->pos, 10.0f, 20.0f, 1.0f, 1.0f, 1.0f, 1.0f, objp->parent ); } diff --git a/src/render/3ddraw.cpp b/src/render/3ddraw.cpp index 8208d1c..f6d25c6 100644 --- a/src/render/3ddraw.cpp +++ b/src/render/3ddraw.cpp @@ -175,7 +175,6 @@ #include "3dinternal.h" #include "tmapper.h" -#include "scaler.h" #include "2d.h" #include "floating.h" #include "physics.h" // For Physics_viewer_bank for g3_draw_rotated_bitmap diff --git a/src/ship/shield.cpp b/src/ship/shield.cpp index 5b23025..67caf94 100644 --- a/src/ship/shield.cpp +++ b/src/ship/shield.cpp @@ -583,7 +583,7 @@ void render_shield(int shield_num) //, matrix *orient, vector *centerp) } // At detail levels 1, 3, animations play at double speed to reduce load. - if (!D3D_enabled || (Detail.shield_effects == 1) || (Detail.shield_effects == 3)) { + if ( (Detail.shield_effects == 1) || (Detail.shield_effects == 3) ) { Shield_hits[shield_num].start_time -= Frametime; } @@ -640,7 +640,7 @@ void render_shield(int shield_num) //, matrix *orient, vector *centerp) } gr_set_bitmap(bitmap_id, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, alpha, -1, -1); - if (!D3D_enabled || (Detail.shield_effects == 1) || (Detail.shield_effects == 2)) { + if ( (Detail.shield_effects == 1) || (Detail.shield_effects == 2) ) { if ( bitmap_id != - 1 ) { render_low_detail_shield_bitmap(&Global_tris[Shield_hits[shield_num].tri_list[0]], orient, centerp, Shield_hits[shield_num].rgb[0], Shield_hits[shield_num].rgb[1], Shield_hits[shield_num].rgb[2]); } @@ -934,7 +934,7 @@ void create_shield_explosion(int objnum, int model_num, matrix *orient, vector * //nprintf(("AI", "Frame %i: Creating explosion on %i.\n", Framecount, objnum)); - if (!D3D_enabled || (Detail.shield_effects == 1) || (Detail.shield_effects == 2)) { + if ( (Detail.shield_effects == 1) || (Detail.shield_effects == 2) ) { create_shield_low_detail(objnum, model_num, orient, centerp, tcp, tr0, shieldp); return; } diff --git a/src/ship/shipfx.cpp b/src/ship/shipfx.cpp index 4c29210..3e1463a 100644 --- a/src/ship/shipfx.cpp +++ b/src/ship/shipfx.cpp @@ -1714,13 +1714,8 @@ void shipfx_emit_spark( int n, int sn ) } } - if ( D3D_enabled ) { - pe.num_low = 25; // Lowest number of particles to create (hardware) - pe.num_high = 30; // Highest number of particles to create (hardware) - } else { - pe.num_low = 5; // Lowest number of particles to create (software) - pe.num_high = 7; // Highest number of particles to create (software) - } + pe.num_low = 25; // Lowest number of particles to create (hardware) + pe.num_high = 30; // Highest number of particles to create (hardware) pe.normal_variance = 1.0f; // How close they stick to that normal 0=good, 1=360 degree pe.min_vel = 2.0f; // How fast the slowest particle can move pe.max_vel = 12.0f; // How fast the fastest particle can move @@ -1732,13 +1727,8 @@ void shipfx_emit_spark( int n, int sn ) pe.min_rad = 0.7f; // Min radius pe.max_rad = 1.3f; // Max radius - if ( D3D_enabled ) { - pe.num_low = int (20 * spark_num_scale); // Lowest number of particles to create (hardware) - pe.num_high = int (50 * spark_num_scale); // Highest number of particles to create (hardware) - } else { - pe.num_low = 2; // Lowest number of particles to create (software) - pe.num_high = 8; // Highest number of particles to create (software) - } + pe.num_low = int (20 * spark_num_scale); // Lowest number of particles to create (hardware) + pe.num_high = int (50 * spark_num_scale); // Highest number of particles to create (hardware) pe.normal_variance = 0.2f * spark_width_scale; // How close they stick to that normal 0=good, 1=360 degree pe.min_vel = 3.0f; // How fast the slowest particle can move pe.max_vel = 12.0f; // How fast the fastest particle can move diff --git a/src/starfield/starfield.cpp b/src/starfield/starfield.cpp index 780f9ab..d04f545 100644 --- a/src/starfield/starfield.cpp +++ b/src/starfield/starfield.cpp @@ -1078,45 +1078,30 @@ void subspace_render() gr_zbuffer_set(GR_ZBUFF_NONE); - if ( !D3D_enabled ) { + int render_flags = MR_NO_LIGHTING | MR_ALWAYS_REDRAW; - int render_flags = MR_NO_LIGHTING | MR_ALWAYS_REDRAW; + Interp_subspace = 1; + Interp_subspace_offset_u = 1.0f - subspace_offset_u; + Interp_subspace_offset_v = 0.0f; - Interp_subspace = 1; - Interp_subspace_offset_u = 1.0f - subspace_offset_u; - Interp_subspace_offset_v = 0.0f; + model_set_thrust( Subspace_model_inner, 1.0f, -1, Subspace_glow_bitmap, Noise[framenum] ); + render_flags |= MR_SHOW_THRUSTERS; + model_render( Subspace_model_outer, &tmp, &Eye_position, render_flags ); //MR_NO_CORRECT|MR_SHOW_OUTLINE - model_set_thrust( Subspace_model_inner, 1.0f, -1, Subspace_glow_bitmap, Noise[framenum] ); - render_flags |= MR_SHOW_THRUSTERS; - model_render( Subspace_model_outer, &tmp, &Eye_position, render_flags ); //MR_NO_CORRECT|MR_SHOW_OUTLINE + Interp_subspace = 1; + Interp_subspace_offset_u = 1.0f - subspace_offset_u_inner; + Interp_subspace_offset_v = 0.0f; - } else { - - int render_flags = MR_NO_LIGHTING | MR_ALWAYS_REDRAW; - - Interp_subspace = 1; - Interp_subspace_offset_u = 1.0f - subspace_offset_u; - Interp_subspace_offset_v = 0.0f; - - model_set_thrust( Subspace_model_inner, 1.0f, -1, Subspace_glow_bitmap, Noise[framenum] ); - render_flags |= MR_SHOW_THRUSTERS; - model_render( Subspace_model_outer, &tmp, &Eye_position, render_flags ); //MR_NO_CORRECT|MR_SHOW_OUTLINE - - Interp_subspace = 1; - Interp_subspace_offset_u = 1.0f - subspace_offset_u_inner; - Interp_subspace_offset_v = 0.0f; - - angs.b = -subspace_offset_v * PI2; + angs.b = -subspace_offset_v * PI2; - vm_angles_2_matrix(&tmp,&angs); + vm_angles_2_matrix(&tmp,&angs); - model_set_outline_color(255,255,255); + model_set_outline_color(255,255,255); - model_set_thrust( Subspace_model_inner, 1.0f, -1, Subspace_glow_bitmap, Noise[framenum] ); - render_flags |= MR_SHOW_THRUSTERS; + model_set_thrust( Subspace_model_inner, 1.0f, -1, Subspace_glow_bitmap, Noise[framenum] ); + render_flags |= MR_SHOW_THRUSTERS; - model_render( Subspace_model_inner, &tmp, &Eye_position, render_flags ); //MR_NO_CORRECT|MR_SHOW_OUTLINE - } + model_render( Subspace_model_inner, &tmp, &Eye_position, render_flags ); //MR_NO_CORRECT|MR_SHOW_OUTLINE Interp_subspace = 0; gr_zbuffer_set(saved_gr_zbuffering); @@ -1256,23 +1241,14 @@ void stars_draw( int show_stars, int show_suns, int show_nebulas, int show_subsp color = i & 7; } - if ( (Star_flags & STAR_FLAG_ANTIALIAS) || (D3D_enabled) ) { - gr_set_color_fast( &star_aacolors[color] ); + gr_set_color_fast( &star_aacolors[color] ); - // if the two points are the same, fudge it, since some D3D cards (G200 and G400) are lame. - if( (fl2i(p1.sx) == fl2i(p2.sx)) && (fl2i(p1.sy) == fl2i(p2.sy)) ){ - p1.sx += 1.0f; - } - gr_aaline(&p1,&p2); - } else { - // use alphablended line so that dark stars don't look bad on top of nebulas - gr_set_color_fast( &star_aacolors[color] ); - if ( Star_flags & STAR_FLAG_TAIL ) { - gr_line(fl2i(p1.sx),fl2i(p1.sy),fl2i(p2.sx),fl2i(p2.sy)); - } else { - gr_pixel( fl2i(p2.sx),fl2i(p2.sy) ); - } + // if the two points are the same, fudge it, since some D3D cards (G200 and G400) are lame. + if ( (fl2i(p1.sx) == fl2i(p2.sx)) && (fl2i(p1.sy) == fl2i(p2.sy)) ) { + p1.sx += 1.0f; } + + gr_aaline(&p1,&p2); } } diff --git a/src/stats/medals.cpp b/src/stats/medals.cpp index c7f8cf9..524d6a2 100644 --- a/src/stats/medals.cpp +++ b/src/stats/medals.cpp @@ -953,18 +953,6 @@ void medal_tbl_close() } } -/* -void init_medal_palette() -{ - Medal_palette = bm_load("MedalsPalette.pcx"); - if(Medal_palette > -1){ -#ifndef HARDWARE_ONLY - palette_use_bm_palette(Medal_palette); -#endif - } -} -*/ - // function to load in the medals for this player. It loads medals that the player has (known // by whether or not a non-zero number is present in the player's medal array), then loads the // rank bitmap diff --git a/src/ui/button.cpp b/src/ui/button.cpp index af5d093..b9b69d7 100644 --- a/src/ui/button.cpp +++ b/src/ui/button.cpp @@ -201,6 +201,7 @@ #include "timer.h" #include "gamesnd.h" #include "alphacolors.h" +#include "font.h" // --------------------------------------------------------------------------------------- // input: diff --git a/src/ui/checkbox.cpp b/src/ui/checkbox.cpp index b10c081..3539b99 100644 --- a/src/ui/checkbox.cpp +++ b/src/ui/checkbox.cpp @@ -75,6 +75,7 @@ #include "uidefs.h" #include "ui.h" #include "alphacolors.h" +#include "font.h" void UI_CHECKBOX::create(UI_WINDOW *wnd, const char *_text, int _x, int _y, int _state ) { diff --git a/src/ui/icon.cpp b/src/ui/icon.cpp index b4be923..20f2c14 100644 --- a/src/ui/icon.cpp +++ b/src/ui/icon.cpp @@ -62,6 +62,7 @@ #include "uidefs.h" #include "ui.h" #include "alphacolors.h" +#include "font.h" // --------------------------------------------------------------------------------------- // UI_ICON::create() diff --git a/src/ui/inputbox.cpp b/src/ui/inputbox.cpp index 11a8b14..d3d9c40 100644 --- a/src/ui/inputbox.cpp +++ b/src/ui/inputbox.cpp @@ -204,6 +204,7 @@ #include "bmpman.h" #include "timer.h" #include "alphacolors.h" +#include "font.h" #define INPUTBOX_PASSWD_CHAR '*' // the password protected char diff --git a/src/ui/listbox.cpp b/src/ui/listbox.cpp index 38a96f4..6bd75a3 100644 --- a/src/ui/listbox.cpp +++ b/src/ui/listbox.cpp @@ -114,6 +114,7 @@ #include "timer.h" #include "key.h" #include "alphacolors.h" +#include "font.h" #define KEY_BUFFER_TIMEOUT 1000 // time to clear buffer in milliseconds diff --git a/src/ui/radio.cpp b/src/ui/radio.cpp index e0c6530..973f229 100644 --- a/src/ui/radio.cpp +++ b/src/ui/radio.cpp @@ -74,6 +74,7 @@ #include "uidefs.h" #include "ui.h" #include "alphacolors.h" +#include "font.h" void UI_RADIO::create(UI_WINDOW *wnd, const char *_text, int _x, int _y, int _state, int _group ) { diff --git a/src/ui/scroll.cpp b/src/ui/scroll.cpp index e61011c..2d10ed9 100644 --- a/src/ui/scroll.cpp +++ b/src/ui/scroll.cpp @@ -92,6 +92,7 @@ #include "ui.h" #include "timer.h" #include "alphacolors.h" +#include "font.h" // -------------------------------------------------------------------- diff --git a/src/ui/window.cpp b/src/ui/window.cpp index 9b25f7a..07cb403 100644 --- a/src/ui/window.cpp +++ b/src/ui/window.cpp @@ -251,9 +251,6 @@ void UI_WINDOW::set_foreground_bmap(const char *fname) if (foreground_bmap_id < 0) { Error(LOCATION,"Could not load in %s!",fname); } -#ifndef HARDWARE_ONLY - palette_use_bm_palette(foreground_bmap_id); -#endif } diff --git a/src/weapon/trails.cpp b/src/weapon/trails.cpp index 46c5e3c..e9690f3 100644 --- a/src/weapon/trails.cpp +++ b/src/weapon/trails.cpp @@ -325,12 +325,7 @@ void trail_render( trail * trailp ) vlist[2]->u = 1.0f; vlist[2]->v = 0.5f; gr_set_bitmap(ti->bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, l/255.0f, -1, -1); - if ( D3D_enabled ) { - g3_draw_poly( 3, vlist, TMAP_FLAG_TEXTURED|TMAP_FLAG_ALPHA|TMAP_FLAG_GOURAUD ); - } else { - g3_draw_poly( 3, vlist, TMAP_FLAG_TEXTURED ); - } - + g3_draw_poly( 3, vlist, TMAP_FLAG_TEXTURED|TMAP_FLAG_ALPHA|TMAP_FLAG_GOURAUD ); } else { vertex *vlist[4]; @@ -345,11 +340,7 @@ void trail_render( trail * trailp ) vlist[3]->u = 0.0f; vlist[3]->v = 1.0f; gr_set_bitmap(ti->bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, l/255.0f, -1, -1); - if ( D3D_enabled ) { - g3_draw_poly( 4, vlist, TMAP_FLAG_TEXTURED|TMAP_FLAG_ALPHA|TMAP_FLAG_GOURAUD ); - } else { - g3_draw_poly( 4, vlist, TMAP_FLAG_TEXTURED ); - } + g3_draw_poly( 4, vlist, TMAP_FLAG_TEXTURED|TMAP_FLAG_ALPHA|TMAP_FLAG_GOURAUD ); } } last_pos = pos; -- 2.39.2