Jump to content
  • Advertisement
Sign in to follow this  
Jeroen Stout

SDL + OpenGL adapters + resolutions

This topic is 3666 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everybody, I'm a DirectX convert now using SDL + OpenGL, so I was wondering about these two things that I have not found much info on just yet. For reference, I'm just using SDL and OpenGL, no other libraries. 1. Can I check which monitor resolutions are available in a OS-independent manner? So far SDL has helped me to make everything independent and I'd like to keep it that way. 2. Can I select which device is used for 3d? Meaning, can I select which monitor is used for full screen resolutions (as multi-monitor setups are increasing)? If anybody could help me with this I'd be most thankful. -Jeroen

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Can I check which monitor resolutions are available in a OS-independent manner? So far SDL has helped me to make everything independent and I'd like to keep it that way.

Yes, SDL_ListModes will do that. It returns the available resolutions for a given video format:
Quote:
SDL_ListModes
Name
SDL_ListModes -- Returns a pointer to an array of available screen dimensions for the given format and video flags
Synopsis

#include "SDL.h"
SDL_Rect **SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);


Description
Return a pointer to an array of available screen dimensions for the given format and video flags, sorted largest to smallest. Returns NULL if there are no dimensions available for a particular format, or -1 if any dimension is okay for the given format.

If format is NULL, the mode list will be for the format returned by SDL_GetVideoInfo()->vfmt. The flag parameter is an OR'd combination of surface flags. The flags are the same as those used SDL_SetVideoMode and they play a strong role in deciding what modes are valid. For instance, if you pass SDL_HWSURFACE as a flag only modes that support hardware video surfaces will be returned.


Quote:
Can I select which device is used for 3d? Meaning, can I select which monitor is used for full screen resolutions (as multi-monitor setups are increasing)?

I don't think that you can do that with SDL.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!