reference

This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.

ofGraphicsBaseTypes.h
Go to the documentation of this file.
1#pragma once
2
4#include "ofConstants.h"
5#include "glm/fwd.hpp"
6#include "ofColor.h"
7
8class ofRectangle;
9class ofPath;
10class of3dPrimitive;
11class ofLight;
12class ofMaterial;
13class ofBaseMaterial;
14class ofCamera;
15class ofTrueTypeFont;
16class ofNode;
17class of3dGraphics;
18class ofVbo;
19class ofVboMesh;
20class ofSoundBuffer;
21class ofFbo;
23
24template<typename T>
25class ofPixels_;
30
31template<typename T>
32class ofImage_;
36
37template<class T>
38class ofPolyline_;
40
41template<class V, class N, class C, class T>
42class ofMesh_;
44
45enum ofFboMode: short;
46enum ofLoopType: short;
47enum ofOrientation: short;
48
51class ofStyle{
52 public:
55 bFill = true;
57 smoothing = false;
60 curveResolution = 20;
61 lineWidth = 1.0;
64 #ifdef TARGET_OPENGLES
66 #else
68 #endif
69 bgColor.set(60, 60, 60);
70 //depthTest = false;
71 }
72
74 virtual ~ofStyle(){}
75
80
83
91
101
106 bool bFill;
107
112
115
118
119 // \brief The resolution of rendered circles and arcs (e.g. ofCircle).
121
122 // \brief The resolution of rendered spheres (e.g. ofSphere).
124
125 // \brief The resolution of rendered curves.
127
131
132 //bool depthTest; removed since it'll break old projects setting depth test through glEnable
133};
134
135//----------------------------------------------------------
136// ofBaseDraws
137//----------------------------------------------------------
138
140public:
142 virtual ~ofBaseDraws(){}
143
150 virtual void draw(float x, float y) const {
151 draw(x, y, getWidth(), getHeight());
152 }
153
160 virtual void draw(float x, float y, float w, float h) const = 0;
161
167 virtual void draw(const glm::vec2 & point) const;
168
172 virtual void draw(const ofRectangle & rect) const;
173
179 virtual void draw(const glm::vec2 & point, float w, float h) const;
180
183 virtual float getHeight() const = 0;
184
187 virtual float getWidth() const = 0;
188
196 virtual void setAnchorPercent(float xPct, float yPct){};
197
205 virtual void setAnchorPoint(float x, float y){};
206
208 virtual void resetAnchor(){};
209
210};
211
214public:
216 virtual ~ofBaseUpdates(){}
217
219 virtual void update()=0;
220};
221
245public:
248};
249
250
253template<typename T>
255public:
258
261 virtual ofPixels_<T> & getPixels()=0;
262
265 virtual const ofPixels_<T> & getPixels() const=0;
266};
267
270
273
276
277
280public:
281 virtual ~ofBaseRenderer(){}
282
289 virtual const std::string & getType()=0;
290
292 virtual void startRender() = 0;
294 virtual void finishRender() = 0;
295
298 virtual void draw(const ofPolyline & poly) const=0;
301 virtual void draw(const ofPath & shape) const=0;
306 virtual void draw(const ofPath & shape, float x, float y) const{
307 const_cast<ofBaseRenderer*>(this)->pushMatrix();
308 const_cast<ofBaseRenderer*>(this)->translate(x,y);
309 draw(shape);
310 const_cast<ofBaseRenderer*>(this)->popMatrix();
311 }
323 virtual void draw(const ofMesh & mesh, ofPolyRenderMode renderType) const;
324
341 virtual void draw(const ofMesh & vertexData, ofPolyRenderMode renderType, bool useColors, bool useTextures, bool useNormals) const=0;
342
354 virtual void draw(const of3dPrimitive& model, ofPolyRenderMode renderType) const=0;
355
359 virtual void draw(const ofNode& model) const=0;
360
373 virtual void draw(const ofImage & image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const=0;
374
386 virtual void draw(const ofFloatImage & image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const=0;
387
399 virtual void draw(const ofShortImage & image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const=0;
400
407 virtual void draw(const ofBaseVideoDraws & video, float x, float y, float w, float h) const=0;
408
409 //--------------------------------------------
410 // transformations
418 virtual void pushView()=0;
419
426 virtual void popView()=0;
427
434
443 virtual void viewport(float x = 0, float y = 0, float width = -1, float height = -1, bool vflip=true)=0;
444
459 virtual void setupScreenPerspective(float width = -1, float height = -1, float fov = 60, float nearDist = 0, float farDist = 0)=0;
460
472 virtual void setupScreenOrtho(float width = -1, float height = -1, float nearDist = -1, float farDist = 1)=0;
473
486 virtual void setOrientation(ofOrientation orientation, bool vFlip)=0;
487
496
505
508 virtual int getViewportWidth() const=0;
509
512 virtual int getViewportHeight() const=0;
513
517 virtual bool isVFlipped() const=0;
518
531 virtual void setCoordHandedness(ofHandednessType handedness)=0;
532
546
547 //our openGL wrappers
548
555 virtual void pushMatrix()=0;
561 virtual void popMatrix()=0;
562
573 virtual glm::mat4 getCurrentMatrix(ofMatrixMode matrixMode_) const=0;
574
577 virtual glm::mat4 getCurrentOrientationMatrix() const=0;
578
586 virtual void translate(float x, float y, float z = 0)=0;
587
590 virtual void translate(const glm::vec3 & p)=0;
591
599 virtual void scale(float xAmnt, float yAmnt, float zAmnt = 1)=0;
600
606 virtual void rotateDeg(float degrees, float vecX, float vecY, float vecZ);
607
611 virtual void rotateXDeg(float degrees);
612
616 virtual void rotateYDeg(float degrees);
617
621 virtual void rotateZDeg(float degrees);
622
630 virtual void rotateDeg(float degrees);
631
637 virtual void rotateRad(float degrees, float vecX, float vecY, float vecZ)=0;
638
642 virtual void rotateXRad(float degrees)=0;
643
647 virtual void rotateYRad(float degrees)=0;
648
652 virtual void rotateZRad(float degrees)=0;
653
661 virtual void rotateRad(float degrees)=0;
662
671 virtual void matrixMode(ofMatrixMode mode)=0;
672
686 virtual void loadIdentityMatrix (void)=0;
687
690 virtual void loadMatrix (const glm::mat4 & m)=0;
691
697 virtual void loadMatrix (const float *m)=0;
698
701 virtual void multMatrix (const glm::mat4 & m)=0;
702
709 virtual void multMatrix (const float *m)=0;
710
713 virtual void loadViewMatrix(const glm::mat4 & m)=0;
714
717 virtual void multViewMatrix(const glm::mat4 & m)=0;
718
721 virtual glm::mat4 getCurrentViewMatrix() const=0;
722
725 virtual glm::mat4 getCurrentNormalMatrix() const=0;
726
727
737 virtual void bind(const ofCamera & camera, const ofRectangle & viewport)=0;
740 virtual void unbind(const ofCamera & camera)=0;
741
742
744 virtual void setupGraphicDefaults()=0;
746 virtual void setupScreen()=0;
747
748 // drawing modes
755 virtual void setRectMode(ofRectMode mode)=0;
769 virtual void setFillMode(ofFillFlag fill)=0;
779 virtual void setLineWidth(float lineWidth)=0;
788 virtual void setDepthTest(bool depthTest)=0;
809 virtual void setBlendMode(ofBlendMode blendMode)=0;
813 virtual void setLineSmoothing(bool smooth)=0;
818 virtual void setCircleResolution(int res)=0;
820 virtual void enableAntiAliasing()=0;
822 virtual void disableAntiAliasing()=0;
823
832 virtual void setColor(int r, int g, int b)=0;
842 virtual void setColor(int r, int g, int b, int a)=0;
849 virtual void setColor(const ofColor & color)=0;
857 virtual void setColor(const ofColor & color, int _a)=0;
864 virtual void setColor(int gray)=0;
872 virtual void setHexColor( int hexColor )=0;
873
886
892 virtual void setBackgroundColor(const ofColor & c)=0;
893
901 virtual void background(const ofColor & c)=0;
910 virtual void background(float brightness)=0;
921 virtual void background(int hexColor, float _a=255.0f)=0;
928 virtual void background(int r, int g, int b, int a=255)=0;
929
932 virtual void setBackgroundAuto(bool bManual)=0;
936 virtual bool getBackgroundAuto()=0;
937
942 virtual void clear()=0;
954 virtual void clear(float r, float g, float b, float a=0)=0;
963 virtual void clear(float brightness, float a=0)=0;
965 virtual void clearAlpha()=0;
966
974 virtual void drawLine(float x1, float y1, float z1, float x2, float y2, float z2) const=0;
982 virtual void drawRectangle(float x, float y, float z, float w, float h) const=0;
993 virtual void drawTriangle(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) const=0;
999 virtual void drawCircle(float x, float y, float z, float radius) const=0;
1006 virtual void drawEllipse(float x, float y, float z, float width, float height) const=0;
1022 virtual void drawString(std::string text, float x, float y, float z) const=0;
1028 virtual void drawString(const ofTrueTypeFont & font, std::string text, float x, float y) const=0;
1029
1030
1031 // returns true an ofPath to draw with, this allows to keep
1032 // immediate mode rendering working in multiwindow with multiple
1033 // contexts without reimplementing the logic on every renderer
1036 virtual ofPath & getPath()=0;
1037
1040 virtual ofStyle getStyle() const=0;
1043 virtual void setStyle(const ofStyle & style) = 0;
1049 virtual void pushStyle()=0;
1054 virtual void popStyle()=0;
1055
1059 virtual void setCurveResolution(int resolution)=0;
1060
1072 virtual void setPolyMode(ofPolyWindingMode mode)=0;
1073
1076 virtual const of3dGraphics & get3dGraphics() const=0;
1080
1081
1087 virtual void setPlaneResolution( int columns, int rows );
1095 virtual glm::vec2 getPlaneResolution() const;
1108 virtual void drawPlane(float x, float y, float width, float height) const;
1123 virtual void drawPlane(float x, float y, float z, float width, float height) const;
1134 virtual void drawPlane(const glm::vec3& position, float width, float height) const;
1144 virtual void drawPlane( float width, float height ) const;
1145
1150 virtual void setSphereResolution(int res);
1153 virtual int getSphereResolution() const;
1162 virtual void drawSphere(float x, float y, float radius) const;
1172 virtual void drawSphere(float x, float y, float z, float radius) const;
1181 virtual void drawSphere(const glm::vec3& position, float radius) const;
1186 virtual void drawSphere(float radius) const;
1187
1188 // Ico Sphere
1192 virtual void setIcoSphereResolution( int res );
1195 virtual int getIcoSphereResolution() const;
1205 virtual void drawIcoSphere(float x, float y, float z, float radius) const;
1214 virtual void drawIcoSphere(float x, float y, float radius) const;
1222 virtual void drawIcoSphere(const glm::vec3& position, float radius) const;
1226 virtual void drawIcoSphere(float radius) const;
1227
1236 virtual void setCylinderResolution( int radiusSegments, int heightSegments, int capSegments=2 );
1245 virtual glm::vec3 getCylinderResolution() const;
1258 virtual void drawCylinder(float x, float y, float radius, float height) const;
1272 virtual void drawCylinder(float x, float y, float z, float radius, float height) const;
1286 virtual void drawCylinder(const glm::vec3& position, float radius, float height) const;
1296 virtual void drawCylinder(float radius, float height) const;
1297
1309 virtual void setConeResolution( int radiusSegments, int heightSegments, int capSegments=2);
1310
1319 virtual glm::vec3 getConeResolution() const;
1320
1334 virtual void drawCone(float x, float y, float z, float radius, float height) const;
1347 virtual void drawCone(float x, float y, float radius, float height) const;
1359 virtual void drawCone(const glm::vec3& position, float radius, float height) const;
1369 virtual void drawCone(float radius, float height) const;
1370
1371 // Box
1374 virtual void setBoxResolution( int res );
1382 virtual void setBoxResolution( int resWidth, int resHeight, int resDepth );
1390 virtual glm::vec3 getBoxResolution() const;
1391
1406 virtual void drawBox( float x, float y, float z, float width, float height, float depth) const;
1407
1425 virtual void drawBox(float x, float y, float z, float size) const;
1426
1439 virtual void drawBox(const glm::vec3& position, float width, float height, float depth) const;
1440
1452 virtual void drawBox(const glm::vec3& position, float size) const;
1453
1460 virtual void drawBox(float size) const;
1461
1473 virtual void drawBox( float width, float height, float depth ) const;
1481 virtual void drawAxis(float size) const;
1490 virtual void drawGrid(float stepSize, size_t numberOfSteps, bool labels, bool x, bool y, bool z) const;
1495 virtual void drawGridPlane(float stepSize, size_t numberOfSteps, bool labels) const;
1500 virtual void drawArrow(const glm::vec3& start, const glm::vec3& end, float headSize) const;
1510 virtual void drawRotationAxes(float radius, float stripWidth, int circleRes) const;
1511};
Definition of3dGraphics.h:445
A class representing a 3d primitive.
Definition of3dPrimitives.h:12
An abstract class representing an object that has pixels.
Definition ofGraphicsBaseTypes.h:244
virtual ~ofAbstractHasPixels()
Destroy the ofAbstractHasPixels.
Definition ofGraphicsBaseTypes.h:247
Definition ofGraphicsBaseTypes.h:139
virtual float getWidth() const =0
Get the width.
virtual void setAnchorPercent(float xPct, float yPct)
Set the anchor point the item is drawn around as a percentage.
Definition ofGraphicsBaseTypes.h:196
virtual void draw(float x, float y) const
Draw at a position at the native size.
Definition ofGraphicsBaseTypes.h:150
virtual void draw(float x, float y, float w, float h) const =0
Draw at a position with the specified size.
virtual float getHeight() const =0
Get the height.
virtual void resetAnchor()
Reset the anchor point to (0, 0).
Definition ofGraphicsBaseTypes.h:208
virtual void setAnchorPoint(float x, float y)
Set the anchor point the item is drawn around in pixels.
Definition ofGraphicsBaseTypes.h:205
virtual ~ofBaseDraws()
Destroy the abstract object.
Definition ofGraphicsBaseTypes.h:142
A base class represeting an object that has pixels.
Definition ofGraphicsBaseTypes.h:254
virtual const ofPixels_< T > & getPixels() const =0
Get a const reference to the underlying ofPixels.
virtual ~ofBaseHasPixels_()
Destroy the ofAbstractHasPixels.
Definition ofGraphicsBaseTypes.h:257
virtual ofPixels_< T > & getPixels()=0
Get a reference to the underlying ofPixels.
material parameter properties that can be applied to vertices in the OpenGL lighting model used in de...
Definition ofMaterialBaseTypes.h:41
The base renderer interface.
Definition ofGraphicsBaseTypes.h:279
virtual void drawCylinder(float x, float y, float radius, float height) const
Draw a cylinder with this renderer using x, y, radius, and height.
Definition ofBaseTypes.cpp:232
virtual void setColor(int r, int g, int b, int a)=0
Set the global color this renderer will use when drawing.
virtual void draw(const of3dPrimitive &model, ofPolyRenderMode renderType) const =0
Draw a model with this renderer using the renderType.
virtual void setHexColor(int hexColor)=0
Set the global color this renderer will use when drawing.
virtual const of3dGraphics & get3dGraphics() const =0
Get a const reference of this renderer's 3D graphics object.
virtual ofRectMode getRectMode()=0
Get this renderer's current rect mode.
virtual void setBlendMode(ofBlendMode blendMode)=0
Set this renderer's current blend mode.
virtual void scale(float xAmnt, float yAmnt, float zAmnt=1)=0
Scale this renderer's current matrix by xAmnt, yAmnt, and zAmnt.
virtual glm::vec3 getConeResolution() const
Get this renderer's cone resolution as a 3D vector.
Definition ofBaseTypes.cpp:252
virtual void multMatrix(const float *m)=0
Multiply this renderer's current matrix by m.
virtual void background(const ofColor &c)=0
Immediately paint a background color to the screen.
virtual void setFillMode(ofFillFlag fill)=0
set this renderer's fill flag.
virtual ~ofBaseRenderer()
Definition ofGraphicsBaseTypes.h:281
virtual void draw(const ofBaseVideoDraws &video, float x, float y, float w, float h) const =0
Draw a video with this renderer.
virtual void drawLine(float x1, float y1, float z1, float x2, float y2, float z2) const =0
Draw a line between two 3D points.
virtual void viewport(float x=0, float y=0, float width=-1, float height=-1, bool vflip=true)=0
Set this renderer's viewport manually using x, y, width, and height.
virtual void drawPlane(float x, float y, float width, float height) const
Draw a plane with the renderer using x, y, width, and height.
Definition ofBaseTypes.cpp:160
virtual void rotateXDeg(float degrees)
Rotate this renderer's current matrix by degrees about the x axis.
Definition ofGraphicsBaseTypes.cpp:26
virtual void draw(const ofPolyline &poly) const =0
Draw a polyline with this renderer.
virtual void setIcoSphereResolution(int res)
Set the point resolution to use when drawing an icosphere with this renderer.
Definition ofBaseTypes.cpp:200
virtual void setupScreenOrtho(float width=-1, float height=-1, float nearDist=-1, float farDist=1)=0
Setup the renderer to use an orthographic matrix.
virtual void rotateXRad(float degrees)=0
Rotate this renderer's current matrix by degrees about the x axis.
virtual void drawString(std::string text, float x, float y, float z) const =0
Draw text with this renderer using the current bitmap text mode.
virtual void setStyle(const ofStyle &style)=0
Set this renderer's current style object.
virtual void setCircleResolution(int res)=0
Set the resolution to use when drawing ellipses with this renderer.
virtual void translate(const glm::vec3 &p)=0
Translate this renderer's current matrix by a point.
virtual void clear(float brightness, float a=0)=0
Clear this renderer's color and bit depths replacing them.
virtual void draw(const ofMesh &vertexData, ofPolyRenderMode renderType, bool useColors, bool useTextures, bool useNormals) const =0
Draw a mesh with this renderer.
virtual int getIcoSphereResolution() const
Get this renderer's current icosphere resolution.
Definition ofBaseTypes.cpp:204
virtual void pushStyle()=0
Push this renderer's current style into its internal style stack.
virtual void drawIcoSphere(float x, float y, float z, float radius) const
Draw an icosphere with this renderer using x, y, and radius.
Definition ofBaseTypes.cpp:208
virtual void drawAxis(float size) const
Draw the coordinate system's axes with the renderer.
Definition ofBaseTypes.cpp:308
virtual void setColor(int r, int g, int b)=0
Set the global color this renderer will use when drawing.
virtual void setBackgroundAuto(bool bManual)=0
Enable/disable automatic redrawing of the background each frame.
virtual void drawBox(float x, float y, float z, float width, float height, float depth) const
Draws a rectangular box using x, y, z, width, height, and depth.
Definition ofBaseTypes.cpp:284
virtual bool getBackgroundAuto()=0
Get the current auto redraw background setting for this renderer.
virtual void drawGrid(float stepSize, size_t numberOfSteps, bool labels, bool x, bool y, bool z) const
Draw the coordinate system's axes as a grid with the renderer.
Definition ofBaseTypes.cpp:312
virtual void setLineWidth(float lineWidth)=0
Set the line width this renderer should use when drawing lines.
virtual void drawGridPlane(float stepSize, size_t numberOfSteps, bool labels) const
Draw a coordinate system plane using the y and z axes.
Definition ofBaseTypes.cpp:316
virtual glm::vec3 getBoxResolution() const
Get this renderer's current box resolution as a 3D vector.
Definition ofBaseTypes.cpp:280
virtual void pushView()=0
Push the current viewport into the renderer's viewport stack.
virtual void draw(const ofPath &shape) const =0
Draw a path with this renderer.
virtual void draw(const ofNode &model) const =0
Draw a node with this renderer using ofNode::customDraw().
virtual void setCylinderResolution(int radiusSegments, int heightSegments, int capSegments=2)
Set this renderer's cylinder resolution.
Definition ofBaseTypes.cpp:224
virtual void setCoordHandedness(ofHandednessType handedness)=0
Set the coordinate handidness of this renderer.
virtual void clearAlpha()=0
Restore the alpha color to its full opacity value.
virtual void drawArrow(const glm::vec3 &start, const glm::vec3 &end, float headSize) const
Draw an arrow between two 3D points.
Definition ofBaseTypes.cpp:320
virtual void popMatrix()=0
Pops this renderer's current matrix stack.
virtual ofColor getBackgroundColor()=0
Get this renderer's current background color.
virtual ofHandednessType getCoordHandedness() const =0
Get the coordinate handidness of this renderer.
virtual void drawRectangle(float x, float y, float z, float w, float h) const =0
Draw a rectangle using a 3D point and a width and height.
virtual int getViewportHeight() const =0
Get the renderer's current viewport width.
virtual void loadMatrix(const glm::mat4 &m)=0
Load a matrix as this renderer's current matrix.
virtual void translate(float x, float y, float z=0)=0
Translate this renderer's current matrix by x, y, and z.
virtual void enableAntiAliasing()=0
Enable this renderer to use anti-aliasing if it is supported.
virtual void draw(const ofFloatImage &image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const =0
Draw an image with this renderer.
virtual void clear(float r, float g, float b, float a=0)=0
Clear this renderer's color and bit depths and replace them.
virtual void setupGraphicDefaults()=0
setup the default graphics settings for this renderer.
virtual glm::mat4 getCurrentOrientationMatrix() const =0
Get this renderer's current orientation matrix.
Definition ofBaseTypes.cpp:143
virtual void draw(const ofPath &shape, float x, float y) const
Draw a path with this renderer at x and y.
Definition ofGraphicsBaseTypes.h:306
virtual void setPlaneResolution(int columns, int rows)
Set this renderer's plane resolution using column and rows.
Definition ofBaseTypes.cpp:152
virtual void background(float brightness)=0
Immediately paint a grayscale background color to the screen.
virtual void setPolyMode(ofPolyWindingMode mode)=0
Set this renderer's poly winding mode.
virtual void rotateZRad(float degrees)=0
Rotate this renderer's current matrix by degrees about the z axis.
virtual void setColor(const ofColor &color, int _a)=0
Set the global color this renderer will use when drawing.
virtual void setRectMode(ofRectMode mode)=0
Set this renderer's rect mode.
virtual void background(int hexColor, float _a=255.0f)=0
Immediately paint a grayscale background color to the screen.
virtual void multMatrix(const glm::mat4 &m)=0
Multiply this renderer's current matrix by m.
virtual glm::mat4 getCurrentViewMatrix() const =0
Get this renderer's current view matrix.
virtual void rotateRad(float degrees, float vecX, float vecY, float vecZ)=0
Rotate this renderer's current matrix by degrees about a euler.
virtual void drawEllipse(float x, float y, float z, float width, float height) const =0
Draw an ellipse using a 3D point, width, and height.
virtual void setColor(const ofColor &color)=0
Set the global color this renderer will use when drawing.
virtual void multViewMatrix(const glm::mat4 &m)=0
Multiply this renderer's view matrix by m.
virtual void viewport(ofRectangle viewport)=0
Set this renderer's viewport using a rectangle.
virtual void setSphereResolution(int res)
Set the point resolution to use when drawing a sphere with this renderer.
Definition ofBaseTypes.cpp:176
virtual glm::mat4 getCurrentNormalMatrix() const =0
Get this renderer's current normal matrix.
virtual void drawCircle(float x, float y, float z, float radius) const =0
Draw a circle using a 3D point and a radius.
virtual ofFillFlag getFillMode()=0
Get this renderer's current fill flag.
virtual void clear()=0
Clear this renderer's current color and bit depths.
virtual void rotateYRad(float degrees)=0
Rotate this renderer's current matrix by degrees about the y axis.
virtual void setupScreenPerspective(float width=-1, float height=-1, float fov=60, float nearDist=0, float farDist=0)=0
Setup the renderer to use a perspective matrix.
virtual const std::string & getType()=0
Get the string representation of the renderer type.
virtual void drawSphere(float x, float y, float radius) const
Draw a sphere with this renderer using x, y, and radius.
Definition ofBaseTypes.cpp:184
virtual glm::vec3 getCylinderResolution() const
Get this renderer's cylinder resolution as a 3D vector.
Definition ofBaseTypes.cpp:228
virtual void startRender()=0
Starts using this renderer as the rendering surface.
virtual void setBitmapTextMode(ofDrawBitmapMode mode)=0
Set this renderer's bitmap text mode.
virtual ofStyle getStyle() const =0
Get this renderer's current style object.
virtual void loadIdentityMatrix(void)=0
Load this renderer's identity matrix.
virtual void setCurveResolution(int resolution)=0
Set the resolution used when drawing curves with this renderer.
virtual ofPath & getPath()=0
Get a reference to the path used internally by this renderer.
virtual void popView()=0
Pop the current viewport from the renderer's view stack.
virtual void setDepthTest(bool depthTest)=0
Enable/disable depth testing with this renderer.
virtual void setColor(int gray)=0
Set the global color this renderer will use when drawing.
virtual void setBackgroundColor(const ofColor &c)=0
Set this renderer's background color.
virtual void rotateYDeg(float degrees)
Rotate this renderer's current matrix by degrees about the y axis.
Definition ofGraphicsBaseTypes.cpp:30
virtual void rotateZDeg(float degrees)
Rotate this renderer's current matrix by degrees about the z axis.
Definition ofGraphicsBaseTypes.cpp:34
virtual void bind(const ofCamera &camera, const ofRectangle &viewport)=0
Bind camera's matrices to this renderer's matrix stack.
virtual void finishRender()=0
Stop using this renderer as the rendering surface.
virtual void setLineSmoothing(bool smooth)=0
Enable/disable line smoothing for this renderer if it's supported.
virtual int getViewportWidth() const =0
Get the renderer's current viewport width.
virtual void draw(const ofShortImage &image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const =0
Draw an image with this renderer.
virtual bool isVFlipped() const =0
Returns true if the renderer's current viewport is vertically flipped.
virtual void setOrientation(ofOrientation orientation, bool vFlip)=0
set this renderer's orientation.
virtual void drawString(const ofTrueTypeFont &font, std::string text, float x, float y) const =0
Draw text with this renderer using an ofTrueType font.
virtual void background(int r, int g, int b, int a=255)=0
Immediately paint a background color to the screen.
virtual void setBoxResolution(int res)
Set the resolution this renderer uses when drawing boxes.
Definition ofBaseTypes.cpp:272
virtual void unbind(const ofCamera &camera)=0
Unbind the camera from this renderer.
virtual glm::mat4 getCurrentMatrix(ofMatrixMode matrixMode_) const =0
Get this renderer's current matrix for particular a matrix mode.
virtual void pushMatrix()=0
Pushes this renderer's matrix stack down by one.
virtual of3dGraphics & get3dGraphics()=0
Get a reference with this renderer's 3D graphics object.
virtual void loadViewMatrix(const glm::mat4 &m)=0
Load m into this renderer's matrix stack as a view matrix.
virtual void disableAntiAliasing()=0
Disable this renderer from using anti-aliasing.
virtual void drawTriangle(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) const =0
Draw a triangle using three 3D points.
virtual void drawCone(float x, float y, float z, float radius, float height) const
Draw a cone with this renderer using x, y, z, radius, and height.
Definition ofBaseTypes.cpp:256
virtual void draw(const ofImage &image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const =0
Draw an image with this renderer.
virtual void drawRotationAxes(float radius, float stripWidth, int circleRes) const
Draw the coordinate system's axes with the renderer.
Definition ofBaseTypes.cpp:324
virtual void popStyle()=0
Pop this renderer's current style from its internal style stack.
virtual glm::vec2 getPlaneResolution() const
Get this renderer's current plane resolution as a 2D vector.
Definition ofBaseTypes.cpp:156
virtual void rotateDeg(float degrees, float vecX, float vecY, float vecZ)
Rotate this renderer's current matrix by degrees about a euler.
Definition ofGraphicsBaseTypes.cpp:22
virtual void rotateRad(float degrees)=0
Rotate this renderer's current matrix by degrees about the z axis.
virtual int getSphereResolution() const
Get this renderer's current sphere resolution.
Definition ofBaseTypes.cpp:180
virtual void loadMatrix(const float *m)=0
Load m as this renderer's current matrix.
virtual void matrixMode(ofMatrixMode mode)=0
Sets this renderer's current matrix mode.
virtual void setupScreen()=0
setup the default screen settings for this renderer.
virtual ofRectangle getCurrentViewport() const =0
Get this renderer's current viewport.
virtual void setConeResolution(int radiusSegments, int heightSegments, int capSegments=2)
Set the resolution of a polygonized cone.
Definition ofBaseTypes.cpp:248
virtual ofRectangle getNativeViewport() const =0
Get this renderer's current native viewport.
An abstract class representing an object that can be updated.
Definition ofGraphicsBaseTypes.h:213
virtual ~ofBaseUpdates()
Destroy the ofBaseUpdates.
Definition ofGraphicsBaseTypes.h:216
virtual void update()=0
Update the object's state.
A base class representing a drawable video source.
Definition ofVideoBaseTypes.h:103
A basic camera object for interacting with objects in 3D space.
Definition ofCamera.h:13
void set(float red, float green, float blue, float alpha=limit())
Set an ofColor_ by using RGB values.
Definition ofColor.cpp:214
Definition ofFbo.h:46
A class representing an image using memory and gpu based pixels.
Definition ofImage.h:172
Definition ofLight.h:41
material parameter properties that can be applied to vertices in the OpenGL lighting model used in de...
Definition ofMaterial.h:162
Represents a set of vertices in 3D spaces with normals, colors, and texture coordinates at those poin...
Definition ofMesh.h:78
A generic 3d object in space with transformation (position, rotation, scale).
Definition ofNode.h:14
ofPath is a way to create a path or multiple paths consisting of points. It allows you to combine mul...
Definition ofPath.h:38
A class representing a collection of pixels.
Definition ofPixels.h:170
Definition ofPolyline.h:56
A class representing a 2D rectangle.
Definition ofRectangle.h:87
Buffer for audio samples and associated metadata.
Definition ofSoundBuffer.h:84
Contains general information about the style of ofGraphics elements such as color,...
Definition ofGraphicsBaseTypes.h:51
ofColor bgColor
The background color used when rendering.
Definition ofGraphicsBaseTypes.h:82
ofDrawBitmapMode drawBitmapMode
The render mode for bitmaps (e.g. ofDrawBitmapString).
Definition ofGraphicsBaseTypes.h:111
int circleResolution
Definition ofGraphicsBaseTypes.h:120
int sphereResolution
Definition ofGraphicsBaseTypes.h:123
int curveResolution
Definition ofGraphicsBaseTypes.h:126
ofColor color
The color used when rendering.
Definition ofGraphicsBaseTypes.h:79
ofStyle()
Create a default ofStyle.
Definition ofGraphicsBaseTypes.h:54
virtual ~ofStyle()
Destroy the ofStyle.
Definition ofGraphicsBaseTypes.h:74
ofBlendMode blendingMode
The blending mode.
Definition ofGraphicsBaseTypes.h:114
ofRectMode rectMode
Determine how some shapes are anchored (e.g. ofDrawEllipse).
Definition ofGraphicsBaseTypes.h:100
bool bFill
True if the renderer should fill a rendered shape.
Definition ofGraphicsBaseTypes.h:106
bool smoothing
True if anti-aliasing is enabled.
Definition ofGraphicsBaseTypes.h:117
float lineWidth
The width of rendered lines.
Definition ofGraphicsBaseTypes.h:130
ofPolyWindingMode polyMode
The current rendering mode for polygons.
Definition ofGraphicsBaseTypes.h:90
Definition ofTrueTypeFont.h:164
Definition ofVbo.h:21
Definition ofVboMesh.h:6
unsigned int height
Definition ofAppEGLWindow.cpp:125
unsigned int width
Definition ofAppEGLWindow.cpp:124
ofFboMode
ofFbo mode(s) when binding
Definition ofFbo.h:8
ofPixels_< float > ofFloatPixels
Definition ofGraphicsBaseTypes.h:27
ofPixels_< unsigned char > ofPixels
Definition ofGraphicsBaseTypes.h:26
ofImage_< float > ofFloatImage
Definition ofGraphicsBaseTypes.h:34
ofBaseHasPixels_< unsigned short > ofBaseHasShortPixels
A typedef for an unsigned short ofBaseHasPixels_.
Definition ofGraphicsBaseTypes.h:275
ofBaseHasPixels_< unsigned char > ofBaseHasPixels
A typedef for an unsigned char ofBaseHasPixels_.
Definition ofGraphicsBaseTypes.h:269
ofPixels_< unsigned short > ofShortPixels
Definition ofGraphicsBaseTypes.h:28
ofBaseHasPixels_< float > ofBaseHasFloatPixels
A typedef for an float ofBaseHasPixels_.
Definition ofGraphicsBaseTypes.h:272
ofPixels & ofPixelsRef
Definition ofGraphicsBaseTypes.h:29
ofImage_< unsigned short > ofShortImage
Definition ofGraphicsBaseTypes.h:35
ofImage_< unsigned char > ofImage
Definition ofGraphicsBaseTypes.h:33
ofDrawBitmapMode
Sets the bitmap drawing mode for text.
Definition ofGraphicsConstants.h:125
@ OF_BITMAPMODE_SIMPLE
Definition ofGraphicsConstants.h:126
@ OF_BITMAPMODE_MODEL_BILLBOARD
Definition ofGraphicsConstants.h:130
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
ofRectMode
Used to represent the available rectangle drawing modes.
Definition ofGraphicsConstants.h:139
@ OF_RECTMODE_CORNER
Represents the mode where rectangles draw from the top left.
Definition ofGraphicsConstants.h:141
ofBlendMode
Used to represent the available blending modes for drawing.
Definition ofGraphicsConstants.h:57
@ OF_BLENDMODE_ALPHA
Blend mode used for alpha blending.
Definition ofGraphicsConstants.h:61
ofPolyRenderMode
Definition ofGraphicsConstants.h:13
ofPolyWindingMode
represents the available polygon winding modes.
Definition ofGraphicsConstants.h:97
@ OF_POLY_WINDING_ODD
Fill odd winding numbers.
Definition ofGraphicsConstants.h:99
ofFillFlag
Used to represent the available fill modes.
Definition ofGraphicsConstants.h:41
#define a
#define c
#define b
ofLoopType
Used to represent the available video looping modes.
Definition ofVideoBaseTypes.h:11
ofOrientation
Used to represent the available screen orientations.
Definition ofWindowSettings.h:25