954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

OpenGL help (multiple display windows)

I am trying to create 2 different rendering windows using OpenGL.
My code looks like:

void display1(){...}
void display2(){...}

void init(){... //some declarations and function calls pertaining to display2}

int main(){
	glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
	glutInitWindowSize(1024,512);
	glutInitWindowPosition(0, 0);
	glutCreateWindow("Window 1");
	glutDisplayFunc(display1);

	glutPositionWindow(520,20);
	glutCreateWindow("Window 2");
	init();
	glutDisplayFunc(display2);	

	glutMainLoop();
	return 0;
}


The code runs fine but my problem is that the both windows have same size i.e. 1024*512. I want the size of Window2 to be 512*512. I tried to insert the line "glutWindowSize(512,512);" before the line "glutPositionWindow(520,20);" but the program crashes if I do so. Is there any way to resize Window2?

Thanks in advance for your help

takken1
Newbie Poster
1 post since Dec 2010
Reputation Points: 10
Solved Threads: 0
 

Is there a way of resizing the window through your program after it's been created?

SgtMe
Nearly a Posting Virtuoso
1,205 posts since Oct 2009
Reputation Points: 68
Solved Threads: 85
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: