Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

SDL using C in DevC++ 4.9.2

$
0
0
Hi there
I just set up SDL in DevC++ to do make some 2d games.I then tested it by typing a demo program and the program gave the desired output(displayed a window) but an unwanted console window is also displayed behind the expected window when the program is run.I am unable to attach the screenshot.
The project has been created as
File-->New-->Project-->Empty Project(C project)

#include "SDL.h"

int main(int argc, char *argv[])
{

SDL_Surface *screen;

atexit(SDL_Quit);

if( SDL_Init(SDL_INIT_VIDEO) < 0 ) exit(1);

SDL_WM_SetCaption("SDL Window", NULL);

screen = SDL_SetVideoMode( 640 , 480 , 32 , SDL_DOUBLEBUF|SDL_HWSURFACE|SDL_ANYFORMAT);

SDL_FillRect(screen , NULL , 0x66FF00);

SDL_Flip(screen);

SDL_Delay( 5000 );

return 0;
}




Kindly Help.
Regards

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>