void Gui_Render() { const text_shader_description *shader = renderer.shaderManager->getTextShader(); screenSize[0] = screen_info.w; screenSize[1] = screen_info.h; qglUseProgramObjectARB(shader->program); qglUniform1iARB(shader->sampler, 0); qglUniform2fvARB(shader->screenSize, 1, screenSize); qglUniform1fARB(shader->colorReplace, 0.0f); qglPushAttrib(GL_ENABLE_BIT | GL_PIXEL_MODE_BIT | GL_COLOR_BUFFER_BIT); qglPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT | GL_CLIENT_VERTEX_ARRAY_BIT); qglEnableClientState(GL_TEXTURE_COORD_ARRAY); qglPolygonMode(GL_FRONT, GL_FILL); qglFrontFace(GL_CCW); qglEnable(GL_BLEND); qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); qglDisable(GL_ALPHA_TEST); if(World_GetPlayer() && main_inventory_manager) { Gui_DrawInventory(engine_frame_time); } Gui_DrawNotifier(engine_frame_time); qglUseProgramObjectARB(shader->program); qglDepthMask(GL_FALSE); qglPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE); qglPixelStorei(GL_UNPACK_ALIGNMENT, 1); if(screen_info.crosshair != 0) { Gui_DrawCrosshair(); } Gui_DrawBars(); qglUniform1fARB(shader->colorReplace, 1.0f); GLText_RenderStrings(); Con_Draw(engine_frame_time); qglUniform1fARB(shader->colorReplace, 0.0f); qglDepthMask(GL_TRUE); qglPopClientAttrib(); qglPopAttrib(); }
void Engine_Display() { if(!done) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);//| GL_ACCUM_BUFFER_BIT); engine_camera.apply(); engine_camera.recalcClipPlanes(); // GL_VERTEX_ARRAY | GL_COLOR_ARRAY if(screen_info.show_debuginfo) { ShowDebugInfo(); } glFrontFace(GL_CW); renderer.genWorldList(); renderer.drawList(); //glDisable(GL_CULL_FACE); //Render_DrawAxis(10000.0); /*if(engine_world.character) { glPushMatrix(); glTranslatef(engine_world.character->transform[12], engine_world.character->transform[13], engine_world.character->transform[14]); Render_DrawAxis(1000.0); glPopMatrix(); }*/ Gui_SwitchGLMode(1); { Gui_DrawNotifier(); if(engine_world.character && main_inventory_manager) { Gui_DrawInventory(); } } Gui_Render(); Gui_SwitchGLMode(0); renderer.drawListDebugLines(); SDL_GL_SwapWindow(sdl_window); } }