home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / directx / misc / d3dmain.h < prev    next >
C/C++ Source or Header  |  1997-07-14  |  2KB  |  66 lines

  1. /*
  2.  *  Copyright (C) 1995, 1996 Microsoft Corporation. All Rights Reserved.
  3.  *
  4.  *  File: d3dmain.h
  5.  *
  6.  */
  7. #ifndef __D3DMAIN_H__
  8. #define __D3DMAIN_H__
  9.  
  10. #include <windows.h>
  11. #include <windowsx.h>
  12. #include <stdio.h>
  13. #include <string.h>
  14. #include <time.h>
  15. #include <search.h>
  16. #include <ddraw.h>
  17. #include <d3d.h>
  18. #include "d3dapp.h"        /* prototypes for D3D helper functions */
  19. #include "d3dres.h"        /* defines constants used in d3dmain.rc */
  20. #include "d3ddemo.h"        /* prototypes for functions to communicate with
  21.                    each sample */
  22. #define START_WIN_SIZE 320  /* initial size of the window */
  23.  
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27.  
  28. typedef struct tagd3dmainglobals {
  29.     HWND hWndMain;        /* application window handle */
  30.     HINSTANCE hInstApp;        /* application instance for dialog boxes */
  31.  
  32.     D3DAppRenderState rstate; /* struct describing the current render state */
  33.  
  34.     BOOL bSingleStepMode;     /* render one frame at a time */
  35.     BOOL bDrawAFrame;         /* render on this pass of the main loop */
  36.     BOOL bClearsOn;         /* clear the back and z-buffer each frame */
  37.     BOOL bShowFrameRate;     /* show the frame rate at the top */
  38.     BOOL bShowInfo;         /* show window information at the bottom */
  39.     BOOL bResizingDisabled;     /* do not allow resizing */
  40.  
  41.     BOOL bResized; /* the window has resized or some other drastic change, the
  42.                       entire client area should be cleared */
  43.     BOOL bQuit;       /* program is about to terminate */
  44.  
  45.     LPDIRECTDRAWSURFACE lpFrameRateBuffer; /* frame rate surface */
  46.     LPDIRECTDRAWSURFACE lpInfoBuffer;       /* window info surface */
  47. } d3dmainglobals;
  48.  
  49. void __cdecl Msg( LPSTR fmt, ... );
  50. /*
  51.  * STATS.CPP FUNCTION PROTOTYPES
  52.  */
  53. BOOL InitFontAndTextBuffers(void);
  54. void ReleaseFontAndTextBuffers(void);
  55. BOOL WriteInfoBuffer(void);
  56. BOOL WriteFrameRateBuffer(float fps, long tps);
  57. void ResetFrameRate(void);
  58. BOOL CalculateFrameRate(void);
  59. BOOL DisplayFrameRate(int* count, LPD3DRECT lpExtents );
  60.  
  61. #ifdef __cplusplus
  62. };
  63. #endif
  64.  
  65. #endif // __D3DMAIN_H__
  66.