Calling glBegin(); with the programmable renderer


I’m having trouble calling glBegin(); when using the programmable renderer in OF 0.8.4

When main.cpp contains

#include "ofMain.h"
#include "ofApp.h"
#include "ofGLProgrammableRenderer.h"

int main( ){
    // use the new renderer:
    ofSetupOpenGL(1024,768, OF_WINDOW);         // <-------- setup the GL context
    ofRunApp( new ofApp());

And I then call this for example in ofApp::draw() :

glColor3f( 1,1, 1);
glBegin( GL_LINE_STRIP);
glVertex2f( 0, 0);
glVertex2f( 1000, 2000);

nothing gets drawn. Calling ofLine(); works fine.
Anyone knows how to fix this?

glBegin is actually deprecated openGL code, so that may be why its not working the way you expect. Here is a tutorial on the way to do things now:

Heres another:

and heres an explanation:

Ok, so that’s no bug at all.