PDA

View Full Version : Another Beginer Question- How to Correct this error in Multiple Window



apoorv
12-16-2012, 08:07 AM
Hi,

I am opening multiple window using fortran and OPENLGL. Now the problem I am facing is that the first window I am opening comes as blank white. I am attaching a snapshot.

I you can help me it will be great. I have attached the image of error to my home site

https://sites.google.com/site/shuklaapurva/multiwindowerror

It has a png file attached

Best Regards

Apurva

https://f35b8852-a-62cb3a1a-s-sites.googlegroups.com/site/shuklaapurva/multiwindowerror/Error_MultipleWindow.png?attachauth=ANoY7cqHqZpuk4 C28dA5HMcGjJe5aMGbmUqAnDzFPVYNo62keSyA73FK2_gj5oZi YsA2OycEveS-WNopD1ueAiGAEftdQrfuGMpOrVTrE5JVzSAH-rDyZSflyj2W4XLBm_yawNKAbdMzJjdiHggL6QsTu8IsidCS024 PJbRmUDdBdn91Ccm-gruseVGzGLfmBCuW6PkAWPrrvsyB8oFHkSRuRVCizNBAvbdmFY EA_LRboS0QGfmWjtgwoBkBQ7LwTnziGMw6zHRp&attredirects=0

tonyo_au
12-16-2012, 04:45 PM
Is it white when you only have one window? Some code might help.

apoorv
12-16-2012, 06:32 PM
Hi,

Yes it is white only when I start. On readjusting the window it comes in black background. Also I want white background for that window, but whatever I have tried it comes black.

Any help would be helpful.

Best Regards

Apurva

tonyo_au
12-16-2012, 06:45 PM
Some code might help.

apoorv
12-16-2012, 07:02 PM
Some code might help.

Hi,

Which code can help. Do you want part of the code I have written

Apurva

apoorv
12-16-2012, 07:12 PM
Some code might help.

This is Main Display Call Code

call glutinit()
call glutinitdisplaymode(ior(GLUT_SINGLE,GLUT_RGB))
call glClearColor(1.0,1.0,1.0,1.0)
! Calling Profile Curve
call glutInitWindowSize(width_p,height_p)
call glClearColor(1.0,1.0,1.0,1.0)
wind = glutCreateWindow("Profile Curve")
CALL glutPositionWindow(50,50)
! Clear the Screen and Depth Buffer
call glutDisplayFunc(glDraw)
call glutReshapeFunc(myReshape)
! Calling Mean Curve
windm = glutCreateWindow("Mean Curve")
CALL glutPositionWindow(50+width_m,50)
call glClearColor(1.0,1.0,1.0,1.0)
call glutDisplayFunc(glDrawMean)
call glutReshapeFunc(myReshapeMean)

CALL glPushMatrix()
CALL glFlush()
call glutMainLoop()

The Draw Subrotuine is

call glLoadIdentity()
call glColor3f(1.0,1.0,0.0)
call glBegin(GL_LINE_STRIP)
DO i=1,201
CALL glvertex3f(crv(i,1),crv(i,2),crv(i,3))
END DO
call glEnd()

The Reshape Subroutine is
CALL glViewport(10, 10, (width_p-10),( height_p-10))
CALL glMatrixMode(GL_PROJECTION)
call glortho(xmin,xmax,ymin,ymax, -1.0_gldouble, 1.0_gldouble)
CALL glClear(GL_COLOR_BUFFER_BIT)
CALL glMatrixMode(GL_MODELVIEW)
CALL glLoadIdentity()

Hope this is part of code you where looking for

tonyo_au
12-16-2012, 10:52 PM
Thanks for the code.
I am unsure where your third window is coming from; does your app automatically create a window?
You only have logic to render into 2 OpenGL windows.

apoorv
12-16-2012, 11:19 PM
Hi

Actually I have pasted code for 2 windows only, the thrid is repration like mean curve till glPUSHMATRIX . Even with 2 window I am getting same error. Am I missing some command or step which is causing the problem only in first window

Best Regards

tonyo_au
12-17-2012, 01:47 AM
I would be looking for a problem that is stopping your draw function being called for that window. I don't use glut but maybe you have a separate draw function for each window