Jump to content
  • Advertisement


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


Design, cache or not to cache

This topic is 6076 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!