This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.
ofGraphics.h
Go to the documentation of this file.
177void ofBackgroundGradient(const ofColor& start, const ofColor& end, ofGradientMode mode = OF_GRADIENT_CIRCULAR);
295void ofDrawTriangle(float x1,float y1,float z1,float x2,float y2,float z2,float x3, float y3,float z3);
487void ofDrawCurve(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3);
491void ofDrawCurve(float x0, float y0, float z0, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3);
492void ofDrawBezier(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3);
493void ofDrawBezier(float x0, float y0, float z0, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3);
495OF_DEPRECATED_MSG("Use ofDrawTriangle instead",void ofTriangle(float x1,float y1,float x2,float y2,float x3, float y3));
496OF_DEPRECATED_MSG("Use ofDrawTriangle instead",void ofTriangle(float x1,float y1,float z1,float x2,float y2,float z2,float x3, float y3,float z3));
497OF_DEPRECATED_MSG("Use ofDrawTriangle instead",void ofTriangle(const glm::vec3 & p1, const glm::vec3 & p2, const glm::vec3 & p3));
500OF_DEPRECATED_MSG("Use ofDrawCircle instead",void ofCircle(float x, float y, float z, float radius));
503OF_DEPRECATED_MSG("Use ofDrawEllipse instead",void ofEllipse(float x, float y, float width, float height));
504OF_DEPRECATED_MSG("Use ofDrawEllipse instead",void ofEllipse(float x, float y, float z, float width, float height));
505OF_DEPRECATED_MSG("Use ofDrawEllipse instead",void ofEllipse(const glm::vec3 & p, float width, float height));
508OF_DEPRECATED_MSG("Use ofDrawLine instead",void ofLine(float x1,float y1,float z1,float x2,float y2,float z2));
509OF_DEPRECATED_MSG("Use ofDrawLine instead",void ofLine(const glm::vec3 & p1, const glm::vec3 & p2));
513OF_DEPRECATED_MSG("Use ofDrawRectangle instead",void ofRect(const glm::vec3 & p,float w,float h));
514OF_DEPRECATED_MSG("Use ofDrawRectangle instead",void ofRect(float x,float y,float z,float w,float h));
516OF_DEPRECATED_MSG("Use ofDrawRectRounded instead",void ofRectRounded(const ofRectangle & b, float r));
517OF_DEPRECATED_MSG("Use ofDrawRectRounded instead",void ofRectRounded(const glm::vec3 & p, float w, float h, float r));
518OF_DEPRECATED_MSG("Use ofDrawRectRounded instead",void ofRectRounded(float x, float y, float w, float h, float r));
519OF_DEPRECATED_MSG("Use ofDrawRectRounded instead",void ofRectRounded(float x, float y, float z, float w, float h, float r));
522OF_DEPRECATED_MSG("Use ofDrawRectRounded instead",void ofRectRounded(const glm::vec3 & p, float w, float h, float topLeftRadius,
527OF_DEPRECATED_MSG("Use ofDrawRectRounded instead",void ofRectRounded(const ofRectangle & b, float topLeftRadius,
532OF_DEPRECATED_MSG("Use ofDrawRectRounded instead",void ofRectRounded(float x, float y, float z, float w, float h, float topLeftRadius,
537OF_DEPRECATED_MSG("Use ofDrawCurve instead",void ofCurve(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3));
538OF_DEPRECATED_MSG("Use ofDrawCurve instead",void ofCurve(float x0, float y0, float z0, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3));
539OF_DEPRECATED_MSG("Use ofDrawBezier instead",void ofBezier(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3));
540OF_DEPRECATED_MSG("Use ofDrawBezier instead",void ofBezier(float x0, float y0, float z0, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3));
599void ofBezierVertex(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3);
692void ofDrawBitmapStringHighlight(std::string text, const glm::vec3& position, const ofColor& background = ofColor::black, const ofColor& foreground = ofColor::white);
693void ofDrawBitmapStringHighlight(std::string text, const glm::vec2& position, const ofColor& background = ofColor::black, const ofColor& foreground = ofColor::white);
694void ofDrawBitmapStringHighlight(std::string text, int x, int y, const ofColor& background = ofColor::black, const ofColor& foreground = ofColor::white);
1007OF_DEPRECATED_MSG("Use ofRotateDeg or ofRotateRad", void ofRotate(float degrees, float vecX, float vecY, float vecZ));
1156void ofLoadMatrix (const glm::mat4 & m); // Andreas: I've included both a mat and a float* version here,
1157void ofLoadMatrix (const float *m); // ideally we would always use mat4, but in a lot of temporary
1190void ofViewport(float x = 0, float y = 0, float width = -1, float height = -1, bool vflip=ofIsVFlipped());
1210void ofSetupScreenPerspective(float width = -1, float height = -1, float fov = 60, float nearDist = 0, float farDist = 0);
1211void ofSetupScreenOrtho(float width = -1, float height = -1, float nearDist = -1, float farDist = 1);
1213OF_DEPRECATED_MSG("ofSetupScreenPerspective() doesn't accept orientation and vflip parameters anymore, use ofSetOrientation() to specify them",
1214 void ofSetupScreenPerspective(float width, float height, ofOrientation orientation, bool vFlip = ofIsVFlipped(), float fov = 60, float nearDist = 0, float farDist = 0)
1216OF_DEPRECATED_MSG("ofSetupScreenOrtho() doesn't accept orientation and vflip parameters anymore, use ofSetOrientation() to specify them",
1217 void ofSetupScreenOrtho(float width, float height, ofOrientation orientation, bool vFlip = ofIsVFlipped(), float nearDist = -1, float farDist = 1)
static const ofColor_< unsigned char > white
Definition ofColor.h:594
static const ofColor_< unsigned char > black
Definition ofColor.h:594
Contains general information about the style of ofGraphics elements such as color,...
Definition ofGraphicsBaseTypes.h:51
void ofCurve(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
Definition ofGraphics.cpp:1009
void ofBezier(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
Definition ofGraphics.cpp:1020
void ofTriangle(const glm::vec3 &p1, const glm::vec3 &p2, const glm::vec3 &p3)
Definition ofGraphics.cpp:880
void ofSetupScreenPerspective(float width=-1, float height=-1, float fov=60, float nearDist=0, float farDist=0)
Definition ofGraphics.cpp:101
void ofCurveVertices(const std::vector< glm::vec3 > &curvePoints)
Draws a curve through a series of vertices stored as a vector of ofPoints. Should be called between o...
void ofSetDepthTest(bool depthTest)
Set depth testing on or off to either sort by z-depth (true) or draw order (false).
Definition ofGraphics.cpp:506
void ofBeginShape()
Start drawing a new shape. Needs to be followed by a list of vertex points and lastly a call to ofEnd...
Definition ofGraphics.cpp:1030
void ofPushMatrix()
Saves the current coordinate system allowing users to develop specific movements in some graphic obje...
Definition ofGraphics.cpp:125
glm::mat4 ofGetCurrentNormalMatrix()
Query the current (oF internal) Normal Matrix state.
Definition ofGraphics.cpp:157
void ofNoFill()
Draw shapes as outlines with the current draw color.
Definition ofGraphics.cpp:485
void ofBackground(int r, int g, int b, int a=255)
Sets the background color.
Definition ofGraphics.cpp:377
void ofPopView()
Restores the viewport and matrix settings set by ofPushView()
Definition ofGraphics.cpp:35
void ofSetCircleResolution(int res)
Sets the resolution for the ofDrawCircle command. By default, the circle is 22 points,...
Definition ofGraphics.cpp:526
void ofDisablePointSprites()
Turn off point sprites.
Definition ofGraphics.cpp:581
void ofSetupGraphicDefaults()
Resets openGL screen coordinates and values back to OF defaults.
Definition ofGraphics.cpp:112
void ofDrawCurve(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
Draws a curve from point (x1, y1) to point (x2, y2). The curve is shaped by the two control points (x...
Definition ofGraphics.cpp:843
glm::mat4 ofGetCurrentOrientationMatrix()
Query the current (oF internal) Orientation Matrix state.
Definition ofGraphics.cpp:152
void ofRotateZDeg(float degrees)
Produces a rotation around the Z-axis of our coordinate system represented by the vector (0,...
Definition ofGraphics.cpp:238
void ofRotateDeg(float degrees, float vecX, float vecY, float vecZ)
Produces a rotation around the vector (vecX,vecY,vecZ).
Definition ofGraphics.cpp:223
void ofSetBackgroundAuto(bool bManual)
Sets the background clearing function to be auto (default) or not. If non- auto, then background clea...
Definition ofGraphics.cpp:338
void ofVertices(const std::vector< glm::vec3 > &polyPoints)
void ofRotateRad(float radians, float vecX, float vecY, float vecZ)
Produces a rotation around the vector (vecX,vecY,vecZ).
Definition ofGraphics.cpp:249
int ofOrientationToDegrees(ofOrientation orientation)
Definition ofGraphics.cpp:70
void ofEndShape(bool bClose=false)
This tells the program that your shape is finished and that it should now draw it to the screen.
Definition ofGraphics.cpp:1160
void ofDrawBitmapStringHighlight(std::string text, const glm::vec3 &position, const ofColor &background=ofColor::black, const ofColor &foreground=ofColor::white)
void ofVertex(float x, float y)
Specifies a single point of a shape. To be called between ofBeginShape() and ofEndShape().
Definition ofGraphics.cpp:1035
void ofPushView()
Stores the current viewport and matrix settings.
Definition ofGraphics.cpp:30
void ofSetColor(int r, int g, int b)
Sets the draw color with r,g,b, 0-255. For example, red would be: ofSetColor(255,0,...
Definition ofGraphics.cpp:541
void ofPushStyle()
Saves the current style settings for the ofGraphics after its call. Usage of ofPushStyle and ofPopSty...
Definition ofGraphics.cpp:645
void ofSetupScreenOrtho(float width=-1, float height=-1, float nearDist=-1, float farDist=1)
Definition ofGraphics.cpp:106
void ofBackgroundHex(int hexColor, int alpha=255)
Sets the background color using a hex color value.
Definition ofGraphics.cpp:372
void ofSetStyle(ofStyle style)
Set the current style of the ofGraphics.
Definition ofGraphics.cpp:635
void ofTranslate(float x, float y, float z=0)
Translate by (x,y,z) vector of our coordinate system. The call of ofTranslate() modifies graphics pos...
Definition ofGraphics.cpp:172
void ofRotateXRad(float radians)
Produces a rotation around the X-axis of our coordinate system represented by the vector (1,...
Definition ofGraphics.cpp:254
void ofRotateXDeg(float degrees)
Produces a rotation around the X-axis of our coordinate system represented by the vector (1,...
Definition ofGraphics.cpp:228
void ofDrawRectangle(float x1, float y1, float w, float h)
Draws a rectangle from point x,y with a given width and height.
Definition ofGraphics.cpp:761
void ofDrawEllipse(float x, float y, float width, float height)
Draws an ellipse from point (x,y) with a given width (w) and height (h).
Definition ofGraphics.cpp:716
void ofViewport(ofRectangle viewport)
Setup the drawing viewport.
Definition ofGraphics.cpp:40
ofRectangle ofGetCurrentViewport()
Get the position and size of the current viewport.
Definition ofGraphics.cpp:50
void ofEnableAlphaBlending()
Turns on alpha blending (which is on by default since OF version 0.8.0). It simply wraps opengl comma...
Definition ofGraphics.cpp:593
int ofGetViewportHeight()
Get the height of the current viewport.
Definition ofGraphics.cpp:65
ofColor ofGetBackgroundColor()
Returns the current background color as an ofColor.
Definition ofGraphics.cpp:357
void ofSetLineWidth(float lineWidth)
Sets the width of the ofDrawLine() called after.
Definition ofGraphics.cpp:501
void ofClear(float r, float g, float b, float a=0)
Clears the color and depth bits of current renderer and replaces it with an RGB color.
Definition ofGraphics.cpp:318
void ofSetRectMode(ofRectMode mode)
Sets the mode for drawing rectangles and other rectangular objects, if they are corner aligned,...
Definition ofGraphics.cpp:475
void ofDrawBitmapString(const T &textString, float x, float y)
Draws a bitmapped string, on screen, at point (x,y).
Definition ofGraphics.h:1240
glm::mat4 ofGetCurrentMatrix(ofMatrixMode matrixMode)
Query the current (oF internal) Transformation Matrix state.
Definition ofGraphics.cpp:147
void ofDisableDepthTest()
Turn off depth testing so rendering happens in draw order rather than by z-depth.
Definition ofGraphics.cpp:516
void ofDisableAlphaBlending()
Turn off alpha blending.
Definition ofGraphics.cpp:598
void ofSetDrawBitmapMode(ofDrawBitmapMode mode)
Set the bitmap drawing mode.
Definition ofGraphics.cpp:630
void ofSetPolyMode(ofPolyWindingMode mode)
Sets the drawing behavior for overlapping parts of the same polygon.
Definition ofGraphics.cpp:615
void ofDrawRectRounded(const ofRectangle &b, float r)
Draws a rounded rectangle from the given rectangle using given radius.
Definition ofGraphics.cpp:771
void ofDrawCircle(float x, float y, float radius)
Draws a circle, centered at x,y, with a given radius.
Definition ofGraphics.cpp:696
void ofEnableAntiAliasing()
Enables anti-aliasing (smoothing) for lines.
Definition ofGraphics.cpp:620
void ofNextContour(bool bClose=false)
Allows you to draw multiple contours within one shape. Call this between ofBeginShape() and ofEndShap...
Definition ofGraphics.cpp:1151
void ofSetBackgroundColorHex(int hexColor, int alpha=255)
Sets the background color using a hex color value.
Definition ofGraphics.cpp:451
ofRectangle ofGetNativeViewport()
Get the position and size of the native viewport.
Definition ofGraphics.cpp:55
void ofRotateYRad(float radians)
Produces a rotation around the Y-axis of our coordinate system represented by the vector (0,...
Definition ofGraphics.cpp:259
void ofCurveVertex(float x, float y)
Specifies a single point of a shape. The difference from ofVertex is that the line describing the edg...
Definition ofGraphics.cpp:1083
void ofDisableBlendMode()
Disable the current blend mode.
Definition ofGraphics.cpp:588
void ofDrawBezier(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
Definition ofGraphics.cpp:864
ofRectMode ofGetRectMode()
Tells you if rectangle drawing mode is set to drawn from the center or drawn from the top left corner...
Definition ofGraphics.cpp:480
void ofEnableDepthTest()
Turns on depth testing so rendering happens according to z-depth rather than draw order.
Definition ofGraphics.cpp:511
void ofEnableBlendMode(ofBlendMode blendMode)
Sets and enables the blend mode for drawing. The options are:
Definition ofGraphics.cpp:569
void ofRotateZRad(float radians)
Produces a rotation around the Z-axis of our coordinate system represented by the vector (0,...
Definition ofGraphics.cpp:264
void ofSetCoordHandedness(ofHandednessType handedness)
Definition ofGraphics.cpp:91
void ofRotateYDeg(float degrees)
Produces a rotation around the Y-axis of our coordinate system represented by the vector (0,...
Definition ofGraphics.cpp:233
void ofBezierVertex(float x1, float y1, float x2, float y2, float x3, float y3)
Describes a bezier curve through three points of a shape. To be called between ofBeginShape() and ofE...
Definition ofGraphics.cpp:1131
void ofDrawTriangle(float x1, float y1, float x2, float y2, float x3, float y3)
Draws a triangle, with the three points: (x1,y1),(x2, y2),(x3, y3).
Definition ofGraphics.cpp:676
void ofDisableSmoothing()
Turn off smoothing. Currently, this only works for lines. You can draw a filled object,...
Definition ofGraphics.cpp:610
void ofBackgroundGradient(const ofColor &start, const ofColor &end, ofGradientMode mode=OF_GRADIENT_CIRCULAR)
Sets the background color to a gradient.
Definition ofGraphics.cpp:382
void ofDisableAntiAliasing()
Turns off anti-aliasing (smoothing).
Definition ofGraphics.cpp:625
void ofSetBackgroundColor(int r, int g, int b, int a=255)
Sets the background color. It takes as input r,g,b (0-255). The background is cleared automatically,...
Definition ofGraphics.cpp:456
void ofPopStyle()
Restores the prior style settings. It needs to be called after ofPushStyle.
Definition ofGraphics.cpp:650
int ofGetViewportWidth()
Get the width of the current viewport.
Definition ofGraphics.cpp:60
ofDrawBitmapMode
Sets the bitmap drawing mode for text.
Definition ofGraphicsConstants.h:125
ofMatrixMode
represents the available matrix types used internally in ofMatrixStack.
Definition ofGraphicsConstants.h:119
ofHandednessType
represents the available matrix coordinate system handednesses.
Definition ofGraphicsConstants.h:116
ofGradientMode
Represents the gradient types available to ofBackgroundGradient().
Definition ofGraphicsConstants.h:74
@ OF_GRADIENT_CIRCULAR
Represents a circular gradient beginning at the screen's center.
Definition ofGraphicsConstants.h:78
ofRectMode
Used to represent the available rectangle drawing modes.
Definition ofGraphicsConstants.h:139
ofBlendMode
Used to represent the available blending modes for drawing.
Definition ofGraphicsConstants.h:57
ofPolyWindingMode
represents the available polygon winding modes.
Definition ofGraphicsConstants.h:97
#define a
#define c
#define b
ofOrientation
Used to represent the available screen orientations.
Definition ofWindowSettings.h:25