Internals

Most methods in the GDX API have similar semantics:

  • Names are in CamelCase, e.g. gdxMethodName.
  • A list is returned; the first element is a return code.

GDX hides these details, allowing for simpler code. Methods can be accessed using call(). For instance, the following code calls the API method gdxFileVersion:

>>> g = GDX()
>>> g.call('FileVersion')

Alternately, methods can be accessed as members of GDX objects, where the CamelCase API names are replaced by lowercase, with underscores separating words:

>>> g.file_version()  # same as above

See GDX.__valid for the list of supported methods.

class gdx.api.GDX

Wrapper around the GDX API.

__valid = None

Methods that conform to the semantics of call().

call(method, *args)

Invoke the GDX API method named gdxMethod.

Optional positional arguments args are passed to the API method. Returns the result of the method call, with the return code stripped. Refer to the GDX API documentation for the type and number of arguments and return values for any method.

If the call fails, raise an appropriate exception.

gdx.api.type_str = {<class 'GMS_DT_SET'>: 'set', <class 'GMS_DT_PAR'>: 'parameter', <class 'GMS_DT_VAR'>: 'variable', <class 'GMS_DT_EQU'>: 'equation', <class 'GMS_DT_ALIAS'>: 'alias'}

String representations of API constants for G(a)MS D(ata) T(ypes)

gdx.api.vartype_str = {<class 'GMS_VARTYPE_UNKNOWN'>: 'unknown', <class 'GMS_VARTYPE_BINARY'>: 'binary', <class 'GMS_VARTYPE_INTEGER'>: 'integer', <class 'GMS_VARTYPE_POSITIVE'>: 'positive', <class 'GMS_VARTYPE_NEGATIVE'>: 'negative', <class 'GMS_VARTYPE_FREE'>: 'free', <class 'GMS_VARTYPE_SOS1'>: 'sos1', <class 'GMS_VARTYPE_SOS2'>: 'sos2', <class 'GMS_VARTYPE_SEMICONT'>: 'semicont', <class 'GMS_VARTYPE_SEMIINT'>: 'semiint', <class 'GMS_VARTYPE_MAX'>: 'max'}

String representations of API constants for G(a)MS VAR(iable) TYPE(s)