ofGLRenderer
The ofGLRenderer is a renderer for OF that supports OpenGL 2 and lower. It's the more classic, "direct mode" version of OpenGL that you may be familiar with but that also uses vertex arrays underneath to store all of the vertices that you create for the basic OF drawing operations. This is the default renderer that is created when you create your OF app:
ofSetupOpenGL(1024,768, OF_WINDOW); // by default this makes a ofGLRenderer
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
ofRunApp( new testApp());
This renderer does not work so well with mobile devices (more specifically with GLES) or on ARM6/7 Linux devices (Raspberry Pi, for instance) but it is the classic version that will be supported on all laptops and desktop machines. Most of the calls to this renderer are handled by other functions, so most of this documentation will simply link to the end user functions that you should call, since you probably don't want to call the renderer directly.
background( ... )
void background(float brightness)begin( ... )
void begin(const ofFbo &fbo, ofFboMode mode)bind( ... )
void bind(const ofCamera &camera, const ofRectangle &viewport)bind( ... )
void bind(const ofFbo &fbo)bind( ... )
void bind(const ofBaseMaterial &material)bind( ... )
void bind(const ofShader &shader)bind( ... )
void bind(const ofTexture &texture, int location)bind( ... )
void bind(const ofBaseVideoDraws &video)bindForBlitting( ... )
void bindForBlitting(const ofFbo &fboSrc, ofFbo &fboDst, int attachmentPoint)clear( )
void clear()disableAlphaMask( )
void disableAlphaMask()disableLight( ... )
void disableLight(int lightIndex)disableLighting( )
void disableLighting()disablePointSprites( )
void disablePointSprites()disableSeparateSpecularLight( )
void disableSeparateSpecularLight()disableTextureTarget( ... )
void disableTextureTarget(int textureTarget, int textureLocation)draw( ... )
void draw(const ofImage &image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh)Draws an texture.
draw( ... )
void draw(const ofFloatImage &image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh)Draws an texture.
draw( ... )
void draw(const ofShortImage &image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh)Draws an ofMesh.
draw( ... )
void draw(const ofTexture &image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh)draw( ... )
void draw(const ofVboMesh &mesh, ofPolyRenderMode renderType)draw( ... )
void draw(const ofNode &model)Draws an texture.
draw( ... )
void draw(const of3dPrimitive &model, ofPolyRenderMode renderType)Draws a of3dPrimitive. Called internally.
draw( ... )
void draw(const ofPath &path)Handles drawing ofPath. This is called when you call ofPath::draw().
draw( ... )
void draw(const ofPolyline &poly)Draws an ofMesh.
draw( ... )
void draw(const ofVbo &vbo, GLuint drawMode, int first, int total)draw( ... )
void draw(const ofMesh &vertexData, ofPolyRenderMode renderType, bool useColors, bool useTextures, bool useNormals)Handles drawing ofPolylines. This is called when you call line.draw().
draw( ... )
void draw(const ofBaseVideoDraws &video, float x, float y, float w, float h)drawElements( ... )
void drawElements(const ofVbo &vbo, GLuint drawMode, int amt, int offsetelements=0)drawElementsInstanced( ... )
void drawElementsInstanced(const ofVbo &vbo, GLuint drawMode, int amt, int primCount)drawEllipse( ... )
void drawEllipse(float x, float y, float z, float width, float height)See ofDrawEllipse
drawInstanced( ... )
void drawInstanced(const ofVboMesh &mesh, ofPolyRenderMode renderType, int primCount)drawInstanced( ... )
void drawInstanced(const ofVbo &vbo, GLuint drawMode, int first, int total, int primCount)drawString( ... )
void drawString(const ofTrueTypeFont &font, string text, float x, float y)drawString( ... )
void drawString(string text, float x, float y, float z)Draws a characters to the screen.
drawTriangle( ... )
void drawTriangle(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3)Draw a Triangle.
enableLight( ... )
void enableLight(int lightIndex)enableLighting( )
void enableLighting()enablePointSprites( )
void enablePointSprites()enableSeparateSpecularLight( )
void enableSeparateSpecularLight()enableTextureTarget( ... )
void enableTextureTarget(const ofTexture &tex, int textureLocation)end( ... )
void end(const ofFbo &fbo)endSmoothing( )
void endSmoothing()finishRender( )
void finishRender()get3dGraphics( )
const of3dGraphics & get3dGraphics()get3dGraphics( )
of3dGraphics & get3dGraphics()getBackgroundAuto( )
bool getBackgroundAuto()getBackgroundColor( )
ofColor getBackgroundColor()getCurrentMatrix( ... )
glm::mat4 getCurrentMatrix(ofMatrixMode matrixMode_)getCurrentNormalMatrix( )
glm::mat4 getCurrentNormalMatrix()getCurrentOrientationMatrix( )
glm::mat4 getCurrentOrientationMatrix()getCurrentViewMatrix( )
glm::mat4 getCurrentViewMatrix()getGLVersionMajor( )
int getGLVersionMajor()getGLVersionMinor( )
int getGLVersionMinor()getLightingEnabled( )
bool getLightingEnabled()getPath( )
ofPath & getPath()getStyle( )
ofStyle getStyle()getType( )
const string & getType()loadViewMatrix( ... )
void loadViewMatrix(const glm::mat4 &m)matrixMode( ... )
void matrixMode(ofMatrixMode mode)multMatrix( ... )
void multMatrix(const glm::mat4 &m)multMatrix( ... )
void multMatrix(const float *m)multViewMatrix( ... )
void multViewMatrix(const glm::mat4 &m)ofGLRenderer( ... )
ofGLRenderer(const ofAppBaseWindow *window)popStyle( )
void popStyle()popView( )
void popView()pushStyle( )
void pushStyle()pushView( )
void pushView()rotateDeg( ... )
void rotateDeg(float radians)rotateDeg( ... )
void rotateDeg(float radians, float vecX, float vecY, float vecZ)rotateRad( ... )
void rotateRad(float radians)rotateRad( ... )
void rotateRad(float radians, float vecX, float vecY, float vecZ)rotateXDeg( ... )
void rotateXDeg(float radians)rotateXRad( ... )
void rotateXRad(float radians)rotateYDeg( ... )
void rotateYDeg(float radians)rotateYRad( ... )
void rotateYRad(float radians)rotateZDeg( ... )
void rotateZDeg(float radians)rotateZRad( ... )
void rotateZRad(float radians)saveFullViewport( ... )
void saveFullViewport(ofPixels &pixels)saveScreen( ... )
void saveScreen(int x, int y, int w, int h, ofPixels &pixels)setAlphaMaskTex( ... )
void setAlphaMaskTex(const ofTexture &tex)setBackgroundAuto( ... )
void setBackgroundAuto(bool bManual)setBackgroundColor( ... )
void setBackgroundColor(const ofColor &c)setBitmapTextMode( ... )
void setBitmapTextMode(ofDrawBitmapMode mode)setCoordHandedness( ... )
void setCoordHandedness(ofHandednessType handedness)setCurveResolution( ... )
void setCurveResolution(int resolution)setFillMode( ... )
void setFillMode(ofFillFlag fill)setGlobalAmbientColor( ... )
void setGlobalAmbientColor(const ofColor &c)setLightAmbientColor( ... )
void setLightAmbientColor(int lightIndex, const ofFloatColor &c)setLightAttenuation( ... )
void setLightAttenuation(int lightIndex, float constant, float linear, float quadratic)setLightDiffuseColor( ... )
void setLightDiffuseColor(int lightIndex, const ofFloatColor &c)setLightPosition( ... )
void setLightPosition(int lightIndex, const glm::vec4 &position)setLightSpecularColor( ... )
void setLightSpecularColor(int lightIndex, const ofFloatColor &c)setLightSpotConcentration( ... )
void setLightSpotConcentration(int lightIndex, float exponent)setLightSpotDirection( ... )
void setLightSpotDirection(int lightIndex, const glm::vec4 &direction)setLightSpotlightCutOff( ... )
void setLightSpotlightCutOff(int lightIndex, float spotCutOff)setLineSmoothing( ... )
void setLineSmoothing(bool smooth)setOrientation( ... )
void setOrientation(ofOrientation orientation, bool vFlip)setPolyMode( ... )
void setPolyMode(ofPolyWindingMode mode)setSmoothLighting( ... )
void setSmoothLighting(bool b)setStyle( ... )
void setStyle(const ofStyle &style)setup( )
void setup()setupGraphicDefaults( )
void setupGraphicDefaults()setupScreenOrtho( ... )
void setupScreenOrtho(float width, float height, float nearDist, float farDist)setupScreenPerspective( ... )
void setupScreenPerspective(float width, float height, float fov, float nearDist, float farDist)startRender( )
void startRender()startSmoothing( )
void startSmoothing()texturesNeedVFlip( )
bool texturesNeedVFlip()unbind( ... )
void unbind(const ofCamera &camera)unbind( ... )
void unbind(const ofFbo &fbo)unbind( ... )
void unbind(const ofBaseMaterial &material)unbind( ... )
void unbind(const ofShader &shader)unbind( ... )
void unbind(const ofTexture &texture, int location)unbind( ... )
void unbind(const ofBaseVideoDraws &video)viewport( ... )
void viewport(ofRectangle viewport)viewport( ... )
void viewport(float x, float y, float width, float height, bool vflip=true)~ofGLRenderer( )
~ofGLRenderer()