I solved my problem about the subwindow...but a new trouble has creeped in...
i want to have an interactive application, it works simply great for the first time... but gives a problem like "debug assertion failed".
i am using glut on vc++6.0.
as was recommended i am posting my code as well http://www.opengl.org/discussion_boards/ubb/smile.gif
The include files in the code pertain to processing the textual input by the user and display the corresponding shape.
http://www.opengl.org/discussion_boards/ubb/confused.gif Why does it take only one input???????
is there any way to put it into some kind of while-loop?????
HELP.
/* Main Program*/
#include<stdio.h>
#include<conio.h>
#include"INITIAL.h"
#include"Recogniz.cpp"
#include<GL/glut.h>

Your keyboard() callback function is called each time you press a key, but you cannot use swapbuffers in your function, you should use the refresh function instead, I think it is called glutRedisplay() or something like that, this will force an update of the window contents, just swapping buffers is not a good thing, and doing it twice in a row is even worth...

Hope that helps.
Mikael

Richa

09-24-2002, 11:32 PM

I agree that two "swapBuffers" ahould not be put together... but if i donot have two swapbuffers the contents are not rendered at all....
I thought about the ReDisplay callback too... i hope that works..
Thanks
Richa

nexusone

09-25-2002, 05:11 AM

First you should have only one call to swapbuffers and it should be after you have drawn your complete scene.

I don't think it is good to put drawing commands in your keyboard routine, instead use variables to control drawing changes in your display routine.

[QUOTE]Originally posted by Richa:
[B]I solved my problem about the subwindow...but a new trouble has creeped in...
i want to have an interactive application, it works simply great for the first time... but gives a problem like "debug assertion failed".
i am using glut on vc++6.0.
as was recommended i am posting my code as well http://www.opengl.org/discussion_boards/ubb/smile.gif
The include files in the code pertain to processing the textual input by the user and display the corresponding shape.
http://www.opengl.org/discussion_boards/ubb/confused.gif Why does it take only one input???????
is there any way to put it into some kind of while-loop?????
HELP.

[This message has been edited by nexusone (edited 09-25-2002).]

nexusone

09-25-2002, 05:16 AM

Here is a example program that I wrote for someone, it is GLUT based, shows keyboard input, lighting, glu and glut objects.