45 lines
1.4 KiB
C++
45 lines
1.4 KiB
C++
// ************************************************************************************************
|
|
//
|
|
// Soporte para video Direct X.
|
|
//
|
|
// ************************************** (c) Pedro Díez López ************************************
|
|
|
|
#ifndef __DIRECTX_SUPPORT__
|
|
#define __DIRECTX_SUPPORT__
|
|
|
|
#include <ddraw.h>
|
|
|
|
class CDXVideo
|
|
{
|
|
public:
|
|
int hres; // Resolucion horizontal.
|
|
int vres; // Resolucion vertical
|
|
int bpp; // bpp de la resolucion.
|
|
int DimBuffer; // Dimension del buffer.
|
|
int ElmBuffer; // Elementos del buffer.
|
|
union Buffer // Distintos tipos de resolucion.
|
|
{
|
|
void *bpp;
|
|
BYTE *bpp8;
|
|
WORD *bpp16;
|
|
DWORD *bpp32;
|
|
}pBuffer;
|
|
HCURSOR mDDCursorShape;
|
|
|
|
private:
|
|
LPDIRECTDRAW lpDD; // Puntero a Direct Draw.
|
|
LPDIRECTDRAWSURFACE lpDDSView; // Puntero a la superficie.
|
|
LPDIRECTDRAWSURFACE lpDDSBack; // Puntero a la 2º superficie.
|
|
void *lpDXBuffer;// Puntero al LFB.
|
|
DDSURFACEDESC ddsd; // Descriptor de Superficie.
|
|
DDSCAPS ddscaps; // Descriptor de capabilities.
|
|
HRESULT ddrval; // Resultado de la llamada DD.
|
|
|
|
|
|
public:
|
|
BOOL Inicio(HWND hwnd,int Ancho,int Alto,int BPP);
|
|
void Cursor(HCURSOR nCursor);
|
|
void Pinta ();
|
|
void Fin();
|
|
};
|
|
#endif |