hi, im in a major stumble, and i have no idea how to get out of it. basically everything i render is not displaying on the screen. now it sounds easy to fix ofcourse, but believe me ive tried everything. ive even rewritten my base code to try and come across the problem. its a fullscreen win32 app. for you experienced people, what possible reasons could there be for nothing being rendered or shown on the screen? this is a difficult question but please i need all the help i can get. thanks
also, another problem i have is that i have to update the hDC everytime before i call SwapBuffers(hDC); is this normal? i have looked at other demos and this wasnt done. what is the reason for this?
Why do you have to update hDC everytime? The only time you would need to do that is if you destoyed it for some reason…so I don’t know, what is your reason for doing that?
well all i know is that if i dont update the hDC, SwapBuffers fails, not flipping the front and back buffers. if i do update it, swapbuffers works, but i think maybe this is why i cant get anything to render. im not sure
ok, i fixed my swapbuffer problem. however i still have the rendering problem. once again, if you have any ideas let me know, thanks
In this situation you need to start off simple and build your app testing as you go.
First thing is to use glClearColor and glClear to see if that has any visible effect. If it does you’re in business, if not you need to check your return values when creating the context.
The next potential problems and polygon color and vertex coordinates (state might be an issue if you’ve messed around with it).
Next thing is draw something really simple you know should be visible like a single triangle (a different color from your background). Next build from there and remember that for vertices to be visible Z coordinates will have to be a negative number between the near and far clip within the frustum if you place a frustum on the projection matrix.
If all this fails then you should really start with some simple online sample code and edit it, that way you know you are setting out from a functionally correct starting point. There’s loads of code out there which will clear the screen and draw a triangle and NOTHING else.
thanks for your thoughts
glClearColor and and glClear do work successfully. i can clear the screen to any color.
its when its comes to lines and points that nothing is displayed.
could it be something as simple as my orientation? ive tried moving the camera around all over the place. ive tried gluLookAt also.
what is the default camera position and do you look at the origin by default?
[This message has been edited by Warrior (edited 02-23-2001).]