nuclear@3: #include nuclear@3: #include "opengl.h" nuclear@3: #include "texture.h" nuclear@3: nuclear@3: unsigned int hiero_tex; nuclear@3: nuclear@3: bool init_scroller() nuclear@3: { nuclear@3: if(!(hiero_tex = load_texture("data/hieroglyph2.png"))) { nuclear@3: return false; nuclear@3: } nuclear@3: nuclear@3: glBindTexture(GL_TEXTURE_2D, hiero_tex); nuclear@3: /*glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); nuclear@3: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);*/ nuclear@3: nuclear@3: return true; nuclear@3: } nuclear@3: nuclear@3: void destroy_scroller() nuclear@3: { nuclear@3: free_texture(hiero_tex); nuclear@3: hiero_tex = 0; nuclear@3: } nuclear@3: nuclear@3: void draw_scroller(float sec) nuclear@3: { nuclear@3: glPushAttrib(GL_ENABLE_BIT); nuclear@3: nuclear@3: glDisable(GL_DEPTH_TEST); nuclear@3: glDisable(GL_LIGHTING); nuclear@3: glEnable(GL_TEXTURE_2D); nuclear@3: glBindTexture(GL_TEXTURE_2D, hiero_tex); nuclear@3: nuclear@3: glMatrixMode(GL_MODELVIEW); nuclear@3: glPushMatrix(); nuclear@3: glLoadIdentity(); nuclear@3: glScalef(1.4, 0.4, 1.4); nuclear@3: glMatrixMode(GL_PROJECTION); nuclear@3: glPushMatrix(); nuclear@3: glLoadIdentity(); nuclear@3: glMatrixMode(GL_TEXTURE); nuclear@3: glPushMatrix(); nuclear@3: glLoadIdentity(); nuclear@3: nuclear@3: glTranslatef(sec * 0.25, 0, 0); nuclear@3: nuclear@3: glBegin(GL_QUADS); nuclear@3: glColor3f(1, 1, 1); nuclear@3: glTexCoord2f(0, 1); glVertex2f(-1, -1); nuclear@3: glTexCoord2f(1, 1); glVertex2f(1, -1); nuclear@3: glTexCoord2f(1, 0); glVertex2f(1, 1); nuclear@3: glTexCoord2f(0, 0); glVertex2f(-1, 1); nuclear@3: glEnd(); nuclear@3: nuclear@3: glPopMatrix(); nuclear@3: glMatrixMode(GL_PROJECTION); nuclear@3: glPopMatrix(); nuclear@3: glMatrixMode(GL_MODELVIEW); nuclear@3: glPopMatrix(); nuclear@3: glPopAttrib(); nuclear@3: }