From ef74ae83db1d3049e4e890df77d25ac6e1f7719f Mon Sep 17 00:00:00 2001 From: drumsetmonkey Date: Thu, 15 Oct 2015 09:07:05 -0400 Subject: Added glew and shader loading --- src/entities.cpp | 8 ++++---- src/ui.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/entities.cpp b/src/entities.cpp index 0457ba1..f9bd015 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -109,10 +109,10 @@ void Entity::draw(void){ //draws the entities texState-=1; if(texState==0)up=true; } - }if(ground == 0){ - glBindTexture(GL_TEXTURE_2D, texture[1]); } - else if(vel.x != 0){ + if(ground == 0){ + glBindTexture(GL_TEXTURE_2D, texture[1]); + }else if(vel.x != 0){ switch(texState){ case 0: glBindTexture(GL_TEXTURE_2D,texture[1]); @@ -156,7 +156,7 @@ void Entity::draw(void){ //draws the entities ui::setFontSize(16); ui::putText(((SCREEN_WIDTH / 2 ) + loc.x) - 125, SCREEN_HEIGHT - ui::fontSize, "Health: %d/%d",health,maxHealth); glColor3ub(255,0,0); - glRectf((SCREEN_WIDTH / 2 + loc.x) - 125, SCREEN_HEIGHT - 32, ((SCREEN_WIDTH / 2 + loc.x) - 125) + (int)((int)(health / maxHealth) * 100), SCREEN_HEIGHT - 32 + 12); + glRectf((SCREEN_WIDTH / 2 + loc.x) - 125, SCREEN_HEIGHT - 32, ((SCREEN_WIDTH / 2 + loc.x) - 125) + (((float)health / (float)maxHealth) * 100), SCREEN_HEIGHT - 32 + 12); } if(near){ ui::setFontSize(14); diff --git a/src/ui.cpp b/src/ui.cpp index fe5414c..5c5df20 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -55,7 +55,7 @@ namespace ui { abort(); } // Load the bitmap with OpenGL - glActiveTexture(GL_TEXTURE0); + //glActiveTexture(GL_TEXTURE0); glGenTextures(1,&ftex); glBindTexture(GL_TEXTURE_2D,ftex); glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE); -- cgit v1.2.3