
// 10:40 2003/06/22
// 3:57 2003/06/24

#ifndef _DMGHLIF_H_
#define _DMGHLIF_H_

#include <gl/gl.h>

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

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

typedef void *HDMGHLF;

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

    int widthImage;         // width of image dimension
    int heightImage;        // height of image dimension
    int stride;             // bytes per scanline

}   DMGHLIMGF, *PDMGHLIMGF;

DMGHLDECLARE HDMGHLF DMGHLAPI dmghl_open_graphics_dat( // ==NULL(open error), !=NULL(success)
    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( // ==0(error), !=0(success)
    HDMGHLF hFile           // handle
);
DMGHLDECLARE int DMGHLAPI dmghl_get_image( // ==0(error), !=0(success)
    HDMGHLF hFile,          // handle
    int iBinIdx,            // 0 based binary number
    PDMGHLIMGF pImpf        // pointer to DMGHLIMGF structure of yours
);
DMGHLDECLARE int DMGHLAPI dmghl_release_image( // ==0(error), !=0(success)
    PDMGHLIMGF pImgf        // pointer to DMGHLIMGF structure of yours
);

#endif // #define _DMGHLIF_H_
