From: <hug...@li...> - 2011-01-29 07:45:56
|
branch: details: http://hugin.hg.sourceforge.net/hgweb/hugin/hugin/hgrepo/h/hu/hugin/hugin/rev/43ddb3f2f469 changeset: 4903:43ddb3f2f469 user: tmodes date: Sat Jan 29 08:40:00 2011 +0100 description: Limit size of grid texture to maximal supported texture size diffstat: src/hugin1/hugin/ProjectionGridTool.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diffs (18 lines): diff -r 82669f1d226c -r 43ddb3f2f469 src/hugin1/hugin/ProjectionGridTool.cpp --- a/src/hugin1/hugin/ProjectionGridTool.cpp Fri Jan 28 20:46:30 2011 +0100 +++ b/src/hugin1/hugin/ProjectionGridTool.cpp Sat Jan 29 08:40:00 2011 +0100 @@ -290,10 +290,12 @@ glBindTexture(GL_TEXTURE_2D, texture_num); + GLint texSize; + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &texSize); int width_p = 12; int height_p = 11; - int width = 1 << width_p; - int height = 1 << height_p; + int width = std::min(1 << width_p,texSize); + int height = std::min(1 << height_p, texSize >> 1); int hor_lines = 20; int ver_lines = 40; |