glOrtho - invalid value?

Started by ggp83, December 01, 2007, 09:07:15

Previous topic - Next topic

ggp83

When I write glOrtho(0.0, 800.0, 0.0, 600.0, 1.0, 1.0) I get an invalid value exception. And I only get it when I assign near and far the same value. However I've done this before and never noticed any errors :/

However I've been doing OpenGL in both C/C++ and Java, so it's possible I have totally missed this error because I have mostly used C/C++ and been bad at checking for errors. But still it's kind of odd, since my OpenGL reference says that gluOrtho2D is the same as glOrtho with near and far plane set to 1. So it should work right?

VarenytsiaMykhailo

Quote from: ggp83 on December 01, 2007, 09:07:15
When I write glOrtho(0.0, 800.0, 0.0, 600.0, 1.0, 1.0) I get an invalid value exception. And I only get it when I assign near and far the same value. However I've done this before and never noticed any errors :/

However I've been doing OpenGL in both C/C++ and Java, so it's possible I have totally missed this error because I have mostly used C/C++ and been bad at checking for errors. But still it's kind of odd, since my OpenGL reference says that gluOrtho2D is the same as glOrtho with near and far plane set to 1. So it should work right?

You need to add one minus for zNear of zFar)