reference

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.
1#pragma once
2
4#include "ofRectangle.h"
5#include "ofConstants.h"
6#include "glm/fwd.hpp"
7
8class ofVec3f;
9class ofVec2f;
10
11template<typename T>
12class ofColor_;
13
17
18template<typename T>
19std::string ofToString(const T&);
20
22#define CIRC_RESOLUTION 22
24
27
39void ofSetColor(int r, int g, int b);
40
55void ofSetColor(int r, int g, int b, int a);
56void ofSetColor(const ofColor & color);
57void ofSetColor(const ofColor & color, int _a);
58void ofSetColor(int gray);
59
70void ofSetHexColor( int hexColor );
71
80void ofNoFill();
81
90void ofFill();
92
96
99OF_DEPRECATED_MSG("Use ofGetBackgroundColor instead",ofColor ofGetBackground());
100
101
115void ofBackground(int r, int g, int b, int a=255);
116void ofBackground(int brightness, int alpha = 255);
117void ofBackground(const ofColor & c);
118
125void ofBackgroundHex(int hexColor, int alpha = 255);
126
127
177void ofBackgroundGradient(const ofColor& start, const ofColor& end, ofGradientMode mode = OF_GRADIENT_CIRCULAR);
178
190void ofSetBackgroundColor(int r, int g, int b, int a=255);
191void ofSetBackgroundColor(int brightness, int alpha = 255);
192void ofSetBackgroundColor(const ofColor & c);
193
200void ofSetBackgroundColorHex(int hexColor, int alpha = 255);
201
217void ofSetBackgroundAuto(bool bManual); // default is true
219
254void ofClear(float r, float g, float b, float a=0);
255
265void ofClear(float brightness, float a=0);
266
277
278void ofClear(const ofColor & c);
279void ofClearAlpha();
280
281// OF's access to settings (bgAuto, origin, corner mode):
282OF_DEPRECATED_MSG("Use ofGetBackgroundAuto instead",bool ofbClearBg());
283
287
294void ofDrawTriangle(float x1,float y1,float x2,float y2,float x3, float y3);
295void ofDrawTriangle(float x1,float y1,float z1,float x2,float y2,float z2,float x3, float y3,float z3);
296void ofDrawTriangle(const glm::vec3 & p1, const glm::vec3 & p2, const glm::vec3 & p3);
297void ofDrawTriangle(const glm::vec2 & p1, const glm::vec2 & p2, const glm::vec2 & p3);
298
310void ofDrawCircle(float x, float y, float radius);
311void ofDrawCircle(float x, float y, float z, float radius);
312void ofDrawCircle(const glm::vec3 & p, float radius);
313void ofDrawCircle(const glm::vec2 & p, float radius);
314
321void ofDrawEllipse(float x, float y, float width, float height);
322void ofDrawEllipse(float x, float y, float z, float width, float height);
323void ofDrawEllipse(const glm::vec3 & p, float width, float height);
324void ofDrawEllipse(const glm::vec2 & p, float width, float height);
325
332void ofDrawLine(float x1,float y1,float x2,float y2);
333void ofDrawLine(float x1,float y1,float z1,float x2,float y2,float z2);
334void ofDrawLine(const glm::vec3 & p1, const glm::vec3 & p2);
335void ofDrawLine(const glm::vec2 & p1, const glm::vec2 & p2);
336
343void ofDrawRectangle(float x1,float y1,float w,float h);
344
345
358void ofDrawRectangle(const ofRectangle & r);
359
360
371void ofDrawRectangle(const glm::vec3 & p,float w,float h);
372void ofDrawRectangle(const glm::vec2 & p,float w,float h);
373
374
381void ofDrawRectangle(float x,float y,float z,float w,float h);
382
397void ofDrawRectRounded(const ofRectangle & b, float r);
398
409void ofDrawRectRounded(const glm::vec3 & p, float w, float h, float r);
410void ofDrawRectRounded(const glm::vec2 & p, float w, float h, float r);
411
412
421void ofDrawRectRounded(float x, float y, float w, float h, float r);
422
423
432void ofDrawRectRounded(float x, float y, float z, float w, float h, float r);
433
434
443void ofDrawRectRounded(const glm::vec3 & p, float w, float h, float topLeftRadius,
444 float topRightRadius,
445 float bottomRightRadius,
446 float bottomLeftRadius);
447void ofDrawRectRounded(const glm::vec2 & p, float w, float h, float topLeftRadius,
448 float topRightRadius,
449 float bottomRightRadius,
450 float bottomLeftRadius);
451
452
467void ofDrawRectRounded(const ofRectangle & b, float topLeftRadius,
468 float topRightRadius,
469 float bottomRightRadius,
470 float bottomLeftRadius);
471
480void ofDrawRectRounded(float x, float y, float z, float w, float h, float topLeftRadius,
481 float topRightRadius,
482 float bottomRightRadius,
483 float bottomLeftRadius);
484
487void ofDrawCurve(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3);
488
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);
494
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));
498
499OF_DEPRECATED_MSG("Use ofDrawCircle instead",void ofCircle(float x, float y, float radius));
500OF_DEPRECATED_MSG("Use ofDrawCircle instead",void ofCircle(float x, float y, float z, float radius));
501OF_DEPRECATED_MSG("Use ofDrawCircle instead",void ofCircle(const glm::vec3 & p, float radius));
502
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));
506
507OF_DEPRECATED_MSG("Use ofDrawLine instead",void ofLine(float x1,float y1,float x2,float y2));
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));
510
511OF_DEPRECATED_MSG("Use ofDrawRectangle instead",void ofRect(float x1,float y1,float w,float h));
512OF_DEPRECATED_MSG("Use ofDrawRectangle instead",void ofRect(const ofRectangle & r));
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));
515
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));
520
521//----------------------------------------------------------
522OF_DEPRECATED_MSG("Use ofDrawRectRounded instead",void ofRectRounded(const glm::vec3 & p, float w, float h, float topLeftRadius,
523 float topRightRadius,
524 float bottomRightRadius,
525 float bottomLeftRadius));
526
527OF_DEPRECATED_MSG("Use ofDrawRectRounded instead",void ofRectRounded(const ofRectangle & b, float topLeftRadius,
528 float topRightRadius,
529 float bottomRightRadius,
530 float bottomLeftRadius));
531
532OF_DEPRECATED_MSG("Use ofDrawRectRounded instead",void ofRectRounded(float x, float y, float z, float w, float h, float topLeftRadius,
533 float topRightRadius,
534 float bottomRightRadius,
535 float bottomLeftRadius));
536
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));
541
542
546
563void ofBeginShape();
564
567void ofVertex(float x, float y);
568void ofVertex(float x, float y, float z);
569void ofVertex(const glm::vec3 & p);
570void ofVertex(const glm::vec2 & p);
571void ofVertices(const std::vector <glm::vec3> & polyPoints);
572void ofVertices(const std::vector <glm::vec2> & polyPoints);
573void ofVertices(const std::vector <ofVec3f> & polyPoints);
574void ofVertices(const std::vector <ofVec2f> & polyPoints);
575
582void ofCurveVertex(float x, float y);
583void ofCurveVertex(float x, float y, float z);
584void ofCurveVertex(const glm::vec3 & p);
585void ofCurveVertex(const glm::vec2 & p);
586
589void ofCurveVertices(const std::vector <glm::vec3> & curvePoints);
590void ofCurveVertices(const std::vector <glm::vec2> & curvePoints);
591void ofCurveVertices(const std::vector <ofVec3f> & curvePoints);
592void ofCurveVertices(const std::vector <ofVec2f> & curvePoints);
593
596void ofBezierVertex(float x1, float y1, float x2, float y2, float x3, float y3);
597void ofBezierVertex(const glm::vec3 & p1, const glm::vec3 & p2, const glm::vec3 & p3);
598void ofBezierVertex(const glm::vec2 & p1, const glm::vec2 & p2, const glm::vec2 & p3);
599void ofBezierVertex(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3);
600
601
606
614void ofEndShape(bool bClose = false);
615
622void ofNextContour(bool bClose = false); // for multi contour shapes!
623
624
628
629
648
678template<typename T>
679void ofDrawBitmapString(const T & textString, float x, float y);
680template<typename T>
681void ofDrawBitmapString(const T & textString, const glm::vec3 & p);
682template<typename T>
683void ofDrawBitmapString(const T & textString, const glm::vec2 & p);
684template<typename T>
685void ofDrawBitmapString(const T & textString, float x, float y, float z);
686template<>
687void ofDrawBitmapString(const std::string & textString, const glm::vec3 & p);
688template<>
689void ofDrawBitmapString(const std::string & textString, const glm::vec2 & p);
690template<>
691void ofDrawBitmapString(const std::string & textString, float x, float y, float z);
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);
695
696
700
703
704void ofSetupScreen();
705
723
737void ofSetCircleResolution(int res); // if there 22 is a problem, you can change it here
738void ofSetCurveResolution(int res);
739
740
750void ofSetLineWidth(float lineWidth);
751
754void ofSetDepthTest(bool depthTest);
755
756
761void ofEnableDepthTest();
762
793void ofDisableDepthTest();
794
805void ofEnableBlendMode(ofBlendMode blendMode);
806
808void ofDisableBlendMode();
809
816
819
833void ofEnableAlphaBlending(); // this just turns on and off opengl blending, the common mode
834
848
849void ofEnableSmoothing();
850
854void ofDisableSmoothing();
855
858
861
862// drawing style - combines color, fill, blending and smoothing
864
870void ofSetStyle(ofStyle style);
871
890void ofPushStyle();
891
895void ofPopStyle();
896
907
923void ofSetRectMode(ofRectMode mode);
924
928
942void ofPushMatrix();
943
947void ofPopMatrix();
948
950glm::mat4 ofGetCurrentMatrix(ofMatrixMode matrixMode);
951
960
967glm::mat4 ofGetCurrentNormalMatrix();
968
980void ofTranslate(float x, float y, float z = 0);
981
982void ofTranslate(const glm::vec3 & p);
983void ofTranslate(const glm::vec2 & p);
984
985void ofScale(float xAmnt, float yAmnt, float zAmnt = 1);
986
988void ofScale(float amount);
989
990void ofScale(const glm::vec3 & p);
991
1007OF_DEPRECATED_MSG("Use ofRotateDeg or ofRotateRad", void ofRotate(float degrees, float vecX, float vecY, float vecZ));
1008
1010OF_DEPRECATED_MSG("Use ofRotateDeg or ofRotateRad", void ofRotate(float degrees));
1011
1021OF_DEPRECATED_MSG("Use ofRotateXDeg or ofRotateXRad", void ofRotateX(float degrees));
1022
1032OF_DEPRECATED_MSG("Use ofRotateYDeg or ofRotateYRad", void ofRotateY(float degrees));
1033
1043OF_DEPRECATED_MSG("Use ofRotateZDeg or ofRotateZRad", void ofRotateZ(float degrees));
1044
1060void ofRotateDeg(float degrees, float vecX, float vecY, float vecZ);
1061
1063void ofRotateDeg(float degrees);
1064
1074void ofRotateXDeg(float degrees);
1075
1085void ofRotateYDeg(float degrees);
1086
1096void ofRotateZDeg(float degrees);
1097
1113void ofRotateRad(float radians, float vecX, float vecY, float vecZ);
1114
1116void ofRotateRad(float radians);
1117
1127void ofRotateXRad(float radians);
1128
1138void ofRotateYRad(float radians);
1139
1149void ofRotateZRad(float radians);
1150
1154
1155void ofLoadIdentityMatrix (void);
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
1158void ofMultMatrix (const glm::mat4 & m); // mat objects when interacting with non-OF code
1159void ofMultMatrix (const float *m);
1160void ofSetMatrixMode(ofMatrixMode matrixMode);
1161void ofLoadViewMatrix(const glm::mat4 & m);
1162void ofMultViewMatrix(const glm::mat4 & m);
1163glm::mat4 ofGetCurrentViewMatrix();
1164
1165
1169
1171void ofPushView();
1172
1174void ofPopView();
1175
1177bool ofIsVFlipped();
1178
1183void ofViewport(ofRectangle viewport);
1184
1190void ofViewport(float x = 0, float y = 0, float width = -1, float height = -1, bool vflip=ofIsVFlipped());
1191
1195
1199
1202int ofGetViewportWidth();
1203
1207
1208
1209// if nearDist or farDist are 0 assume defaults (calculated based on width / height)
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);
1212
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)
1215 );
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)
1218 );
1219
1220int ofOrientationToDegrees(ofOrientation orientation);
1221
1222void ofSetCoordHandedness(ofHandednessType handedness);
1224
1225
1226//--------------------------------------------------
1227template<typename T>
1228void ofDrawBitmapString(const T & textString, const glm::vec3 & p){
1229 ofDrawBitmapString(ofToString(textString), p);
1230}
1231
1232//--------------------------------------------------
1233template<typename T>
1234void ofDrawBitmapString(const T & textString, const glm::vec2 & p){
1235 ofDrawBitmapString(ofToString(textString), p);
1236}
1237
1238//--------------------------------------------------
1239template<typename T>
1240void ofDrawBitmapString(const T & textString, float x, float y){
1241 ofDrawBitmapString(ofToString(textString), x, y, 0.f);
1242}
1243
1244//--------------------------------------------------
1245template<typename T>
1246void ofDrawBitmapString(const T & textString, float x, float y, float z){
1247 ofDrawBitmapString(ofToString(textString), x, y, z);
1248}
ofColor represents a color in openFrameworks.
Definition ofColor.h:20
static const ofColor_< PixelType > gray
Definition ofColor.h:594
static const ofColor_< unsigned char > white
Definition ofColor.h:594
PixelType g
The green color component.
Definition ofColor.h:90
PixelType r
The red color component.
Definition ofColor.h:89
static const ofColor_< unsigned char > black
Definition ofColor.h:594
A class representing a 2D rectangle.
Definition ofRectangle.h:87
Contains general information about the style of ofGraphics elements such as color,...
Definition ofGraphicsBaseTypes.h:51
ofVec2f is a class for storing a two dimensional vector.
Definition ofVec2f.h:72
ofVec3f is a class for storing a three dimensional vector.
Definition ofVec3f.h:79
unsigned int height
Definition ofAppEGLWindow.cpp:125
unsigned int width
Definition ofAppEGLWindow.cpp:124
#define OF_DEPRECATED_MSG(message,...)
Definition ofConstants.h:78
bool ofbClearBg()
Definition ofGraphics.cpp:347
void ofCurve(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
Definition ofGraphics.cpp:1009
void ofRotateY(float degrees)
Definition ofGraphics.cpp:207
void ofRect(const ofRectangle &r)
Definition ofGraphics.cpp:940
void ofLine(const glm::vec3 &p1, const glm::vec3 &p2)
Definition ofGraphics.cpp:925
void ofRotateZ(float degrees)
Definition ofGraphics.cpp:212
ofColor ofGetBackground()
Definition ofGraphics.cpp:352
void ofEllipse(const glm::vec3 &p, float width, float height)
Definition ofGraphics.cpp:910
void ofBezier(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
Definition ofGraphics.cpp:1020
void ofRotateX(float degrees)
Definition ofGraphics.cpp:202
void ofTriangle(const glm::vec3 &p1, const glm::vec3 &p2, const glm::vec3 &p3)
Definition ofGraphics.cpp:880
void ofCircle(const glm::vec3 &p, float radius)
Definition ofGraphics.cpp:895
void ofRectRounded(const ofRectangle &b, float r)
Definition ofGraphics.cpp:960
void ofRotate(float degrees)
Definition ofGraphics.cpp:192
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
bool ofIsVFlipped()
Get if view is flipped vertically.
Definition ofGraphics.cpp:86
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
bool ofGetBackgroundAuto()
Definition ofGraphics.cpp:342
void ofFill()
Draw shapes filled with the current draw color.
Definition ofGraphics.cpp:490
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
ofCloseShape
Definition ofGraphics.h:602
@ OF_OPEN
Definition ofGraphics.h:603
@ OF_CLOSE
Definition ofGraphics.h:604
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
glm::mat4 ofGetCurrentViewMatrix()
Definition ofGraphics.cpp:306
void ofClearAlpha()
Definition ofGraphics.cpp:333
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
ofHandednessType ofGetCoordHandedness()
Definition ofGraphics.cpp:96
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 ofSetHexColor(int hexColor)
Definition ofGraphics.cpp:560
void ofPushStyle()
Saves the current style settings for the ofGraphics after its call. Usage of ofPushStyle and ofPopSty...
Definition ofGraphics.cpp:645
void ofPopMatrix()
Restores the prior coordinate system.
Definition ofGraphics.cpp:130
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 ofMultMatrix(const glm::mat4 &m)
Definition ofGraphics.cpp:284
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 ofDrawLine(float x1, float y1, float x2, float y2)
Definition ofGraphics.cpp:736
ofColor_< unsigned char > ofColor
Definition ofGraphics.h:14
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 ofScale(float xAmnt, float yAmnt, float zAmnt=1)
Definition ofGraphics.cpp:177
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 ofEnableSmoothing()
Definition ofGraphics.cpp:603
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
ofFillFlag ofGetFill()
Definition ofGraphics.cpp:496
void ofViewport(ofRectangle viewport)
Setup the drawing viewport.
Definition ofGraphics.cpp:40
void ofLoadIdentityMatrix(void)
Definition ofGraphics.cpp:269
ofColor_< float > ofFloatColor
Definition ofGraphics.h:15
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 ofSetMatrixMode(ofMatrixMode matrixMode)
Definition ofGraphics.cpp:294
void ofMultViewMatrix(const glm::mat4 &m)
Definition ofGraphics.cpp:302
void ofSetCurveResolution(int res)
Definition ofGraphics.cpp:521
void ofEnablePointSprites()
Turn on point sprite.
Definition ofGraphics.cpp:574
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 ofLoadMatrix(const glm::mat4 &m)
Definition ofGraphics.cpp:274
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
ofColor_< unsigned short > ofShortColor
Definition ofGraphics.h:16
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
ofStyle ofGetStyle()
Definition ofGraphics.cpp:640
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
void ofLoadViewMatrix(const glm::mat4 &m)
Definition ofGraphics.cpp:298
int ofGetViewportWidth()
Get the width of the current viewport.
Definition ofGraphics.cpp:60
std::string ofToString(const T &)
Convert a value to a string.
Definition ofUtils.h:657
void ofSetupScreen()
Definition ofGraphics.cpp:117
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
ofFillFlag
Used to represent the available fill modes.
Definition ofGraphicsConstants.h:41
#define a
#define c
#define b
ofOrientation
Used to represent the available screen orientations.
Definition ofWindowSettings.h:25