Jump to content
  • Advertisement
Sign in to follow this  

SDL Output Problem*solved*

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

When i try and run my program, i get no output, it compiles fine, but when executed, nothing happens.(And yes, there should be output). [Edited by - Xabbu on September 3, 2004 5:49:05 PM]

Share this post

Link to post
Share on other sites
I'm assuming you're writing to the standard output... Do you have any idea why it isn't showing up? Anything more information you can give us to narrow the problem down? How about showing us some code. Preferably, the function where you output, and perhaps where you set up SDL.

Share this post

Link to post
Share on other sites
Writing to stdout should function correctly if you set your project up as a console app (which you possibly didn't).

If you set up a Win32 app you should find some files in your game's working directory (check your project folder or whatever) called stdout.txt or suchlike.

Hope this helps


Share this post

Link to post
Share on other sites
Ok, here's the code.I got it from a tutorial.

#include <SDL/SDL.h>
#include <stdio.h>
#include <stdlib.h>

SDL_Surface *screen;

void Draw(int x, int y, SDL_Surface *sprite);

int main(int nArgs, char **args)

SDL_Surface *image;
bool isRunning;


screen = SDL_SetVideoMode(300, 200, 0, SDL_HWSURFACE|SDL_DOUBLEBUF);
image = SDL_LoadBMP("image.bmp");

isRunning = true;

SDL_Event event;

if (event.type == SDL_QUIT)
isRunning = false;





return 0;

void Draw(int x, int y, SDL_Surface *sprite)
SDL_Rect source;
SDL_Rect dest;

source.x = 0;
source.y = 0;
source.w = sprite->w;
source.h = sprite->h;

dest.x = x;
dest.y = y;
dest.w = source.w;
dest.h = source.h;

SDL_BlitSurface(sprite, &source, screen, &dest);


edit:bah, now i have output, but it flashes for like half a second then closes.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!