We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 343

Summary: 90 degrees rotated fullscreen
Product: SDL Reporter: Simone Bevilacqua <saimobvq>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED WORKSFORME QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: 1.2.11   
Hardware: x86   
OS: Windows (XP)   

Description Simone Bevilacqua 2006-10-11 05:35:17 UTC
On some machines, fullscreen video surfaces with the same width and height are shown rotated by 90 degrees to the left.
The following simple test program, which is supposed to draw a horizontal line, shows this problem on the HP Compaq dc7600 Convertible Minitower (Intel Pentium 4 at 3.2 GHz, Intel 82945G Express Chipset Family):

***

#include <windows.h>
#include "SDL/SDL.h"


#define WIDTH 480
#define HEIGHT 480
#define DEPTH 32


int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER) != -1)
	{
		SDL_Surface* w;
		Uint32* r;
		int x;

		w = SDL_SetVideoMode(WIDTH, HEIGHT, DEPTH, SDL_SWSURFACE | SDL_FULLSCREEN);
		
		SDL_LockSurface(w);
		r = w->pixels + w->pitch * HEIGHT / 2;
		for (x = 0; x < WIDTH; ++x) r[x] = 0xFFFFFFFF;
		SDL_UnlockSurface(w);
		SDL_UpdateRect(w, 0, 0, 0, 0);

		SDL_Delay(1000);
		SDL_Quit();
	}

	return 0;
}

***

A few additional notes:

 - using anything greater than 481 for WIDTH allows the display to be set up correctly;
 - the very same binary works perfectly on other machines;
 - a few friends, trying the game demo available at http://saimobvq.interfree.it/uniVERSUS/index.html, also reported different/worse problems, the worst of which being the impossibility of opening the video surface altogether (on a Sony Vaio - sorry, I have no other information about that machine);
 - SDL 1.2.9 worked just fine (don't know about 1.2.10 as I directly jumped to 1.2.11);
 - all the programs ever tried were compiled with MinGW.
Comment 1 Sam Lantinga 2007-07-04 01:13:50 UTC
I don't even know how this is possible!  It definitely sounds like a driver bug to me (setting square video mode sets the video driver in rotated mode?)  You can try running with the DirectX driver and see if that fixes things...
Comment 2 Ryan C. Gordon 2007-07-07 18:08:37 UTC
Closing this as an OS video driver issue.

--ryan.