reference

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

ofGLBaseTypes.h
Go to the documentation of this file.
1#pragma once
2
4#include <vector>
5
6class ofTexture;
7class ofShader;
8class ofShadow;
9
12public:
15
17 virtual ofTexture & getTexture()=0;
18
20 virtual const ofTexture & getTexture() const=0;
21
24 virtual void setUseTexture(bool bUseTex)=0;
25
27 virtual bool isUsingTexture() const=0;
28};
29
30
33public:
36
38 virtual std::vector<ofTexture> & getTexturePlanes()=0;
39
41 virtual const std::vector<ofTexture> & getTexturePlanes() const=0;
42};
43
44
68public:
70 virtual ~ofAbstractImage(){}
71};
72
75template<typename T>
76class ofBaseImage_: public ofAbstractImage, virtual public ofBaseHasPixels_<T>{
77public:
79 virtual ~ofBaseImage_(){};
80};
81
82
85
88
91
92class of3dPrimitive;
93
94
96public:
98
100
114 virtual void draw(const ofTexture & image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const=0;
115
139 virtual void draw(const ofVbo & vbo, GLuint drawMode, int first, int total) const=0;
140
166 virtual void drawElements(const ofVbo & vbo, GLuint drawMode, int amt, int offsetelements) const=0;
167
194 virtual void drawInstanced(const ofVbo & vbo, GLuint drawMode, int first, int total, int primCount) const=0;
195
221 virtual void drawElementsInstanced(const ofVbo & vbo, GLuint drawMode, int amt, int primCount) const=0;
222
233 virtual void draw(const ofVboMesh & mesh, ofPolyRenderMode renderType) const=0;
234
249 virtual void drawInstanced(const ofVboMesh & mesh, ofPolyRenderMode renderType, int primCount) const=0;
250
252
257 virtual void enableTextureTarget(const ofTexture & tex, int textureLocation)=0;
258
267 virtual void disableTextureTarget(int textureTarget, int textureLocation)=0;
268
278 virtual void setAlphaMaskTex(const ofTexture & tex)=0;
279
283 virtual void disableAlphaMask()=0;
284
286
288 virtual void enablePointSprites()=0;
289
291 virtual void disablePointSprites()=0;
292
294
296 virtual void enableLighting()=0;
297
299 virtual void disableLighting()=0;
300
303
306
312 virtual bool getLightingEnabled()=0;
313
317 virtual void setSmoothLighting(bool b)=0;
318
322 virtual void setGlobalAmbientColor(const ofColor& c)=0;
323
327 virtual void enableLight(int lightIndex)=0;
328
332 virtual void disableLight(int lightIndex)=0;
333
339 virtual void setLightSpotlightCutOff(int lightIndex, float spotCutOff)=0;
340
347 virtual void setLightSpotConcentration(int lightIndex, float exponent)=0;
348
363 virtual void setLightAttenuation(int lightIndex, float constant, float linear, float quadratic )=0;
364
369 virtual void setLightAmbientColor(int lightIndex, const ofFloatColor& c)=0;
370
375 virtual void setLightDiffuseColor(int lightIndex, const ofFloatColor& c)=0;
376
381 virtual void setLightSpecularColor(int lightIndex, const ofFloatColor& c)=0;
382
388 virtual void setLightPosition(int lightIndex, const glm::vec4 & position)=0;
389
396 virtual void setLightSpotDirection(int lightIndex, const glm::vec4 & direction)=0;
397
399
403 virtual int getGLVersionMajor()=0;
404
408 virtual int getGLVersionMinor()=0;
409
411
423 virtual void saveScreen(int x, int y, int w, int h, ofPixels & pixels)=0;
424
428 virtual void saveFullViewport(ofPixels & pixels)=0;
429
432
441 virtual void bind(const ofBaseMaterial & material)=0;
442
443 virtual void bind(const ofShadow & shadow)=0;
444 virtual void bind(const ofShadow & shadow, GLenum aCubeFace)=0;
445
453 virtual void bind(const ofShader & shader)=0;
454
462 virtual void bind(const ofTexture & texture, int location)=0;
463
470 virtual void bind(const ofBaseVideoDraws & video)=0;
471
475 virtual void unbind(const ofBaseMaterial & material)=0;
476
477 virtual void unbind(const ofShadow & shadow)=0;
478 virtual void unbind(const ofShadow & shadow, GLenum aCubeFace)=0;
479
483 virtual void unbind(const ofShader & shader)=0;
484
489 virtual void unbind(const ofTexture & texture, int location)=0;
490
494 virtual void unbind(const ofBaseVideoDraws & video)=0;
495
503 virtual void bind(const ofFbo & fbo)=0;
504
508 virtual void unbind(const ofFbo & fbo)=0;
509
510#ifndef TARGET_OPENGLES
518 virtual void bindForBlitting(const ofFbo & fboSrc, ofFbo & fboDst, int attachmentPoint=0)=0;
519#endif
520
522
531 virtual void begin(const ofFbo & fbo, ofFboMode mode)=0;
532
538 virtual void end(const ofFbo & fbo)=0;
539
540};
A class representing a 3d primitive.
Definition of3dPrimitives.h:12
An abstract class representing an image.
Definition ofGLBaseTypes.h:67
virtual ~ofAbstractImage()
Destroy the ofAbstractImage.
Definition ofGLBaseTypes.h:70
Definition ofGraphicsBaseTypes.h:139
Definition ofGLBaseTypes.h:95
virtual void enablePointSprites()=0
Enable point sprites when using this renderer.
virtual void enableLighting()=0
Enable lighting with this renderer.
virtual void disableAlphaMask()=0
Disable this renderer's current alpha mask texture.
virtual void draw(const ofVboMesh &mesh, ofPolyRenderMode renderType) const =0
Draw a vertex buffer mesh using a specific poly render mode.
virtual void disablePointSprites()=0
Disable point sprites when using this renderer.
virtual void bind(const ofBaseVideoDraws &video)=0
Bind a video's texture to this renderer.
virtual int getGLVersionMinor()=0
Get the minor OpenGL version number this renderer is using.
virtual void bind(const ofShadow &shadow, GLenum aCubeFace)=0
virtual void drawElementsInstanced(const ofVbo &vbo, GLuint drawMode, int amt, int primCount) const =0
Draw vertices from a vertex buffer using this renderer.
virtual void setGlobalAmbientColor(const ofColor &c)=0
Set the global ambient light color.
virtual void bind(const ofFbo &fbo)=0
Bind a frame buffer to this renderer.
virtual void saveScreen(int x, int y, int w, int h, ofPixels &pixels)=0
Fill an ofPixels object with a subsection of the current screen.
virtual void unbind(const ofBaseVideoDraws &video)=0
Unbind a video previously bound to this renderer with bind().
virtual void enableSeparateSpecularLight()=0
Enable seperate specular lighting parameters.
virtual int getGLVersionMajor()=0
Get the major OpenGL version number this renderer is using.
virtual void bind(const ofBaseMaterial &material)=0
Bind a material to be used with this renderer.
virtual void setLightDiffuseColor(int lightIndex, const ofFloatColor &c)=0
Set the diffues light color for a light at a specific index.
virtual void unbind(const ofShadow &shadow, GLenum aCubeFace)=0
virtual void setAlphaMaskTex(const ofTexture &tex)=0
Enable alpha masking using this texture as the mask source.
virtual void end(const ofFbo &fbo)=0
Stop using the specified frame buffer as this renderer's render surface.
virtual void disableLighting()=0
Disable lighting with this renderer.
virtual void setLightSpotDirection(int lightIndex, const glm::vec4 &direction)=0
Set the spot direction of a light at a specific index.
virtual void disableSeparateSpecularLight()=0
Disable seperate specular lighting parameters.
virtual void saveFullViewport(ofPixels &pixels)=0
Fill an ofPixels object with the contents of the current screen.
virtual void enableLight(int lightIndex)=0
Enable a light at a specific index.
virtual void unbind(const ofShadow &shadow)=0
virtual void draw(const ofVbo &vbo, GLuint drawMode, int first, int total) const =0
Draw vertices from a vertext buffer with this renderer.
virtual void bindForBlitting(const ofFbo &fboSrc, ofFbo &fboDst, int attachmentPoint=0)=0
Bind source and destination frame buffers for blitting.
virtual void draw(const ofTexture &image, float x, float y, float z, float w, float h, float sx, float sy, float sw, float sh) const =0
Draw a texture with this renderer.
virtual void begin(const ofFbo &fbo, ofFboMode mode)=0
Begin using a frame buffer as this renderer's render surface.
virtual void disableLight(int lightIndex)=0
Disable a light at a specific index.
virtual void drawElements(const ofVbo &vbo, GLuint drawMode, int amt, int offsetelements) const =0
Draw vertices from a vertext buffer with this renderer.
virtual void disableTextureTarget(int textureTarget, int textureLocation)=0
Unbind the texture target at the texture location.
virtual void setLightSpecularColor(int lightIndex, const ofFloatColor &c)=0
Set the specular light color for a light at a specific index.
virtual void drawInstanced(const ofVboMesh &mesh, ofPolyRenderMode renderType, int primCount) const =0
Draw a vertex buffer mesh with instancing using a specific poly render mode.
virtual void unbind(const ofFbo &fbo)=0
Unbind a frame buffer previously bound to this renderer with bind().
virtual void unbind(const ofShader &shader)=0
Unbind a shader previously bound to this renderer with bind().
virtual void setLightAttenuation(int lightIndex, float constant, float linear, float quadratic)=0
Set the light attenuation for a light at a specific index.
virtual void setLightSpotConcentration(int lightIndex, float exponent)=0
Set the spotlight concentration (exponent) for a light at a specific index.
virtual void setLightPosition(int lightIndex, const glm::vec4 &position)=0
Set the position of a light at a specific index.
virtual void setLightSpotlightCutOff(int lightIndex, float spotCutOff)=0
Set the spot light cutoff for a light at a specific index.
virtual bool getLightingEnabled()=0
Returns true if lighting is enabled with this renderer.
virtual void unbind(const ofTexture &texture, int location)=0
Unbind a texture previously bound to this renderer with bind().
virtual void enableTextureTarget(const ofTexture &tex, int textureLocation)=0
Bind the texture at the texture location.
virtual void bind(const ofTexture &texture, int location)=0
Bind a texture to be used with this renderer at a location.
virtual void bind(const ofShader &shader)=0
Bind a shader to be used with this renderer.
virtual void drawInstanced(const ofVbo &vbo, GLuint drawMode, int first, int total, int primCount) const =0
Draw vertices from a vertext buffer using instanced arrays.
virtual void unbind(const ofBaseMaterial &material)=0
Unbind a material previously bound to this renderer with bind().
virtual void setSmoothLighting(bool b)=0
Enable/disable smooth light shading.
virtual void setLightAmbientColor(int lightIndex, const ofFloatColor &c)=0
Set the ambient light color for a light at a specific index.
virtual void bind(const ofShadow &shadow)=0
A base class represeting an object that has pixels.
Definition ofGraphicsBaseTypes.h:254
An abstract class representing an object that can have an ofTexture.
Definition ofGLBaseTypes.h:11
virtual void setUseTexture(bool bUseTex)=0
Enable or disable internal ofTexture use.
virtual ~ofBaseHasTexture()
Destroy the ofBaseHasTexture.
Definition ofGLBaseTypes.h:14
virtual const ofTexture & getTexture() const =0
virtual ofTexture & getTexture()=0
virtual bool isUsingTexture() const =0
An abstract class representing an object that ofTexture planes.
Definition ofGLBaseTypes.h:32
virtual const std::vector< ofTexture > & getTexturePlanes() const =0
virtual std::vector< ofTexture > & getTexturePlanes()=0
virtual ~ofBaseHasTexturePlanes()
Destroy the ofBaseHasTexturePlanes.
Definition ofGLBaseTypes.h:35
A base class represeting an image.
Definition ofGLBaseTypes.h:76
virtual ~ofBaseImage_()
Destroy the ofBaseImage_.
Definition ofGLBaseTypes.h:79
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 draw(const ofPolyline &poly) const =0
Draw a polyline with this renderer.
virtual void bind(const ofCamera &camera, const ofRectangle &viewport)=0
Bind camera's matrices to this renderer's matrix stack.
virtual void unbind(const ofCamera &camera)=0
Unbind the camera from this renderer.
A base class representing a drawable video source.
Definition ofVideoBaseTypes.h:103
Definition ofFbo.h:46
Definition ofShader.h:35
Definition ofShadow.h:24
A wrapper class for an OpenGL texture.
Definition ofTexture.h:253
Definition ofVbo.h:21
Definition ofVboMesh.h:6
ofFboMode
ofFbo mode(s) when binding
Definition ofFbo.h:8
ofBaseImage_< unsigned short > ofBaseShortImage
A typedef for an unsigned short ofBaseImage_.
Definition ofGLBaseTypes.h:90
ofBaseImage_< float > ofBaseFloatImage
A typedef for an float ofBaseImage_.
Definition ofGLBaseTypes.h:87
ofBaseImage_< unsigned char > ofBaseImage
A typedef for an unsigned char ofBaseImage_.
Definition ofGLBaseTypes.h:84
ofPolyRenderMode
Definition ofGraphicsConstants.h:13
#define c
#define b