Window Size/Screen Resolution in SDL
I am trying to make a windowed SDL game of Tetris (starting small). I need the resolution to be nice and high but how can I set the window size to be around 380x440 pixels?
In SDL, you can create a window of any size you like -
To get a SDL_Surface for the screen use the following call:
SDL_Surface *SDL_SetVideoMode(380, 440, 32, SDL_SWSURFACE);
Remember to check that the returned surface is not null, which it will be if the window setup failed.
Notice that this window will look quite small indeed on a large screen e.g.1600x1200!
But that's how you do it anyway.
Cheers
- Iain
P.S. Have a look at http://www.pyramid-productions.net/downl...mebase.sit - It's a load of SDL game code that you can use for free!
To get a SDL_Surface for the screen use the following call:
SDL_Surface *SDL_SetVideoMode(380, 440, 32, SDL_SWSURFACE);
Remember to check that the returned surface is not null, which it will be if the window setup failed.
Notice that this window will look quite small indeed on a large screen e.g.1600x1200!
But that's how you do it anyway.
Cheers
- Iain
P.S. Have a look at http://www.pyramid-productions.net/downl...mebase.sit - It's a load of SDL game code that you can use for free!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| DPI and Resolution for Graphics | mickyg | 9 | 6,665 |
Apr 27, 2012 03:02 PM Last Post: Andres Calil |
|
| switching screen resolution | NelsonMandella | 3 | 2,913 |
Apr 25, 2010 01:33 PM Last Post: SethWillits |
|
| OpenGL full screen mode leaves garbage on screen when exiting app | Malarkey | 5 | 4,463 |
Nov 19, 2008 12:51 PM Last Post: Malarkey |
|
| game image sizes and screen resolution | leRiCl | 5 | 3,831 |
Jul 2, 2008 03:31 AM Last Post: leRiCl |
|
| Changing resolution while already in full-screen mode? | Malarkey | 1 | 2,259 |
Jun 10, 2008 07:49 PM Last Post: AnotherJake |
|

