From d0beabb642ea8acb8e3d69aa3fc503ad703e7dfd Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Fri, 12 Apr 2013 17:56:07 +0000 Subject: Add function to query maximum texture size. Also, make texture upload functions aware of this limit. --- source/blender/blenfont/CMakeLists.txt | 1 + source/blender/blenfont/intern/blf_glyph.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/blenfont') diff --git a/source/blender/blenfont/CMakeLists.txt b/source/blender/blenfont/CMakeLists.txt index 7bb80c34323..936dd708cfb 100644 --- a/source/blender/blenfont/CMakeLists.txt +++ b/source/blender/blenfont/CMakeLists.txt @@ -31,6 +31,7 @@ set(INC ../makesrna ../python ../imbuf + ../gpu ../../../intern/guardedalloc ../../../intern/locale ) diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index a6b04b24399..142acf755fc 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -55,6 +55,7 @@ #include "blf_internal_types.h" #include "blf_internal.h" +#include "GPU_extensions.h" GlyphCacheBLF *blf_glyph_cache_find(FontBLF *font, int size, int dpi) { @@ -381,7 +382,7 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y) GlyphCacheBLF *gc = font->glyph_cache; if (font->max_tex_size == -1) - glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint *)&font->max_tex_size); + font->max_tex_size = GPU_max_texture_size(); if (gc->cur_tex == -1) { blf_glyph_cache_texture(font, gc); -- cgit v1.2.3