Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/gpu/gpu_py_matrix.c
| Context not available. | |||||
| #include <Python.h> | #include <Python.h> | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "CLG_log.h" | |||||
| #include "../mathutils/mathutils.h" | #include "../mathutils/mathutils.h" | ||||
| #include "../generic/py_capi_utils.h" | #include "../generic/py_capi_utils.h" | ||||
| Context not available. | |||||
| #include "gpu_py_matrix.h" /* own include */ | #include "gpu_py_matrix.h" /* own include */ | ||||
| static CLG_LogRef LOG = { "bpygpu.matrix" }; | |||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Helper Functions | /** \name Helper Functions | ||||
| * \{ */ | * \{ */ | ||||
| Context not available. | |||||
| { | { | ||||
| /* sanity - should never happen */ | /* sanity - should never happen */ | ||||
| if (self->level == -1) { | if (self->level == -1) { | ||||
| fprintf(stderr, "Not yet in use\n"); | CLOG_ERROR(&LOG, "Not yet in use"); | ||||
| goto finally; | goto finally; | ||||
| } | } | ||||
| if (self->type == PYGPU_MATRIX_TYPE_MODEL_VIEW) { | if (self->type == PYGPU_MATRIX_TYPE_MODEL_VIEW) { | ||||
| const int level = GPU_matrix_stack_level_get_model_view(); | const int level = GPU_matrix_stack_level_get_model_view(); | ||||
| if (level != self->level) { | if (level != self->level) { | ||||
| fprintf(stderr, "Level push/pop mismatch, expected %d, got %d\n", self->level, level); | CLOG_ERROR(&LOG, "Level push/pop mismatch, expected %d, got %d", self->level, level); | ||||
| } | } | ||||
| if (level != 0) { | if (level != 0) { | ||||
| GPU_matrix_pop(); | GPU_matrix_pop(); | ||||
| Context not available. | |||||
| else if (self->type == PYGPU_MATRIX_TYPE_PROJECTION) { | else if (self->type == PYGPU_MATRIX_TYPE_PROJECTION) { | ||||
| const int level = GPU_matrix_stack_level_get_projection(); | const int level = GPU_matrix_stack_level_get_projection(); | ||||
| if (level != self->level) { | if (level != self->level) { | ||||
| fprintf(stderr, "Level push/pop mismatch, expected %d, got %d", self->level, level); | CLOG_ERROR(&LOG, "Level push/pop mismatch, expected %d, got %d", self->level, level); | ||||
| } | } | ||||
| if (level != 0) { | if (level != 0) { | ||||
| GPU_matrix_pop_projection(); | GPU_matrix_pop_projection(); | ||||
| Context not available. | |||||