Sign in to follow this  
Esmo2000

OpenGl linewidth function doesn't work

Recommended Posts

Hi All! I'm writing a program that only has to do some very basic things (Its being used for modelling some basic polygons). I want to make the lines thicker, but, call glLineWidth() does not seem to change the size of the lines I'm drawing no matter what. Can anyone suggest why not? I thought you might need some code snippets of where I did init code etc... Thanks!! int main(int argc, char** argv) { glutInit(&argc, argv); initGraphics(); glutMainLoop(); return 0; } void initGraphics() { glHint(GL_POINT_SMOOTH_HINT, GL_FALSE); glPointSize(1.0); glLineWidth(10.0f); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); glutInitWindowSize(Width,Height); glutInitWindowPosition(400,400); glutCreateWindow("Bounding box application"); glutDisplayFunc(drawDisplay); glutReshapeFunc(resizeFunc); } void resizeFunc(int w, int h) { if (h<=0) h=1; glViewport(0,0,w,h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0,w,h,0); glMatrixMode(GL_MODELVIEW); Width=w; Height=h; }

Share this post


Link to post
Share on other sites
I don't know how glut works, but perhaps the problem is that you call glLineWidth before glutInitDisplayMode. Maybe OpenGL is not ready to receive calls until after the glutInitDisplayMode function runs.Try moving the call to glLineWidth to right before you draw the lines.

Sorry if that's way off the mark.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this