diff options
author | Matt Turner <mattst88@gmail.com> | 2008-05-14 16:26:15 +0000 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2008-05-14 16:26:15 +0000 |
commit | 15e2da75f4a8550b445a4ba8cb3d21c20beb007f (patch) | |
tree | 7e2708a75653b85e468523c08629f870f174b07e /glpong.c | |
parent | a8921d2baf7fe632839ec4c1a6f55db9c78f1c1c (diff) |
Make quesoglc work. Still need to sort out why GLC_TRIANGLE works but GLC_TEXTURE doesn't.
git-svn-id: svn://mattst88.com/svn/glpong/trunk@15 449aeecc-241a-0410-943f-e2f883e2d7a2
Diffstat (limited to 'glpong.c')
-rw-r--r-- | glpong.c | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -14,7 +14,7 @@ static int GLPong_Init(GLPong_t * GLPong); static void GLPong_Deinit(GLPong_t * GLPong); static int GLPong_HandleEvents(); - +static INLINE unsigned int NextPow2(unsigned int value); static GLuint SDL_GL_SurfaceToTexture(SDL_Surface * surface); static GLuint SDL_GL_NPOTSurfaceToTexture(SDL_Surface * surface, GLfloat * wratio, GLfloat * hratio); @@ -67,15 +67,16 @@ int main(int argc, char * argv[]) { GLPong_BallDrawAll(GLPong.balls); - SDL_GL_SwapBuffers(); - /* end drawing */ - frames++; - if (frames == 10) { - GLPong_FPSCount(); + if (frames == 30) { frames = 0; - GLPong_FPSPrint(); } + GLPong_TextDrawFPS(GLPong_FPSCount()); + + SDL_GL_SwapBuffers(); + /* end drawing */ + + SDL_Delay(10); } @@ -194,7 +195,7 @@ GLPong_HandleEvents() { static INLINE unsigned int NextPow2(unsigned int value) { -#if (defined __i386__ || defined __amd64__ || defined __x86_64__) \ +#if (defined __i386__ || defined __x86_64__) \ && (defined __GNUC__) unsigned int x; __asm( @@ -253,8 +254,8 @@ static GLuint SDL_GL_NPOTSurfaceToTexture(SDL_Surface * surface, GLfloat * wratio, GLfloat * hratio) { SDL_Surface * pow2 = NULL; - unsigned int w = NextPow2(surface->w); - unsigned int h = NextPow2(surface->h); + int w = NextPow2(surface->w); + int h = NextPow2(surface->h); if (wratio) { *wratio = (GLfloat)surface->w / (GLfloat)h; |