.. index:: pair: class; EE::Graphics::Renderer .. _doxid-class_e_e_1_1_graphics_1_1_renderer: class EE::Graphics::Renderer ============================ .. toctree:: :hidden: Overview ~~~~~~~~ This class is an abstraction of some OpenGL functionality. eepp has 4 different rendering pipelines: OpenGL 2, OpenGL 3, OpenGL 3 Core Profile and OpenGL ES 2. This abstraction is to encapsulate this pipelines. eepp implements its own state machine to simulate fixed-pipeline commands with OpenGL 3 and OpenGL ES 2. Most of the commands can be found in the OpenGL documentation. This is only useful for advanced users that want some control of the OpenGL pipeline. It's mostly used internally by the engine. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class Renderer { public: // construction virtual :target:`~Renderer`(); // methods static :ref:`GraphicsLibraryVersion` :ref:`glVersionFromString`(std::string glVersion); static std::string :ref:`graphicsLibraryVersionToString`(const :ref:`GraphicsLibraryVersion`& glVersion); static :ref:`GraphicsLibraryVersion` :target:`getDefaultGraphicsLibraryVersion`(); static std::vector<:ref:`GraphicsLibraryVersion`> :target:`getAvailableGraphicsLibraryVersions`(); static Renderer* :target:`createSingleton`(:ref:`GraphicsLibraryVersion` ver); static Renderer* :target:`createSingleton`(); static Renderer* :target:`existsSingleton`(); static Renderer* :target:`instance`(); static void :target:`destroySingleton`(); virtual void :target:`init`(); std::string :ref:`getVendor`(); std::string :ref:`getRenderer`(); std::string :ref:`getVersion`(); std::string :ref:`getShadingLanguageVersion`(); bool :ref:`isExtension`(const std::string& name); bool :ref:`isExtension`(:ref:`GraphicsLibraryExtension` name); bool :target:`pointSpriteSupported`(); bool :target:`shadersSupported`(); void :target:`clear`(unsigned int mask); void :target:`clearColor`(float red, float green, float blue, float alpha); void :target:`scissor`(int x, int y, int width, int height); void :target:`polygonMode`(unsigned int face, unsigned int mode); std::string :target:`getExtensions`(); const char* :target:`getString`(unsigned int name); void :target:`drawArrays`(unsigned int mode, int first, int count); void :target:`drawElements`(unsigned int mode, int count, unsigned int type, const void* indices); void :target:`bindTexture`(unsigned int target, unsigned int texture); void :target:`activeTexture`(unsigned int texture); void :target:`blendFunc`(unsigned int sfactor, unsigned int dfactor); void :target:`blendFuncSeparate`(unsigned int sfactorRGB, unsigned int dfactorRGB, unsigned int sfactorAlpha, unsigned int dfactorAlpha); void :target:`blendEquationSeparate`(unsigned int modeRGB, unsigned int modeAlpha); void :target:`blitFrameBuffer`( int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, unsigned int mask, unsigned int filter ); void :target:`viewport`(int x, int y, int width, int height); void :target:`lineSmooth`(const bool& enable); void :target:`lineWidth`(float width); void :ref:`lineSmooth`(); bool :target:`isLineSmooth`(); void :target:`polygonSmooth`(const bool& enable); void :ref:`polygonSmooth`(); bool :target:`isPolygonSmooth`(); void :ref:`polygonMode`(const :ref:`PrimitiveFillMode`& Mode); void :ref:`polygonMode`(); void :target:`pixelStorei`(unsigned int pname, int param); :ref:`RendererGL`* :target:`getRendererGL`(); RendererGL3* :target:`getRendererGL3`(); RendererGL3CP* :target:`getRendererGL3CP`(); RendererGLES2* :target:`getRendererGLES2`(); virtual void :target:`pointSize`(float size) = 0; virtual float :target:`pointSize`() = 0; virtual void :target:`clientActiveTexture`(unsigned int texture) = 0; virtual void :target:`disable`(unsigned int cap); virtual void :target:`enable`(unsigned int cap); virtual :ref:`GraphicsLibraryVersion` :target:`version`() = 0; virtual std::string :target:`versionStr`() = 0; virtual void :target:`pushMatrix`() = 0; virtual void :target:`popMatrix`() = 0; virtual void :target:`loadIdentity`() = 0; virtual void :target:`translatef`(float x, float y, float z) = 0; virtual void :target:`rotatef`(float angle, float x, float y, float z) = 0; virtual void :target:`scalef`(float x, float y, float z) = 0; virtual void :target:`matrixMode`(unsigned int mode) = 0; virtual void :target:`ortho`(float left, float right, float bottom, float top, float zNear, float zFar) = 0; virtual void :target:`lookAt`( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ) = 0; virtual void :target:`perspective`(float fovy, float aspect, float zNear, float zFar) = 0; virtual void :target:`enableClientState`(unsigned int array) = 0; virtual void :target:`disableClientState`(unsigned int array) = 0; virtual void :target:`vertexPointer`(int size, unsigned int type, int stride, const void* pointer, unsigned int allocate) = 0; virtual void :target:`colorPointer`(int size, unsigned int type, int stride, const void* pointer, unsigned int allocate) = 0; virtual void :target:`texCoordPointer`(int size, unsigned int type, int stride, const void* pointer, unsigned int allocate) = 0; virtual void :target:`setShader`(:ref:`ShaderProgram`* Shader); virtual void :target:`clip2DPlaneEnable`(const :ref:`Int32`& x, const :ref:`Int32`& y, const :ref:`Int32`& Width, const :ref:`Int32`& Height) = 0; virtual void :target:`clip2DPlaneDisable`() = 0; virtual void :target:`multMatrixf`(const float* m) = 0; virtual void :target:`clipPlane`(unsigned int plane, const double* equation) = 0; virtual void :target:`loadMatrixf`(const float* m) = 0; virtual void :target:`frustum`(float left, float right, float bottom, float top, float near_val, float far_val) = 0; virtual void :target:`getCurrentMatrix`(unsigned int mode, float* m) = 0; virtual unsigned int :target:`getCurrentMatrixMode`() = 0; void :target:`getViewport`(int* viewport); virtual int :target:`project`( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float* winx, float* winy, float* winz ) = 0; virtual int :target:`unProject`( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float* objx, float* objy, float* objz ) = 0; :ref:`Vector3f` :target:`projectCurrent`(const :ref:`Vector3f`& point); :ref:`Vector3f` :target:`unProjectCurrent`(const :ref:`Vector3f`& point); void :target:`stencilFunc`(unsigned int func, int ref, unsigned int mask); void :target:`stencilOp`(unsigned int fail, unsigned int zfail, unsigned int zpass); void :target:`stencilMask`(unsigned int mask); void :target:`colorMask`(:ref:`Uint8` red, :ref:`Uint8` green, :ref:`Uint8` blue, :ref:`Uint8` alpha); void :target:`bindVertexArray`(unsigned int array); void :target:`deleteVertexArrays`(int n, const unsigned int* arrays); void :target:`genVertexArrays`(int n, unsigned int* arrays); const bool& :target:`quadsSupported`() const; const int& :target:`quadVertexs`() const; :ref:`ClippingMask`* :target:`getClippingMask`() const; void :target:`genFramebuffers`(int n, unsigned int* framebuffers); void :target:`deleteFramebuffers`(int n, const unsigned int* framebuffers); void :target:`bindFramebuffer`(unsigned int target, unsigned int framebuffer); void :target:`framebufferTexture2D`(unsigned int target, unsigned int attachment, unsigned int textarget, unsigned int texture, int level); void :target:`genRenderbuffers`(int n, unsigned int* renderbuffers); void :target:`deleteRenderbuffers`(int n, const unsigned int* renderbuffers); void :target:`bindRenderbuffer`(unsigned int target, unsigned int renderbuffer); void :target:`renderbufferStorage`(unsigned int target, unsigned int internalformat, int width, int height); void :target:`framebufferRenderbuffer`(unsigned int target, unsigned int attachment, unsigned int renderbuffertarget, unsigned int renderbuffer); unsigned int :target:`checkFramebufferStatus`(unsigned int target); void :target:`discardFramebuffer`(unsigned int target, int numAttachments, const unsigned int* attachments); void* :target:`getProcAddress`(std::string proc); void :target:`readPixels`(int x, int y, unsigned int width, unsigned int height, void* pixels); :ref:`Color` :target:`readPixel`(int x, int y); }; .. _details-class_e_e_1_1_graphics_1_1_renderer: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ This class is an abstraction of some OpenGL functionality. eepp has 4 different rendering pipelines: OpenGL 2, OpenGL 3, OpenGL 3 Core Profile and OpenGL ES 2. This abstraction is to encapsulate this pipelines. eepp implements its own state machine to simulate fixed-pipeline commands with OpenGL 3 and OpenGL ES 2. Most of the commands can be found in the OpenGL documentation. This is only useful for advanced users that want some control of the OpenGL pipeline. It's mostly used internally by the engine. Methods ------- .. index:: pair: function; glVersionFromString .. _doxid-class_e_e_1_1_graphics_1_1_renderer_1a17f531dff8ea805a9199302a4857bbf3: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`GraphicsLibraryVersion` glVersionFromString(std::string glVersion) .. rubric:: Returns: The graphic library renderer version from a string. .. index:: pair: function; graphicsLibraryVersionToString .. _doxid-class_e_e_1_1_graphics_1_1_renderer_1a1d0e05c9ec52bcd6b6cc7fac755e4377: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string graphicsLibraryVersionToString(const :ref:`GraphicsLibraryVersion`& glVersion) .. rubric:: Returns: Converts GralphicsLibraryVersion to a string .. index:: pair: function; getVendor .. _doxid-class_e_e_1_1_graphics_1_1_renderer_1a93c54019cd702d19ed992be689ab8b4c: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::string getVendor() .. rubric:: Returns: The company responsible for this GL implementation. .. index:: pair: function; getRenderer .. _doxid-class_e_e_1_1_graphics_1_1_renderer_1a2aa60386bac762c414919b1aa1f687b5: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::string getRenderer() .. rubric:: Returns: The name of the renderer. This name is typically specific to a particular configuration of a hardware platform. .. index:: pair: function; getVersion .. _doxid-class_e_e_1_1_graphics_1_1_renderer_1a8dcb51a6fafa3b8c0184c6ea6720719e: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::string getVersion() .. rubric:: Returns: A GL version or release number. .. index:: pair: function; getShadingLanguageVersion .. _doxid-class_e_e_1_1_graphics_1_1_renderer_1a6b4429ceeb1c5f068f9800c1d77416d1: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::string getShadingLanguageVersion() .. rubric:: Returns: The shading language version .. index:: pair: function; isExtension .. _doxid-class_e_e_1_1_graphics_1_1_renderer_1a3faa5304288c4e2abc05938f044caae6: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool isExtension(const std::string& name) .. rubric:: Returns: If the extension passed is supported by the GPU .. index:: pair: function; isExtension .. _doxid-class_e_e_1_1_graphics_1_1_renderer_1a10d67b4b524f6c85af6e28ab68a1d86a: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool isExtension(:ref:`GraphicsLibraryExtension` name) .. rubric:: Returns: If the extension from the EEGL_extensions is present on the GPU. .. index:: pair: function; lineSmooth .. _doxid-class_e_e_1_1_graphics_1_1_renderer_1a3f65a46c579a23ac29635db3f98dccb0: .. ref-code-block:: cpp :class: doxyrest-title-code-block void lineSmooth() Reapply the line smooth state .. index:: pair: function; polygonSmooth .. _doxid-class_e_e_1_1_graphics_1_1_renderer_1aba9ec0b8b6d38c07a446c3299f214e5c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void polygonSmooth() Reapply the polygon smooth state .. index:: pair: function; polygonMode .. _doxid-class_e_e_1_1_graphics_1_1_renderer_1a097cdab1c2d386eeddf1ce9efa70387d: .. ref-code-block:: cpp :class: doxyrest-title-code-block void polygonMode(const :ref:`PrimitiveFillMode`& Mode) Set the polygon fill mode ( wireframe or filled ) .. index:: pair: function; polygonMode .. _doxid-class_e_e_1_1_graphics_1_1_renderer_1a1a3658ef74b2b9679b81866a8e23b693: .. ref-code-block:: cpp :class: doxyrest-title-code-block void polygonMode() Reapply the polygon mode