
#ifndef _DMGHL_H_
#define _DMGHL_H_

#include <gl/gl.h>

#define DMGHLDECLARE	extern "C" __declspec(dllexport)
#define DMGHLAPI		__cdecl

#define DMDFT_DMCSB1 (1U)
#define DMDFT_DMCSB2 (2U)
#define DMDFT_DM2_CLASSIC (3U) // for DM2 Amiga, ...
#define DMDFT_DM2_EVOLVED (4U) // for DM2 PC, ...

typedef void *HDMGHLF;

typedef struct tagDMGHLIMGF
{	GLint internalformat;
	GLsizei width;
	GLsizei height;
	GLenum format;
	GLenum type;
	GLvoid *pixels;

	int widthImage;
	int heightImage;
	int stride;

}	DMGHLIMGF, *PDMGHLIMGF;

DMGHLDECLARE HDMGHLF DMGHLAPI dmghl_open_graphics_dat(
    const char *pszFileIn,  // file path to open
    int nDMDFT,             // DMDFT_DMCSB1
    int nIsLittleEndian     // 0=BIG ENDIAN, 1=LITTLE ENDIAN
);
DMGHLDECLARE int DMGHLAPI dmghl_close_graphics_dat(
    HDMGHLF hFile           // handle
);
DMGHLDECLARE int DMGHLAPI dmghl_get_image(
    HDMGHLF hFile,          // handle
    int iBinIdx,            // 0 based binary number
    PDMGHLIMGF pImpf        // pointer to DMGHLIMGF structure of yours
);
DMGHLDECLARE int DMGHLAPI dmghl_release_image(
    PDMGHLIMGF pImgf        // pointer to DMGHLIMGF structure of yours
);

#endif // #define _DMGHL_H_
