Archived

This topic is now archived and is closed to further replies.

SDL question for Null and Void(or anyone else)

This topic is 5882 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

I say Null and Void cause he''s the one that directed me too it... and thank god! It''s so easy to get started and skip the formalites of windows programming and messages. Anyway, I seem to be having a problem when I go fullscreen. I set my video surface to 640x480x16. When i SDL_FillRect(&mySurface, NULL, SDL_MakeRGB(fmt,255,0,0)); it doesn''t fill up the entire screen. There seem to be parts on both sides of my screen that remain black. This does not happen when I switch to windowed mode. Any ideas? Thanks

Share this post


Link to post
Share on other sites
I''m assuming you''re using
SDL_SetVideoMode (640,480,16, SDL_FULLSCREEN | <the rest); ?

Are you using the SDL Libraries which use DX or the WinDIB graphics backend? Check that out, since I believe that that effect is caused by SDL drawing through the DIB driver.

That''s about as much help as I can give, since I use SDL on Linux, and I''m not really up to speed with windows programming - however, you may want to check out the mailing list - links available from www.libsdl.org

Good luck!

KB

quote:
Original post by xtrmntr
I say Null and Void cause he''s the one that directed me too it... and thank god! It''s so easy to get started and skip the formalites of windows programming and messages.

Anyway, I seem to be having a problem when I go fullscreen. I set my video surface to 640x480x16. When i SDL_FillRect(&mySurface, NULL, SDL_MakeRGB(fmt,255,0,0)); it doesn''t fill up the entire screen. There seem to be parts on both sides of my screen that remain black. This does not happen when I switch to windowed mode. Any ideas?

Thanks

Share this post


Link to post
Share on other sites
This will have you seeing red, fullscreen.

  
#include <SDL.h>

int main(int argc, char** argv)
{
SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_NOPARACHUTE);

SDL_Surface *screen = SDL_SetVideoMode(640, 480, 16, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN );

SDL_FillRect(screen,NULL,SDL_MapRGB(screen->format,255,0,0));
SDL_Flip(screen);

bool done=false;

while ( !done )
{
SDL_Event event;
SDL_PollEvent(&event);
if ( event.type == SDL_KEYDOWN )
done = true;
}
return 0;

}


I dont know where you got SDL_MakeRBG, so I changed it SDL_MapRGB. Plus you have to make your changes to the screen. I dont know if mySurface was the screen or not.

quote:

It''s so easy to get started and skip the formalites of windows programming and messages.


Isnt that the sweetest part.

Share this post


Link to post
Share on other sites
Thanks for the replies guys. I do have it as SDL_MapRGB (I was tired when I wrote the post) and when I check the driver info it returns directx. As far as my video goes, this is what it prints out to me in the dos window:

Initializing SDL Video Subsystem.
SDL Video Subsystem Initialized.

Available Video Modes:
1600 x 1200
1600 x 1024
1600 x 900
1280 x 1024
1280 x 960
1280 x 768
1152 x 864
1024 x 768
800 x 600
640 x 400
512 x 384
400 x 300
320 x 240
320 x 200
640 x 480


Available Video Card Info:
Creatable Hardware Surfaces available.
Windows Manager is available.
Hardware to Hardware Blits accelerated.
Hardware to Hardware Colorkey Blits accelerated.
Software to Hardware Blits accelerated.
Software to Hardware Colorkey Blits accelerated.
Color Fills accelerated.

You have 59774 KiloBytes of video memory total.

Screen initialized and displaying in 640x480x16, running under directx.
System Evaluation Complete.
Quiting SDL.

I think it has something to do with the monitor size. I have ran my program at home and at work where i have a 20" at work and a 21" and home and they both produce the same results. Anyway, guess I''ll just stick to windowed mode for now.

Share this post


Link to post
Share on other sites