bool game::load_files() { drawengine de; //Load the dot image background_setter(de.load_image( "background.png" )); //If there was a problem in loading the dot if( background_getter() == NULL ) { return false; } //If everything loaded fine return true; }
static int tp_init (SELF self, PyObject* args, PyObject* kwds) { PyObject* title = NULL; PyObject* background = NULL; PyObject* resizable = NULL; static char* kw[] = {"title", "background", "resizable", NULL}; // Parse arguments if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO", kw, &title, &background, &resizable)) return -1; // Set title property if provided if (title && title_setter(self, title, NULL) == -1) return -1; // Set background property if provided if (background && background_setter(self, background, NULL) == -1) return -1; return 0; }