Sign in to follow this  

OpenGL SDL + OpenGL creating console window, how to remove...

Recommended Posts

So when I launch my program it launches a console window as well as the main application window. I can close the console window and my app keeps running fine so it doesn't appear to be tied in with it or anything. Also when I close my app the console window closes with it. It's kinda like when you execute a batch file or any dos program and once it's done it closes the console window. So it seems like when I launch my program it opens it in a console first. Is there some way to remove this since it's kinda annoying? I remeber running a tutorial program I downloaded and it did the same thing. In case anyone needs to see it, this is the initialization code in my app so far. It's just crappy stuff to test my image drawing functions right now and not an actual engine code.
using namespace std;

#include "main.h"
#include <SDL/SDL.h>
#include <SDL/SDL_opengl.h>
#include <IL/il.h>
#include "Image.h"

 * The main entrypoint into the application
int main(int argc, char* argv[])
    SDL_Event event;
    unsigned short i;
    bool appRunning = true;

    if(SDL_Init(SDL_INIT_VIDEO) == -1)

    if(SDL_SetVideoMode(640, 480, 32, SDL_OPENGL) == NULL)
        return false;

    //set clear color
    glClearColor(0, 0, 0, 0);

    //set orthographic projection
    glOrtho(0, 640, 480, 0, -100, 100);




    //enable flat shading for sprite drawing

    if(glGetError() != GL_NO_ERROR)
        return false;

    SDL_WM_SetCaption("illEngine", NULL);


    //application stuff goes here


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this