Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-09-08 05:12:12 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-08 05:15:50 +0300
commit48690d967a7731367cda01ab8dca64e7f4c3f6b5 (patch)
tree9295cc0ef083fd50eaab2c62785d54545eb004c6 /source/blender/gpu/opengl/gl_texture.cc
parentd2e9de93b8d1d6cd45abce8164d0f92af8f636d0 (diff)
GPUContext: Move GPUContext to gpu::Context for more consistency
This makes the GPUContext follow the same naming convention as the rest of the module. Also add a static getter for extra bonus style (no need for casts): - Context::get() - GLContext::get()
Diffstat (limited to 'source/blender/gpu/opengl/gl_texture.cc')
-rw-r--r--source/blender/gpu/opengl/gl_texture.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/gpu/opengl/gl_texture.cc b/source/blender/gpu/opengl/gl_texture.cc
index b4a8e43c931..ae3923b960f 100644
--- a/source/blender/gpu/opengl/gl_texture.cc
+++ b/source/blender/gpu/opengl/gl_texture.cc
@@ -44,7 +44,7 @@ namespace blender::gpu {
GLTexture::GLTexture(const char *name) : Texture(name)
{
- BLI_assert(GPU_context_active_get() != NULL);
+ BLI_assert(GLContext::get() != NULL);
glGenTextures(1, &tex_id_);
}
@@ -54,7 +54,7 @@ GLTexture::~GLTexture()
if (framebuffer_) {
GPU_framebuffer_free(framebuffer_);
}
- GPUContext *ctx = GPU_context_active_get();
+ GLContext *ctx = GLContext::get();
if (ctx != NULL && is_bound_) {
/* This avoid errors when the texture is still inside the bound texture array. */
ctx->state_manager->texture_unbind(this);
@@ -662,7 +662,7 @@ void GLTexture::check_feedback_loop(void)
if (GPU_mip_render_workaround()) {
return;
}
- GLFrameBuffer *fb = static_cast<GLFrameBuffer *>(GPU_context_active_get()->active_fb);
+ GLFrameBuffer *fb = static_cast<GLFrameBuffer *>(GLContext::get()->active_fb);
for (int i = 0; i < ARRAY_SIZE(fb_); i++) {
if (fb_[i] == fb) {
GPUAttachmentType type = fb_attachment_[i];