Original Post
My situation is I created a game for my intro to comp. engineering class which is due monday. The game is complete but it's having lag issues at higher resolutions. While I could just run it at lower resolutions, I know my laptop can support much better framerates than what I'm getting, so I'm going to try to describe what I am doing in my game and perhaps someone can give me hints on optimizing parts? First off, I'm using SDL (not with OpenGL) with the standard SDL input method (while (SDL_PollEvent...) which I heard wasn't spectacular as far as getting your CPU's worth. I'm not sure if this is something I can optimize (or if it would make a noticable difference if I did). Second, the game idea is simple: it's basically the multiplayer part of bomberman but with a few differences. You have the tiled map and then objects which are drawn on top of that (not just tiles that are blocking / non-blocking). The tile map is just a 2D array that was drawing all the tiles every frame. I tried to optimize this by adding a "dirty" property and every time an object is updated it calls any overlapping tiles dirty and they will be blitted. However, most of the screen is covered with objects, so I suppose this can be further optimized by focusing only on objects moving or animating. Objects are just stored in a list sorted by draw priority then Y value. Every frame they're all updated then drawn. I suppose an optimization I can make is to only redraw objects that were dirtied by a moving or animating object, and thus those non-moving objects wont dirty tiles like they do now. Besides those few things, I'm not sure how I can optimize my routines or whether the time spent implementing that stuff will make a noticable difference. I know you don't have my code, but perhaps some of you from experience know potential bottlenecks and errors beginners make? If you want code samples and what-not, let me know. Any help is greatly appreciated! Edit: Additionally, nothing is being specified as hardware surfaces. Not sure if that helps. But here's a sample map so you know what I mean: http://img178.imageshack.us/img178/1127/samplemapzz1.jpg