title: glOrtho isn't changing coordinate system in 2D window?
body: <p>So unless I understood this wrong, in a default OpenGL window coordinates (0,0) are in the center of the screen.  I've set up the following resize function using <code>glOrtho</code>/<code>glViewport</code> to set the top left corner as (0,0).  But for some reason drawing a point at (0,0) still shows up at the center of the screen (and it's still on a -1/1 range).</p>
  
  <p>Main</p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      MainWindow w;
      w.setTitle("OpenGL");
      w.resize(500,500);
      w.show();
      return a.exec();
  }
  </code></pre>
  
  <p>Mainwindow.cpp </p>
  
  <pre><code>MainWindow::MainWindow(QWidget *parent)
  {
      setSurfaceType(QWindow::OpenGLSurface);
      QSurfaceFormat format;
      format.setProfile(QSurfaceFormat::CompatibilityProfile);
      format.setVersion(2,1);
  
      setFormat(format);
      context =new QOpenGLContext;
      context-&gt;setFormat(format);
      context-&gt;makeCurrent(this);
  
      openGLFuncions = context-&gt;functions();
  
  }
  void MainWindow::resizeGL(int w, int h)
  {
      glViewport(0,0,w,h);
      glMatrixMode(GL_PROJECTION);
      glLoadIdentity();
      glOrtho(0.0,w,h,0.0,-1.0,1.0);
      glMatrixMode(GL_MODELVIEW);
  }
  
  void MainWindow::paintGL()
  {
      glClearColor(0.0f,0.0f,0.0f,0.0f);
      glClear(GL_COLOR_BUFFER_BIT);
  
      glPointSize(10.0f);
      glBegin(GL_POINTS);
          glVertex2f(0.5f,0);
      glEnd();
  
      glFlush();
  }
  </code></pre>
  
  <p>MainWidow.h</p>
  
  <pre><code>class MainWindow : public QOpenGLWindow
  {
      Q_OBJECT
  public:
      MainWindow(QWidget *parent = 0);
      ~MainWindow();
      void updateAnim();
  protected:
      virtual void initilizeGL();
      virtual void resizeGL(int w, int h);
      virtual void paintGL();
      void resizeEvent(QResizeEvent *event);
      void paintEvent(QPaintEvent *event);
  private:
      QOpenGLContext *context;
      QOpenGLFunctions *openGLFuncions;
  };
  </code></pre>