libdrawtext

changeset 12:55c034e70809

make sure to unbind any vbo's before trying to render
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 25 Aug 2012 17:50:17 +0300
parents 805936da8d6b
children 365eba4dccec
files Makefile.in src/drawgl.c src/drawtext.h src/drawtext_impl.h
diffstat 4 files changed, 17 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/Makefile.in	Wed Oct 05 02:27:08 2011 +0300
     1.2 +++ b/Makefile.in	Sat Aug 25 17:50:17 2012 +0300
     1.3 @@ -55,9 +55,9 @@
     1.4  	cp $(lib_a) $(PREFIX)/lib/$(lib_a)
     1.5  	cp $(lib_so) $(PREFIX)/lib/$(lib_so)
     1.6  	cp src/drawtext.h $(PREFIX)/include/drawtext.h
     1.7 -	[ -n "$(linkname)" ] && rm -f $(PREFIX)/lib/$(linkname) \
     1.8 -		&& cd $(PREFIX)/lib && ln -s $(lib_so) $(linkname) \
     1.9 -		&& ln -s $(lib_so) $(soname) || true
    1.10 +	[ -n "$(linkname)" ] && \
    1.11 +		rm -f $(PREFIX)/lib/$(linkname) $(PREFIX)/lib/$(soname) && \
    1.12 +		cd $(PREFIX)/lib && ln -s $(lib_so) $(linkname) && ln -s $(lib_so) $(soname) || true
    1.13  
    1.14  
    1.15  .PHONY: uninstall
     2.1 --- a/src/drawgl.c	Wed Oct 05 02:27:08 2011 +0300
     2.2 +++ b/src/drawgl.c	Sat Aug 25 17:50:17 2012 +0300
     2.3 @@ -1,6 +1,6 @@
     2.4  /*
     2.5  libdrawtext - a simple library for fast text rendering in OpenGL
     2.6 -Copyright (C) 2011  John Tsiombikas <nuclear@member.fsf.org>
     2.7 +Copyright (C) 2011-2012  John Tsiombikas <nuclear@member.fsf.org>
     2.8  
     2.9  This program is free software: you can redistribute it and/or modify
    2.10  it under the terms of the GNU Lesser General Public License as published by
    2.11 @@ -183,10 +183,17 @@
    2.12  
    2.13  void dtx_flush(void)
    2.14  {
    2.15 +	int vbo;
    2.16 +
    2.17  	if(!num_quads) {
    2.18  		return;
    2.19  	}
    2.20  
    2.21 +	if(glBindBuffer) {
    2.22 +		glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &vbo);
    2.23 +		glBindBuffer(GL_ARRAY_BUFFER, 0);
    2.24 +	}
    2.25 +
    2.26  #ifndef GL_ES
    2.27  	glPushAttrib(GL_ENABLE_BIT);
    2.28  	glEnable(GL_TEXTURE_2D);
    2.29 @@ -242,6 +249,10 @@
    2.30  	glDisable(GL_BLEND);
    2.31  #endif
    2.32  
    2.33 +	if(glBindBuffer && vbo) {
    2.34 +		glBindBuffer(GL_ARRAY_BUFFER, vbo);
    2.35 +	}
    2.36 +
    2.37  	num_quads = 0;
    2.38  }
    2.39  
     3.1 --- a/src/drawtext.h	Wed Oct 05 02:27:08 2011 +0300
     3.2 +++ b/src/drawtext.h	Sat Aug 25 17:50:17 2012 +0300
     3.3 @@ -1,6 +1,6 @@
     3.4  /*
     3.5  libdrawtext - a simple library for fast text rendering in OpenGL
     3.6 -Copyright (C) 2011  John Tsiombikas <nuclear@member.fsf.org>
     3.7 +Copyright (C) 2011-2012  John Tsiombikas <nuclear@member.fsf.org>
     3.8  
     3.9  This program is free software: you can redistribute it and/or modify
    3.10  it under the terms of the GNU Lesser General Public License as published by
     4.1 --- a/src/drawtext_impl.h	Wed Oct 05 02:27:08 2011 +0300
     4.2 +++ b/src/drawtext_impl.h	Sat Aug 25 17:50:17 2012 +0300
     4.3 @@ -1,6 +1,6 @@
     4.4  /*
     4.5  libdrawtext - a simple library for fast text rendering in OpenGL
     4.6 -Copyright (C) 2011  John Tsiombikas <nuclear@member.fsf.org>
     4.7 +Copyright (C) 2011-2012  John Tsiombikas <nuclear@member.fsf.org>
     4.8  
     4.9  This program is free software: you can redistribute it and/or modify
    4.10  it under the terms of the GNU Lesser General Public License as published by