Hello Guest

glOrtho - invalid value?

  • 1 Replies
  • 6771 Views
glOrtho - invalid value?
« 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?

Re: glOrtho - invalid value?
« Reply #1 on: March 20, 2020, 10:41:36 »
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)