SDL can't run 1024x1280 screen
The following SDL code on a Mac Mini G4 with 512 Meg Ram:
Produces the following:
I've played with flag settings for hours. The largest screen
I've been able to bring up is 1024x1024. Close but no cigar.
Anybody have any suggestions? Thanks.
Code:
// Check if or resolution is restricted
if(modes == (SDL_Rect **)-1)
{
cout << "All resolutions available" << endl;
}
else
{
// Print valid modes */
cout << "Available Modes" << endl;
for(int i = 0; modes[i]; ++i)
{
cout << "modes width and height " << modes[i]->w << " x " << modes[i]->h << endl;
}
}
flags = SDL_OPENGL | SDL_FULLSCREEN | /*SDL_DOUBLEBUF*/ SDL_SWSURFACE; // SDL_HWSURFACE
screen = SDL_SetVideoMode(gHeight, gWidth, 0, flags);
if ( screen == NULL )
{
cout << endl << SDL_GetError() << endl;
exit(1);
}Produces the following:
Quote:Available Modes
modes width and height 1280 x 1024
modes width and height 1280 x 960
modes width and height 1024 x 820
modes width and height 1024 x 768
modes width and height 800 x 640
modes width and height 800 x 600
modes width and height 640 x 512
modes width and height 640 x 480
gHeight = 1024
gWidth = 1280
No video mode large enough for 1024x1280
I've played with flag settings for hours. The largest screen
I've been able to bring up is 1024x1024. Close but no cigar.
Anybody have any suggestions? Thanks.
That's because you don't have a resolution available with a height of 1280. I'm guessing what you really want is 1280x1024.
You seem to have height & width backward in your call to SetVideoMode....
Yes, that solved ALL my problems. Not one of my prouder moments.
THANKS!
THANKS!
Noticed you attached SDL_SWSURFACE to your flags, is that a valid combination, SDL_OPENGL and SDL_SWSURFACE?
That was just a copy and paste job, so I assume it is OK. No problems.
Whether it's legal or not, it doesn't make much sense, and could easily cause severe problems...
I've got several questions about SDL now...
In samples I've seen here and here and here people combine SDL_DOUBLEBUF, SDL_OPENGL and/or SDL_**SURFACE (** = HW | SW).
As far as I know, these are *all* incorrect. SDL_OPENGL can only be combined with SDL_FULLSCREEN. All other properties are set with SDL_GL_SetAttribute().
Am I missing something or are many people using SDL incorrectly?
Thanks!
In samples I've seen here and here and here people combine SDL_DOUBLEBUF, SDL_OPENGL and/or SDL_**SURFACE (** = HW | SW).
As far as I know, these are *all* incorrect. SDL_OPENGL can only be combined with SDL_FULLSCREEN. All other properties are set with SDL_GL_SetAttribute().
Am I missing something or are many people using SDL incorrectly?
Thanks!
I think you're write that they're incorrect, but I'm assuming that if it sees SDL_OPENGL it ignores all else that doesn't make sense. (otherwise all these examples would break.
) I know that SDL_*SURFACE is for non-OpenGL, but I'm not 100% sure whether SDL_DOUBLEBUF does anything or not with OpenGL. (it could have a bearing over whether or not the window is double buffered)
) I know that SDL_*SURFACE is for non-OpenGL, but I'm not 100% sure whether SDL_DOUBLEBUF does anything or not with OpenGL. (it could have a bearing over whether or not the window is double buffered)
akb825 Wrote:I'm not 100% sure whether SDL_DOUBLEBUF does anything or not with OpenGLIt doesn't; to specify that SDL should create a double-buffered OpenGL context, you should call...
Code:
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 )Mark Bishop
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| OpenGL full screen mode leaves garbage on screen when exiting app | Malarkey | 5 | 4,454 |
Nov 19, 2008 12:51 PM Last Post: Malarkey |
|

