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.
43using ofMesh = ofMesh_<ofDefaultVertexType, ofDefaultNormalType, ofDefaultColorType, ofDefaultTexCoordType>;
341 virtual void draw(const ofMesh & vertexData, ofPolyRenderMode renderType, bool useColors, bool useTextures, bool useNormals) const=0;
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;
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;
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;
443 virtual void viewport(float x = 0, float y = 0, float width = -1, float height = -1, bool vflip=true)=0;
459 virtual void setupScreenPerspective(float width = -1, float height = -1, float fov = 60, float nearDist = 0, float farDist = 0)=0;
472 virtual void setupScreenOrtho(float width = -1, float height = -1, float nearDist = -1, float farDist = 1)=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;
1028 virtual void drawString(const ofTrueTypeFont & font, std::string text, float x, float y) const=0;
1236 virtual void setCylinderResolution( int radiusSegments, int heightSegments, int capSegments=2 );
1406 virtual void drawBox( float x, float y, float z, float width, float height, float depth) const;
1490 virtual void drawGrid(float stepSize, size_t numberOfSteps, bool labels, bool x, bool y, bool z) const;
Definition of3dGraphics.h:445
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 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 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
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 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 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 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 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 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
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
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
Definition ofPolyline.h:56
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
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
ofPolyWindingMode polyMode
The current rendering mode for polygons.
Definition ofGraphicsBaseTypes.h:90
Definition ofTrueTypeFont.h:164
Definition ofVbo.h:21
Definition ofVboMesh.h:6
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
ofBaseHasPixels_< float > ofBaseHasFloatPixels
A typedef for an float ofBaseHasPixels_.
Definition ofGraphicsBaseTypes.h:272
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
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
ofPolyWindingMode
represents the available polygon winding modes.
Definition ofGraphicsConstants.h:97
@ OF_POLY_WINDING_ODD
Fill odd winding numbers.
Definition ofGraphicsConstants.h:99
#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