This topic is now archived and is closed to further replies.


Design, cache or not to cache

Recommended Posts

hotdot    122
The question is for all of you who have finished at least one game. I am now at the stage to decide if i cache all my entities and sound at the booting of the game or do i make states for loading in my main loop: EX: void CGame::GameState(float time) { static float rotate = 0.0f; switch(m_state) { case ST_LOAD_SCREEN: glPushMatrix(); glTranslatef(-1.5f,0.0f,-6.0f); rotate += 1.0f; // draw a triangle glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glDepthMask(GL_FALSE); ... break; case ST_BEFORE_WORLD: //cache all entities and world sound break; ... } ... /////////END EXAMPLE////////////// do you all understand the question ? this is mainly for speed reason so that there is not much overhead inside the game. thanks for any advices May the code be with us !

Share this post

Link to post
Share on other sites