simple program using openGL in GLUT
hello please I need some help:
I have this little program on c++ using GLUT Code:
#include <GL/GL/glut.h> thanks a lot for your time. Poeta |
Code:
#include <GL/GL/glut.h> |
Add glutSwapBuffers to the end of your Display() function. You are requesting a double buffer with the GLUT_DOUBLE, but you never swap the buffers.
|
Thanks for your responses. I've done what you guys said, and this is how it looks:
Code:
#include <GL/GL/glut.h> |
I don't see anything that would cause you not to see the teapot off the top of my head, but a couple of things I do see is that you have glutSwapBuffers before glFlush. glFlush should go before glutSwapBuffers, though technically, it's not even needed because glutSwapBuffers will flush before it swaps, anyway...
Also, you enable depth test, but you don't have GLUT_DEPTH in your glutInit params. Without that, you may not get a depth buffer to begin with in order for your depth test to work. Neither of those problems should cause you not to see the teapot, though. Have you tried glutSolidTeapot, just to make sure you're just not missing the wireframe? The projection matrix looks ok, so your teapot should be within the viewing frustum... you're not enabling lighting, so it's not a material/normal/lighting problem... If I get a chance I'll try to compile that on my system and see if I am missing anything. |
One other thing you aren't doing is clearing the depth buffer by adding GL_DEPTH_BUFFER_BIT in the bitmask for glClear...
Here's the program with those changes. It seems to work fine for me: Code:
// This seems odd too, usually glut.h is directly under GL/glut.h, |
hello!
thanks thanks a lot I can see it now.... it's odd since I have this other program also displaying a teapot but with the ability to rotate it pressing space bar.... and that one worked right away.... I use GL/GL/glut because that's my dir tree... even tough I've seen it should be only one GL, I'll change it right now. Thanks!!!! I appreciate it |
BTW, on a totally off-topic tangent based on your sig...
Have you read book 6 yet? Book 7 will be out Sept 21!!! :) |
mmm sorry what do you mean? hehe are you talking about king crimson??
I love it?s music!!! but books??? i only know about one book of King Crimson band is that what you meant?? hehehe sorry about being so out of fashion! poeta |
|
hahahaha I love your signature.... I must use GLUT because it's a requirement at school but I definitly will check that out too!! thanks for the recommendation..........
BTW know of any good tutorial? I don't want to bother you nice guys with silly questions all the time :( |
Try
http://nehe.gamedev.net its' got the best tutorials :) |
Here is the documentation for SDL. Its the only thing I needed to learn how to use SDL. SDL is really simple! There are some examples at the bottom of the page.
http://sdldoc.csn.ul.ie/index.php You can also find allot of good docs on the SDL web page. By the way, I thought when you said "gimme' some tuts'" you were talking about SDL. If you are talking about GLUT then I do suggest nehe, or google it. |
Quote:
|
hehehe .......... I was talking about King Crimson the rock band which leader is Robert Fripp... I recommend it and if you have the opportunity you should listen the song called "Matte Kudasai".
It's quite strange but really cool :) Quote:
I just have to find a passion!! |
All times are GMT -5. The time now is 03:57 PM. |