Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/gpu/gpu_py_offscreen.c
| Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
| #include "GPU_texture.h" | #include "GPU_texture.h" | ||||
| #include "../editors/include/ED_view3d.h" | #include "../editors/include/ED_view3d.h" | ||||
| #include "../mathutils/mathutils.h" | #include "../mathutils/mathutils.h" | ||||
| #include "../generic/py_capi_utils.h" | #include "../generic/py_capi_utils.h" | ||||
| #include "gpu_py.h" | |||||
| #include "gpu_py_offscreen.h" /* own include */ | #include "gpu_py_offscreen.h" /* own include */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name GPUOffScreen Common Utilities | /** \name GPUOffScreen Common Utilities | ||||
| * \{ */ | * \{ */ | ||||
| Show All 24 Lines | |||||
| static PyObject *bpygpu_offscreen_new(PyTypeObject *UNUSED(self), PyObject *args, PyObject *kwds) | static PyObject *bpygpu_offscreen_new(PyTypeObject *UNUSED(self), PyObject *args, PyObject *kwds) | ||||
| { | { | ||||
| GPUOffScreen *ofs; | GPUOffScreen *ofs; | ||||
| int width, height, samples = 0; | int width, height, samples = 0; | ||||
| char err_out[256]; | char err_out[256]; | ||||
| static const char *_keywords[] = {"width", "height", "samples", NULL}; | static const char *_keywords[] = {"width", "height", "samples", NULL}; | ||||
| static _PyArg_Parser _parser = {"ii|i:GPUOffScreen.__new__", _keywords, 0}; | static _PyArg_Parser _parser = {"ii|i:GPUOffScreen.__new__", _keywords, 0}; | ||||
| if (!_PyArg_ParseTupleAndKeywordsFast( | if (!bpygpu_is_initialized() || | ||||
| !_PyArg_ParseTupleAndKeywordsFast( | |||||
| args, kwds, &_parser, | args, kwds, &_parser, | ||||
| &width, &height, &samples)) | &width, &height, &samples)) | ||||
| { | { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| ofs = GPU_offscreen_create(width, height, samples, true, false, err_out); | ofs = GPU_offscreen_create(width, height, samples, true, false, err_out); | ||||
| ▲ Show 20 Lines • Show All 267 Lines • Show Last 20 Lines | |||||