Results 1 to 10 of 10

Thread: working with the console window

  1. #1
    Junior Member Newbie chuck norrrissss's Avatar
    Join Date
    Mar 2011
    Posts
    17

    working with the console window

    hi,
    when i run my program, i get a 'console' window and then the openGL window (i think that is what its called?) in front of the 'console' window.

    i want to position and resize the 'console' window, how can i do that? is it easy?

    thanks!
    am using win7 with vs2005
    am new to openGL, please be gentle [img]<<GRAEMLIN_URL>>/smile.gif[/img]

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: working with the console window

    That is you OS/window manager that does that automatically.
    There are very few controls for this default console.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Nov 2010
    Location
    Brazil, Rio de Janeiro
    Posts
    147

    Re: working with the console window

    It is more easy translate your OpenGL window to a position that do note overlaps the console instead of try to move the console window.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Los Angeles
    Posts
    374

    Re: working with the console window

    Quote Originally Posted by chuck norrrissss
    i want to position and resize the 'console' window, how can i do that? is it easy?
    Assuming you're running on Windows, it's easy. But you don't do it from within the OpenGL program.

    Here's how: 1) run your OGL program, 2) right mouse click on the top border of the console window, 3) a menu will come up, 4) click on 'Properties' (the last choice on my system), 5) this brings up a control panel with 5 tabs which let you set the size, color, position, font, etc., of the console window. After entering all your settings you will be asked if you want the system to remember the settings. It will do so, but only for the system you're on, and only if you execute the program the same way you did for the session in which you made the settings. The settings won't be remembered if you run your code on another computer. They would have to be reentered. So this is a partial solution to your problem. However I use it ALL the time and find it very useful.
    Am I doing your homework for you?

  5. #5
    Senior Member Regular Contributor
    Join Date
    Nov 2010
    Location
    Brazil, Rio de Janeiro
    Posts
    147

    Re: working with the console window

    Here's how: 1) run your OGL program, 2) right mouse click on the top border of the console window, 3) a menu will come up, 4) click on 'Properties' (the last choice on my system), 5) this brings up a control panel with 5 tabs which let you set the size, color, position, font, etc., of the console window. After entering all your settings you will be asked if you want the system to remember the settings. It will do so, but only for the system you're on, and only if you execute the program the same way you did for the session in which you made the settings. The settings won't be remembered if you run your code on another computer. They would have to be reentered. So this is a partial solution to your problem. However I use it ALL the time and find it very useful.
    It is a solution. The first time I read the post I thought that the objective was to move the console window dynamically, depending on some internal program state.

  6. #6
    Junior Member Newbie chuck norrrissss's Avatar
    Join Date
    Mar 2011
    Posts
    17

    Re: working with the console window

    thank you for that 'solution' which is great and works but i was hoping for a more 'general solution'.

    basically i wanted to move and resize the console window once the program starts so it is off to the side while my OGL window is on the other side.

    surely there must be a way to manipulate that console window? other example programs that i have run don't even have the console window present but i need it to show important messages while my code is running.

    maybe there is another way?
    thanks for all the suggestions!!!
    am using win7 with vs2005
    am new to openGL, please be gentle [img]<<GRAEMLIN_URL>>/smile.gif[/img]

  7. #7
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: working with the console window

    You should do that totally differently.
    For example, disable this default console (compile options), and just use a large GL window, you will have full control to put on one side the normal rendering, and on the other side the text console rendered with OpenGL.
    This may help you :
    http://www.robots.ox.ac.uk/~gsibley/GLConsole/

  8. #8
    Senior Member Frequent Contributor
    Join Date
    Mar 2009
    Location
    Karachi, Pakistan
    Posts
    810

    Re: working with the console window

    Quote Originally Posted by chuck norrrissss
    thank you for that 'solution' which is great and works but i was hoping for a more 'general solution'.

    basically i wanted to move and resize the console window once the program starts so it is off to the side while my OGL window is on the other side.

    surely there must be a way to manipulate that console window?
    You can move the console window by using the SetWindowPos WinAPI function like this,
    Code :
    SetWindowPos(GetConsoleHwnd(),NULL,left,top,width,height,0);

    GetConsoleHwnd is implemented as follows,
    Code :
    HWND GetConsoleHwnd(void)
    {
    	#define MY_BUFSIZE 1024 // Buffer size for console window titles.
    	HWND hwndFound;         // This is what is returned to the caller.
    	char pszNewWindowTitle[MY_BUFSIZE]; // Contains fabricated
    	// WindowTitle.
    	char pszOldWindowTitle[MY_BUFSIZE]; // Contains original
    	// WindowTitle.
    	// Fetch current window title.
    	GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE);
     
    	// Format a "unique" NewWindowTitle.
     
    	wsprintf(pszNewWindowTitle,"%d/%d",
    		GetTickCount(),
    		GetCurrentProcessId());
     
    	// Change current window title.
     
    	SetConsoleTitle(pszNewWindowTitle);
     
    	// Ensure window title has been updated.
     
    	Sleep(40);
     
    	// Look for NewWindowTitle.
     
    	hwndFound=FindWindow(NULL, pszNewWindowTitle);
     
    	// Restore original window title.
     
    	SetConsoleTitle(pszOldWindowTitle);
     
    	return(hwndFound);
    }

    See if this is whats u wanted?
    Regards,
    Mobeen

  9. #9
    Junior Member Newbie chuck norrrissss's Avatar
    Join Date
    Mar 2011
    Posts
    17

    Re: working with the console window

    thanks for that, will give it a try shortly....
    am using win7 with vs2005
    am new to openGL, please be gentle [img]<<GRAEMLIN_URL>>/smile.gif[/img]

  10. #10
    Junior Member Newbie chuck norrrissss's Avatar
    Join Date
    Mar 2011
    Posts
    17

    Re: working with the console window

    well in the end i used the original solution for a few days and today i was able to get rid of the console and use the window in nearly full screen which works out well. am also putting any messages onto the main window now too

    thanks again!
    am using win7 with vs2005
    am new to openGL, please be gentle [img]<<GRAEMLIN_URL>>/smile.gif[/img]

Similar Threads

  1. Console window
    By KAE in forum OpenGL: Windows
    Replies: 2
    Last Post: 01-12-2006, 03:57 AM
  2. Getting rid of GLUT console window
    By harsman in forum OpenGL: macOS
    Replies: 1
    Last Post: 05-13-2002, 04:26 PM
  3. console window
    By newmannium in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 03-09-2001, 12:20 PM
  4. Get rid of console window with glut.
    By Humus in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 02-21-2001, 06:23 PM
  5. Hiding The Console Window
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-29-2001, 01:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean