Window Size/Screen Resolution in SDL

Posts: 1,066
Joined: 2004.07
Post: #1
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?
Quote this message in a reply
Posts: 156
Joined: 2002.10
Post: #2
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.


- Iain

P.S. Have a look at - It's a load of SDL game code that you can use for free!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  DPI and Resolution for Graphics mickyg 9 14,008 Apr 27, 2012 03:02 PM
Last Post: Andres Calil
  switching screen resolution NelsonMandella 3 5,285 Apr 25, 2010 01:33 PM
Last Post: SethWillits
  OpenGL full screen mode leaves garbage on screen when exiting app Malarkey 5 7,976 Nov 19, 2008 12:51 PM
Last Post: Malarkey
  game image sizes and screen resolution leRiCl 5 6,283 Jul 2, 2008 03:31 AM
Last Post: leRiCl
  Changing resolution while already in full-screen mode? Malarkey 1 3,940 Jun 10, 2008 07:49 PM
Last Post: AnotherJake