From: slack Date: Sun, 30 Aug 2009 00:18:22 +0000 (+0200) Subject: Funciones en dl_init. main() ligeramente optimizado X-Git-Url: http://slack.codemaniacs.com/git/?a=commitdiff_plain;h=f8f27c7681b4c02cd182e361a81f6e8b774864d5;p=fov120.git Funciones en dl_init. main() ligeramente optimizado --- diff --git a/dl_init.c b/dl_init.c index 79ddf34..d48cbd5 100644 --- a/dl_init.c +++ b/dl_init.c @@ -10,17 +10,14 @@ char *names="libSDL-1.2.so.0\0SDL_Init\0SDL_Quit\0SDL_OpenAudio\0" "libm.so\0powf\0fmodf\0"//expf\0" - "libc.so.6\0rand\0srand\0time\0" + "libc.so.6\0rand\0srand\0" - "libGL.so\0glBegin\0glEnd\0glColor4f\0glVertex3fv\0glRotatef\0" - "glEnable\0glMatrixMode\0glLoadIdentity\0glClear\0" - "glBlendFunc\0glTranslatef\0glPushMatrix\0glPopMatrix\0glRectf\0" - "glClearColor\0glXUseXFont\0glRasterPos2f\0glCallLists\0" + "libGL.so\0glRotatef\0" + "glBindTexture\0glCopyTexSubImage2D\0glInterleavedArrays\0" + "glEnable\0glDisable\0glMatrixMode\0glLoadIdentity\0glClear\0" + "glRecti\0glClearColor\0" "libGLU.so\0gluPerspective\0gluLookAt\0" - - "libX11.so\0XOpenDisplay\0XLoadQueryFont\0" - "\0"; diff --git a/dl_init.h b/dl_init.h index d407485..c461fd8 100644 --- a/dl_init.h +++ b/dl_init.h @@ -29,36 +29,29 @@ typedef struct // libc int (*rand)(void); void (*srand)(unsigned int); - time_t (*time)(time_t*); // libGL - void (*glBegin)(GLenum); - void (*glEnd)(void); - void (*glColor4f)(GLfloat, GLfloat, GLfloat, GLfloat); - //void (*glVertex3f)(GLfloat, GLfloat, GLfloat); - void (*glVertex3fv)(const GLfloat*); void (*glRotatef)(GLfloat, GLfloat, GLfloat, GLfloat); + void (*glBindTexture)(GLenum, GLuint); + void (*glCopyTexSubImage2D)(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); + void (*glInterleavedArrays)(GLenum, GLsizei, const GLvoid*); void (*glEnable)(GLenum); - //void (*glDisable)(GLenum); + void (*glDisable)(GLenum); void (*glMatrixMode)(GLenum); void (*glLoadIdentity)(void); void (*glClear)(GLbitfield); //void (*glScalef)(GLfloat, GLfloat, GLfloat); - void (*glBlendFunc)(GLenum, GLenum); - void (*glTranslatef)(GLfloat, GLfloat, GLfloat); - //void (*glNormal3f)(GLfloat, GLfloat, GLfloat); - //void (*glTexGeni)(GLenum, GLenum, GLint); - //void (*glGetFloatv)(GLenum, GLfloat *); - void (*glPushMatrix)(void); - void (*glPopMatrix)(void); + //void (*glBlendFunc)(GLenum, GLenum); + //void (*glTranslatef)(GLfloat, GLfloat, GLfloat); + //void (*glPushMatrix)(void); + //void (*glPopMatrix)(void); //void (*glTexCoord2f)(GLfloat, GLfloat); - //void (*glBindTexture)(GLenum, GLuint); - //void (*glGenTextures)(GLsizei, GLuint *); - void (*glRectf)(GLfloat, GLfloat, GLfloat, GLfloat); + void (*glBindTexture)(GLenum, GLuint); + void (*glRecti)(GLint, GLint, GLint, GLint); void (*glClearColor)(GLfloat, GLfloat, GLfloat, GLfloat); - void (*glXUseXFont)(Font, int, int, int); - void (*glRasterPos2f)(GLfloat, GLfloat); - void (*glCallLists)(GLsizei, GLenum, const GLvoid *); + //void (*glXUseXFont)(Font, int, int, int); + //void (*glRasterPos2f)(GLfloat, GLfloat); + //void (*glCallLists)(GLsizei, GLenum, const GLvoid *); // libGLU void (*gluPerspective)(GLdouble, GLdouble, GLdouble, GLdouble); @@ -69,8 +62,8 @@ typedef struct // GLenum, GLenum, const void *); // libX11.so - Display* (*XOpenDisplay)(int); - XFontStruct* (*XLoadQueryFont)(Display*, char *); + //Display* (*XOpenDisplay)(int); + //XFontStruct* (*XLoadQueryFont)(Display*, char *); } FN_STRUCT; diff --git a/main.c b/main.c index 8752b84..2857f55 100644 --- a/main.c +++ b/main.c @@ -85,23 +85,12 @@ void __attribute__((externally_visible)) _start(void) fn.SDL_SetVideoMode(SCREEN_WIDTH,SCREEN_HEIGHT,32,SDL_OPENGL); fn.SDL_ShowCursor(0); - initTextures(); - initModels(); - - while(1) + do { current_t = fn.SDL_GetTicks()/1000.0f; - while(fn.SDL_PollEvent(&event)) - { - if (event.type == SDL_KEYDOWN) - goto end; - } - drawScene(); - endRenderTexture(); - drawPostProcess(); - fn.SDL_GL_SwapBuffers(); - } + fn.SDL_PollEvent(&event); + } while(event.type != SDL_KEYDOWN); end: fn.SDL_Quit();