hgeCreate function

Creates the HGE object if needed and returns a pointer to the HGE interface.

HGE *hgeCreate(
  int ver
);

Parameters

ver
HGE API version number. Just pass the HGE_VERSION constant here.

Return value

If the loaded HGE.DLL contains compatible API, hgeCreate returns a pointer to the HGE interface. Otherwise it returns 0.

Remarks

hgeCreate is a global C function. It is located outside of any classes and is imported from the HGE DLL.

To access HGE functions you need the HGE interface pointer that is returned by hgeCreate function. hgeCreate creates a HGE object if needed and increases the internal reference counter. To free obtained interface you must call the Release function.

You may call hgeCreate every time you need access to HGE, then call Release. Or you may get the interface just once during startup and store it in a global variable, then release during cleanup. Although the latter is supposed to be 'bad style', this works fine with not very big projects.

Requirements

Header: hge.h
Import library: hge.lib

See also

Release