News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Can't cout (using opengl and sdl)

Started by Fooleo, November 05, 2010, 04:30:19 AM

Previous topic - Next topic

Fooleo

I know your thinking "another one of these topics!" but i assure you i have been looking around and can not find a fix for my problem.

So after initialize SDL i tried putting this code (as was directed by other forums/sites)


    freopen( "CON", "w", stdout );
    freopen( "CON", "w", stderr );


but i got nothing. So then i tried this (as directed by another site)


    if( init() == false )//initializes SDL
    {
        return 1;
    }
    ofstream ctt("CON");

    freopen( "CON", "w", stdout );
    freopen( "CON", "w", stderr );

//...game code and stuff, then right before i quit SDL:

    ctt.close();



I also tried "FILE * ctt = fopen("CON", "w" );" instead of "ofstream ctt("CON");" but i just got an error when i tried to close ctt saying that it was not of type FILE*, which is ridiculous.

What else can i do to make my program print to the console?? A lot of my debugging code utilizes the console (i was using GLUT and recently switched to SDL, which is why already have a lot of debugging code written that uses it). So I would really like to figure this out.

Thanks for your help.

ollydbg

Not related to C::B.
Please seek some other forums to discuss your question.
Bye.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.