Committing patch "[#27676] Change window size/resolution in realtime" by me.

Description:
This patch allows the user to change the size of the window (or the resolution in fullscreen mode) using the new bge.render.setWindowSize() method. This only works in the Blenderplayer since it doesn't make a whole lot of sense for the embedded player.
This commit is contained in:
2012-01-22 20:25:25 +00:00
parent 359e961a12
commit 686ce92fe8
11 changed files with 88 additions and 1 deletions

View File

@@ -1288,6 +1288,16 @@ static PyObject* gPyDrawLine(PyObject*, PyObject* args)
Py_RETURN_NONE;
}
static PyObject* gPySetWindowSize(PyObject*, PyObject* args)
{
int width, height;
if (!PyArg_ParseTuple(args, "ii:resize", &width, &height))
return NULL;
gp_Canvas->ResizeWindow(width, height);
Py_RETURN_NONE;
}
static struct PyMethodDef rasterizer_methods[] = {
{"getWindowWidth",(PyCFunction) gPyGetWindowWidth,
METH_VARARGS, "getWindowWidth doc"},
@@ -1329,6 +1339,7 @@ static struct PyMethodDef rasterizer_methods[] = {
METH_VARARGS, "get the anisotropic filtering level"},
{"drawLine", (PyCFunction) gPyDrawLine,
METH_VARARGS, "draw a line on the screen"},
{"setWindowSize", (PyCFunction) gPySetWindowSize, METH_VARARGS, ""},
{ NULL, (PyCFunction) NULL, 0, NULL }
};