home *** CD-ROM | disk | FTP | other *** search
/ WarCraft 2000 - Nuclear Epidemic / W2000.nrg / SOURCE.War2000 / Ddini.h < prev    next >
C/C++ Source or Header  |  1998-03-02  |  2KB  |  72 lines

  1. /***********************************************************************
  2.  *Direct Draw initialisation module                    
  3.  *
  4.  * This module creates the Direct Draw object with the primary surface
  5.  * and a backbuffer and sets 800x600x8 display mode.
  6.  *
  7.  ***********************************************************************/
  8. #ifndef __DDINI_H_
  9. #define __DDINI_H_
  10. #include "afx.h"
  11. //#include <windows.h>
  12. //#include <windowsx.h>
  13. #include <ddraw.h>
  14. #include <stdlib.h>
  15. #include <stdarg.h>
  16. #include "resource.h"
  17. #include "lines.h"
  18. #ifndef __ddini_cpp_
  19. extern LPDIRECTDRAW            lpDD;           // DirectDraw object
  20. extern LPDIRECTDRAWSURFACE     lpDDSPrimary;   // DirectDraw primary surface
  21. extern LPDIRECTDRAWSURFACE     lpDDSBack;      // DirectDraw back surface
  22. extern BOOL                    bActive;        // is application active?
  23. extern BOOL                    CurrentSurface; //=FALSE if backbuffer
  24.                                                // is active (Primary surface is visible)
  25.                                                //=TRUE if  primary surface is active
  26.                                                // (but backbuffer is visible)
  27. extern BOOL                    DDError;        //=FALSE if Direct Draw works normally 
  28. extern DDSURFACEDESC   ddsd;
  29. extern HWND hwnd;
  30. extern BOOL DDDebug;
  31. /*  Create Direct Draw object
  32.  * 
  33.  * This procedure creadtes Direct Draw object with primary surface and 
  34.  * one backbuffer and sets 800x600x8 display mode.
  35.  * This procedure enables usage of all other procedure in thes module.
  36.  */
  37. BOOL CreateDDObjects(HWND hwnd);
  38. /*     Closing all Direct Draw objects
  39.  *
  40.  * This procedure must be called before the program terminates,
  41.  * otherwise Windows can occur some problems.
  42.  */
  43. void FreeDDObjects( void );
  44. /*
  45.  * Flipping Pages
  46.  */
  47. void FlipPages(void);
  48. /*
  49.  * Getting Screen Pointer
  50.  *
  51.  * You will ge the pointer to the invisible area of the screen
  52.  * i.e, if primary surface is visible, then you will obtain the
  53.  * pointer to the backbuffer.
  54.  * You must call UnlockSurface() to allow Windows draw on the screen
  55.  */
  56. void LockSurface(void);
  57. /*
  58.  *  Unlocking the surface 
  59.  *
  60.  *  You must unlock the Video memory for Windows to work properly
  61.  */
  62. void UnlockSurface(void);
  63. /*
  64.  * Getting then DC of the active (invisible) area of the screen
  65.  */
  66. HDC GetSDC(void);
  67. //Sttting the palette
  68. void LoadPalette(LPCSTR lpFileName);
  69. void SetDebugMode();
  70. void NoDebugMode();
  71. #endif
  72. #endif //__DDINI_H_