MakeHuman
0.95beta
|
The main C application file. More...
Go to the source code of this file.
Defines | |
#define | MAX_PATH 1024 |
Functions | |
static void | initGlobals (void) |
Initialize Globals. | |
static PyObject * | mh_updatePickingBuffer (PyObject *self, PyObject *unused) |
static PyObject * | mh_getColorPicked (PyObject *self, PyObject *unused) |
Get the RGB value of the color that has been picked. | |
static PyObject * | mh_getMousePos (PyObject *self, PyObject *unused) |
Get the current mouse x, y cursor position on the screen, in pixels. This function retrieves the x and y mouse position in screen coordinates returning two integer values to the Python code. | |
static PyObject * | mh_getKeyModifiers (PyObject *self, PyObject *unused) |
Get an integer representing the current modifier key settings. | |
static PyObject * | mh_getWindowSize (PyObject *self, PyObject *unused) |
Get the current window (viewport) width and height in pixels. This function retrieves the current width and height of the drawable area within the MakeHuman window in pixels (the viewport size). | |
static PyObject * | mh_startWindow (PyObject *self, PyObject *args) |
Start the GUI window at application launch. | |
static PyObject * | mh_startEventLoop (PyObject *self, PyObject *unused) |
Start the event loop at application launch. | |
static PyObject * | mh_shutDown (PyObject *self, PyObject *unused) |
End the GUI application. | |
static PyObject * | mh_redraw (PyObject *self, PyObject *args) |
Redraws the scene in the GUI window. | |
static PyObject * | mh_setFullscreen (PyObject *self, PyObject *args) |
Sets the fullscreen state of the GUI window. | |
static PyObject * | mh_setClearColor (PyObject *self, PyObject *args) |
static PyObject * | mh_LoadTexture (PyObject *self, PyObject *args) |
Load texture of an object from file. | |
static PyObject * | mh_CreateVertexShader (PyObject *self, PyObject *args) |
static PyObject * | mh_CreateFragmentShader (PyObject *self, PyObject *args) |
static PyObject * | mh_CreateShader (PyObject *self, PyObject *args) |
static PyObject * | mh_GrabScreen (PyObject *self, PyObject *args) |
static PyObject * | mh_addTimer (PyObject *self, PyObject *args) |
Adds a timer which will call a callback after the specified number of milliseconds has elapsed. | |
static PyObject * | mh_removeTimer (PyObject *self, PyObject *args) |
static PyObject * | mh_callAsync (PyObject *self, PyObject *callback) |
static PyObject * | mh_SetResizeCallback (PyObject *self, PyObject *callback) |
static PyObject * | mh_SetMouseDownCallback (PyObject *self, PyObject *callback) |
static PyObject * | mh_SetMouseUpCallback (PyObject *self, PyObject *callback) |
static PyObject * | mh_SetMouseMovedCallback (PyObject *self, PyObject *callback) |
static PyObject * | mh_SetKeyDownCallback (PyObject *self, PyObject *callback) |
static PyObject * | mh_SetKeyUpCallback (PyObject *self, PyObject *callback) |
static PyObject * | mh_getPath (PyObject *self, PyObject *type) |
Gets program specific path locations. MakeHuman uses pathes to export objects and to (re)store exports and screen grabs. Since the various locations depend from the system (Linux, Windows, Mac OS) the program is running on theses pathes may be queried by this function. | |
int | main (int argc, char *argv[]) |
The main function initializes the MakeHuman application. | |
Variables | |
Global | G |
static PyMethodDef | EmbMethods [] |
Defines a set of functions as an array that can be passed into the Py_InitModule function. |
The main C application file.
Project Name: | MakeHuman |
Product Home Page: | http://www.makehuman.org/ |
SourceForge Home Page: | http://sourceforge.net/projects/makehuman/ |
Authors: | Manuel Bastioni, Paolo Colombo, Simone Re, Hans-Peter Dusel |
Copyright(c): | MakeHuman Team 2001-2011 |
Licensing: | GPL3 (see also http://makehuman.wiki.sourceforge.net/Licensing) |
Coding Standards: | See http://makehuman.wiki.sourceforge.net/DG_Coding_Standards |
This is the main C application file used to run the MakeHuman application. A large part of this file is dedicated to providing an integration layer between the C core application and the Python GUI control scripts.
Much of the core C application is used to implement OpenGL library functions that are used to control the 3D graphics environment. See http://makehuman.wiki.sourceforge.net/DG_Application_Overview for a description of how the integration between C and Python works.
Definition in file main.c.
#define MAX_PATH 1024 |
static void initGlobals | ( | void | ) | [static] |
int main | ( | int | argc, |
char * | argv[] | ||
) |
The main function initializes the MakeHuman application.
This function sets up the integration layer between Python and the C core application then runs the 'main' Python module to start up the MakeHuman application.
When the user quits the application, the SDL loop controlling user interaction with the MakeHuman GUI is terminated by the mhShutDown function from glmodule.c which issues a system exit. This function traps the exit condition and displays a goodbye message into the message window before releasing the memory used by the global variables and ending.
This function returns a '1'.
static PyObject* mh_addTimer | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* mh_callAsync | ( | PyObject * | self, |
PyObject * | callback | ||
) | [static] |
static PyObject* mh_CreateFragmentShader | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* mh_CreateShader | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* mh_CreateVertexShader | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* mh_getColorPicked | ( | PyObject * | self, |
PyObject * | unused | ||
) | [static] |
static PyObject* mh_getKeyModifiers | ( | PyObject * | self, |
PyObject * | unused | ||
) | [static] |
static PyObject* mh_getMousePos | ( | PyObject * | self, |
PyObject * | unused | ||
) | [static] |
static PyObject* mh_getPath | ( | PyObject * | self, |
PyObject * | type | ||
) | [static] |
Gets program specific path locations. MakeHuman uses pathes to export objects and to (re)store exports and screen grabs. Since the various locations depend from the system (Linux, Windows, Mac OS) the program is running on theses pathes may be queried by this function.
type | Determines which path actually has to be queried. Type has to be either 'exports', 'models' or 'grab'. NULL will be returnded if it does not fit these requirements. |
The symantics is as follow:
type | synopsis | Windows | Linux | Mac OS X |
---|---|---|---|---|
"exports" | Declares the path to where exported to. | "./exports/" | "./exports/" | From preferences (defaults to "${USER}/Documents/MakeHuman/exports/" ) |
"models" | Declares the path where the models are stored to. | "./models/" | "./models/" | From preferences (defaults to "${USER}/Documents/MakeHuman/models/" ) |
"grab" | Declares the target for screenshots. | "./" | "./" | From preferences (defaults to "${USER}/Desktop/" ) |
static PyObject* mh_getWindowSize | ( | PyObject * | self, |
PyObject * | unused | ||
) | [static] |
static PyObject* mh_GrabScreen | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* mh_LoadTexture | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* mh_redraw | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* mh_removeTimer | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* mh_setClearColor | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* mh_setFullscreen | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* mh_SetKeyDownCallback | ( | PyObject * | self, |
PyObject * | callback | ||
) | [static] |
static PyObject* mh_SetKeyUpCallback | ( | PyObject * | self, |
PyObject * | callback | ||
) | [static] |
static PyObject* mh_SetMouseDownCallback | ( | PyObject * | self, |
PyObject * | callback | ||
) | [static] |
static PyObject* mh_SetMouseMovedCallback | ( | PyObject * | self, |
PyObject * | callback | ||
) | [static] |
static PyObject* mh_SetMouseUpCallback | ( | PyObject * | self, |
PyObject * | callback | ||
) | [static] |
static PyObject* mh_SetResizeCallback | ( | PyObject * | self, |
PyObject * | callback | ||
) | [static] |
static PyObject* mh_shutDown | ( | PyObject * | self, |
PyObject * | unused | ||
) | [static] |
static PyObject* mh_startEventLoop | ( | PyObject * | self, |
PyObject * | unused | ||
) | [static] |
Start the event loop at application launch.
This function constitutes part of the application initiation processing. It passes through the instruction to launch the main event loop which will control the GUI environment until the termination of the application. It returns a null value.
static PyObject* mh_startWindow | ( | PyObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* mh_updatePickingBuffer | ( | PyObject * | self, |
PyObject * | unused | ||
) | [static] |
PyMethodDef EmbMethods[] [static] |
{ {"addTimer", mh_addTimer, METH_VARARGS, ""}, {"removeTimer", mh_removeTimer, METH_VARARGS, ""}, {"getWindowSize", mh_getWindowSize, METH_NOARGS, ""}, {"getMousePos", mh_getMousePos, METH_NOARGS, ""}, {"getKeyModifiers", mh_getKeyModifiers, METH_NOARGS, ""}, {"updatePickingBuffer", mh_updatePickingBuffer, METH_NOARGS, ""}, {"getColorPicked", mh_getColorPicked, METH_NOARGS, ""}, {"redraw", mh_redraw, METH_VARARGS, ""}, {"setFullscreen", mh_setFullscreen, METH_VARARGS, ""}, {"setClearColor", mh_setClearColor, METH_VARARGS, ""}, {"loadTexture", mh_LoadTexture, METH_VARARGS, ""}, {"createVertexShader", mh_CreateVertexShader, METH_VARARGS, ""}, {"createFragmentShader", mh_CreateFragmentShader, METH_VARARGS, ""}, {"createShader", mh_CreateShader, METH_VARARGS, ""}, {"grabScreen", mh_GrabScreen, METH_VARARGS, ""}, {"startWindow", mh_startWindow, METH_VARARGS, ""}, {"startEventLoop", mh_startEventLoop, METH_NOARGS, ""}, {"shutDown", mh_shutDown, METH_NOARGS, ""}, {"getPath", mh_getPath, METH_O, ""}, {"callAsync", mh_callAsync, METH_O, ""}, {"setResizeCallback", mh_SetResizeCallback, METH_O, ""}, {"setMouseDownCallback", mh_SetMouseDownCallback, METH_O, ""}, {"setMouseUpCallback", mh_SetMouseUpCallback, METH_O, ""}, {"setMouseMovedCallback", mh_SetMouseMovedCallback, METH_O, ""}, {"setKeyDownCallback", mh_SetKeyDownCallback, METH_O, ""}, {"setKeyUpCallback", mh_SetKeyUpCallback, METH_O, ""}, {NULL, NULL, 0, NULL} }
Defines a set of functions as an array that can be passed into the Py_InitModule function.
This array declaration is used to list a set of functions that can be called from Python. The array is passed into the Py_InitModule function when it is used to dynamically initialize the 'mh' moduleas.