dungeon_crawler
diff prototype/drawtext/drawgl.c @ 29:2fc004802739
lalala
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 26 Aug 2012 03:39:32 +0300 |
parents | e122ba214ee1 |
children |
line diff
1.1 --- a/prototype/drawtext/drawgl.c Sat Aug 25 20:20:56 2012 +0300 1.2 +++ b/prototype/drawtext/drawgl.c Sun Aug 26 03:39:32 2012 +0300 1.3 @@ -1,6 +1,6 @@ 1.4 /* 1.5 libdrawtext - a simple library for fast text rendering in OpenGL 1.6 -Copyright (C) 2011 John Tsiombikas <nuclear@member.fsf.org> 1.7 +Copyright (C) 2011-2012 John Tsiombikas <nuclear@member.fsf.org> 1.8 1.9 This program is free software: you can redistribute it and/or modify 1.10 it under the terms of the GNU Lesser General Public License as published by 1.11 @@ -183,10 +183,17 @@ 1.12 1.13 void dtx_flush(void) 1.14 { 1.15 + int vbo; 1.16 + 1.17 if(!num_quads) { 1.18 return; 1.19 } 1.20 1.21 + if(glBindBuffer) { 1.22 + glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &vbo); 1.23 + glBindBuffer(GL_ARRAY_BUFFER, 0); 1.24 + } 1.25 + 1.26 #ifndef GL_ES 1.27 glPushAttrib(GL_ENABLE_BIT); 1.28 glEnable(GL_TEXTURE_2D); 1.29 @@ -242,6 +249,10 @@ 1.30 glDisable(GL_BLEND); 1.31 #endif 1.32 1.33 + if(glBindBuffer && vbo) { 1.34 + glBindBuffer(GL_ARRAY_BUFFER, vbo); 1.35 + } 1.36 + 1.37 num_quads = 0; 1.38 } 1.39