diff options
Diffstat (limited to 'source/blender/gpu/intern/gpu_matrix.cc')
-rw-r--r-- | source/blender/gpu/intern/gpu_matrix.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/gpu/intern/gpu_matrix.cc b/source/blender/gpu/intern/gpu_matrix.cc index cdb6d303588..0274966d4b9 100644 --- a/source/blender/gpu/intern/gpu_matrix.cc +++ b/source/blender/gpu/intern/gpu_matrix.cc @@ -35,6 +35,8 @@ #include "MEM_guardedalloc.h" +using namespace blender::gpu; + #define MATRIX_STACK_DEPTH 32 typedef float Mat4[4][4]; @@ -59,10 +61,10 @@ typedef struct GPUMatrixState { */ } GPUMatrixState; -#define ModelViewStack gpu_context_active_matrix_state_get()->model_view_stack +#define ModelViewStack Context::get()->matrix_state->model_view_stack #define ModelView ModelViewStack.stack[ModelViewStack.top] -#define ProjectionStack gpu_context_active_matrix_state_get()->projection_stack +#define ProjectionStack Context::get()->matrix_state->projection_stack #define Projection ProjectionStack.stack[ProjectionStack.top] GPUMatrixState *GPU_matrix_state_create(void) @@ -93,13 +95,13 @@ void GPU_matrix_state_discard(GPUMatrixState *state) static void gpu_matrix_state_active_set_dirty(bool value) { - GPUMatrixState *state = gpu_context_active_matrix_state_get(); + GPUMatrixState *state = Context::get()->matrix_state; state->dirty = value; } void GPU_matrix_reset(void) { - GPUMatrixState *state = gpu_context_active_matrix_state_get(); + GPUMatrixState *state = Context::get()->matrix_state; state->model_view_stack.top = 0; state->projection_stack.top = 0; unit_m4(ModelView); @@ -686,7 +688,7 @@ void GPU_matrix_bind(GPUShader *shader) bool GPU_matrix_dirty_get(void) { - GPUMatrixState *state = gpu_context_active_matrix_state_get(); + GPUMatrixState *state = Context::get()->matrix_state; return state->dirty; } @@ -699,13 +701,13 @@ BLI_STATIC_ASSERT(GPU_PY_MATRIX_STACK_LEN + 1 == MATRIX_STACK_DEPTH, "define mis int GPU_matrix_stack_level_get_model_view(void) { - GPUMatrixState *state = gpu_context_active_matrix_state_get(); + GPUMatrixState *state = Context::get()->matrix_state; return (int)state->model_view_stack.top; } int GPU_matrix_stack_level_get_projection(void) { - GPUMatrixState *state = gpu_context_active_matrix_state_get(); + GPUMatrixState *state = Context::get()->matrix_state; return (int)state->projection_stack.top; } |