mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-10-26 08:08:28 +03:00
Renderer refactor.
--HG-- branch : dev
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include <eepp/gaming/maphelper.hpp>
|
||||
#include <eepp/gaming/maplayer.hpp>
|
||||
|
||||
#include <eepp/graphics/renders.hpp>
|
||||
#include <eepp/graphics/graphicshelper.hpp>
|
||||
using namespace EE::Graphics;
|
||||
|
||||
namespace EE { namespace Gaming {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#ifndef EEPP_GRAPHICS_HPP
|
||||
#define EEPP_GRAPHICS_HPP
|
||||
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/blendmode.hpp>
|
||||
#include <eepp/graphics/pixeldensity.hpp>
|
||||
#include <eepp/graphics/renderer/renderergl.hpp>
|
||||
#include <eepp/graphics/renderer/renderergl3.hpp>
|
||||
#include <eepp/graphics/renders.hpp>
|
||||
#include <eepp/graphics/graphicshelper.hpp>
|
||||
#include <eepp/graphics/image.hpp>
|
||||
#include <eepp/graphics/texture.hpp>
|
||||
#include <eepp/graphics/textureloader.hpp>
|
||||
|
||||
@@ -21,7 +21,7 @@ using namespace EE::Math;
|
||||
#include <eepp/system/filesystem.hpp>
|
||||
using namespace EE::System;
|
||||
|
||||
#include <eepp/graphics/renders.hpp>
|
||||
#include <eepp/graphics/graphicshelper.hpp>
|
||||
#include <eepp/graphics/blendmode.hpp>
|
||||
#include <eepp/graphics/pixeldensity.hpp>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define EE_GRAPHICS_BLENDMODE_HPP
|
||||
|
||||
#include <eepp/config.hpp>
|
||||
#include <eepp/graphics/renders.hpp>
|
||||
#include <eepp/graphics/graphicshelper.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ using namespace EE::Math;
|
||||
#include <eepp/system/color.hpp>
|
||||
using namespace EE::System;
|
||||
|
||||
#include <eepp/graphics/renders.hpp>
|
||||
#include <eepp/graphics/graphicshelper.hpp>
|
||||
|
||||
namespace EE { namespace System {
|
||||
class Pack;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define EE_GRAPHICS_RENDERER_BASE_HPP
|
||||
|
||||
#include <eepp/graphics/base.hpp>
|
||||
#include <eepp/graphics/renders.hpp>
|
||||
#include <eepp/graphics/graphicshelper.hpp>
|
||||
|
||||
#if defined( EE_SHADERS_SUPPORTED )
|
||||
#define EE_GL3_ENABLED 1
|
||||
|
||||
@@ -238,6 +238,6 @@
|
||||
|
||||
#endif
|
||||
|
||||
#include <eepp/graphics/glhelper.hpp>
|
||||
#include <eepp/graphics/renderer/rendererhelper.hpp>
|
||||
|
||||
#endif
|
||||
+15
-14
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <eepp/graphics/renderer/base.hpp>
|
||||
#include <eepp/graphics/shaderprogram.hpp>
|
||||
#include <eepp/graphics/glhelper.hpp>
|
||||
#include <eepp/graphics/renderer/rendererhelper.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
@@ -17,27 +17,26 @@ class RendererGL3CP;
|
||||
class RendererGLES2;
|
||||
|
||||
/** @brief This class is an abstraction of some OpenGL functionality.
|
||||
* eepp have 3 different rendering pipelines: OpenGL 2, OpenGL 3 and OpenGL ES 2. This abstraction is to encapsulate this pipelines.
|
||||
* eepp have 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.
|
||||
*/
|
||||
class EE_API cGL {
|
||||
static cGL * ms_singleton;
|
||||
class EE_API Renderer {
|
||||
public:
|
||||
static cGL * createSingleton( EEGL_version ver );
|
||||
static Renderer * createSingleton( EEGL_version ver );
|
||||
|
||||
static cGL * createSingleton();
|
||||
static Renderer * createSingleton();
|
||||
|
||||
static cGL * existsSingleton();
|
||||
static Renderer * existsSingleton();
|
||||
|
||||
static cGL * instance();
|
||||
static Renderer * instance();
|
||||
|
||||
static void destroySingleton();
|
||||
|
||||
cGL();
|
||||
Renderer();
|
||||
|
||||
virtual ~cGL();
|
||||
virtual ~Renderer();
|
||||
|
||||
virtual void init();
|
||||
|
||||
@@ -212,9 +211,11 @@ class EE_API cGL {
|
||||
|
||||
const int& quadVertexs() const;
|
||||
protected:
|
||||
enum GLStateFlags {
|
||||
GLSF_LINE_SMOOTH = 0,
|
||||
GLSF_POLYGON_MODE
|
||||
static Renderer * sSingleton;
|
||||
|
||||
enum RendererStateFlags {
|
||||
RSF_LINE_SMOOTH = 0,
|
||||
RSF_POLYGON_MODE
|
||||
};
|
||||
|
||||
Uint32 mExtensions;
|
||||
@@ -231,7 +232,7 @@ class EE_API cGL {
|
||||
void writeExtension( Uint8 Pos, Uint32 BitWrite );
|
||||
};
|
||||
|
||||
extern EE_API cGL * GLi;
|
||||
extern EE_API Renderer * GLi;
|
||||
|
||||
}}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#ifndef EE_GRAPHICS_CRENDERERGL_HPP
|
||||
#define EE_GRAPHICS_CRENDERERGL_HPP
|
||||
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
//! Avoid compilling the fixed pipeline renderer for GLES2, because it's not supported.
|
||||
#if !defined( EE_GLES2 ) || defined( EE_GLES_BOTH )
|
||||
|
||||
class EE_API RendererGL : public cGL {
|
||||
class EE_API RendererGL : public Renderer {
|
||||
public:
|
||||
RendererGL();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef EE_GRAPHICS_CRENDERERGL3_HPP
|
||||
#define EE_GRAPHICS_CRENDERERGL3_HPP
|
||||
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
|
||||
#ifdef EE_GL3_ENABLED
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Private {
|
||||
class MatrixStack;
|
||||
}
|
||||
|
||||
class EE_API RendererGL3 : public cGL {
|
||||
class EE_API RendererGL3 : public Renderer {
|
||||
public:
|
||||
RendererGL3();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef EE_GRAPHICS_CRENDERERGL3CP_HPP
|
||||
#define EE_GRAPHICS_CRENDERERGL3CP_HPP
|
||||
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
|
||||
#ifdef EE_GL3_ENABLED
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Private {
|
||||
class MatrixStack;
|
||||
}
|
||||
|
||||
class EE_API RendererGL3CP : public cGL {
|
||||
class EE_API RendererGL3CP : public Renderer {
|
||||
public:
|
||||
RendererGL3CP();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef EE_GRAPHICS_CRENDERERGLES2_HPP
|
||||
#define EE_GRAPHICS_CRENDERERGLES2_HPP
|
||||
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
|
||||
#ifdef EE_GL3_ENABLED
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Private {
|
||||
class MatrixStack;
|
||||
}
|
||||
|
||||
class EE_API RendererGLES2 : public cGL {
|
||||
class EE_API RendererGLES2 : public Renderer {
|
||||
public:
|
||||
RendererGLES2();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define EE_GRAPHICSCVERTEXBUFFER_HPP
|
||||
|
||||
#include <eepp/graphics/base.hpp>
|
||||
#include <eepp/graphics/vbohelper.hpp>
|
||||
#include <eepp/graphics/vertexbufferhelper.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace EE { namespace System {
|
||||
class IOStream;
|
||||
class Pack;
|
||||
|
||||
class Translator {
|
||||
class EE_API Translator {
|
||||
public:
|
||||
Translator( const std::locale& locale = std::locale() );
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ using namespace EE::System;
|
||||
#include <eepp/window/inputhelper.hpp>
|
||||
using namespace EE::Window;
|
||||
|
||||
#include <eepp/graphics/renders.hpp>
|
||||
#include <eepp/graphics/graphicshelper.hpp>
|
||||
#include <eepp/graphics/fonthelper.hpp>
|
||||
#include <eepp/graphics/pixeldensity.hpp>
|
||||
using namespace EE::Graphics;
|
||||
|
||||
@@ -14,8 +14,8 @@ using namespace EE::Math;
|
||||
#include <eepp/system/log.hpp>
|
||||
using namespace EE::System;
|
||||
|
||||
#include <eepp/graphics/renders.hpp>
|
||||
#include <eepp/graphics/glhelper.hpp>
|
||||
#include <eepp/graphics/graphicshelper.hpp>
|
||||
#include <eepp/graphics/renderer/rendererhelper.hpp>
|
||||
using namespace EE::Graphics;
|
||||
|
||||
#include <eepp/window/windowhandle.hpp>
|
||||
|
||||
+20
-7
@@ -3,7 +3,18 @@
|
||||
../../include/eepp/graphics/fontstyleconfig.hpp
|
||||
../../include/eepp/graphics/fonttruetype.hpp
|
||||
../../include/eepp/graphics/fonttruetypeloader.hpp
|
||||
../../include/eepp/graphics/graphicshelper.hpp
|
||||
../../include/eepp/graphics/renderer/base.hpp
|
||||
../../include/eepp/graphics/renderer/opengl.hpp
|
||||
../../include/eepp/graphics/renderer/renderer.hpp
|
||||
../../include/eepp/graphics/renderer/renderer.hpp
|
||||
../../include/eepp/graphics/renderer/renderergl.hpp
|
||||
../../include/eepp/graphics/renderer/renderergl3.hpp
|
||||
../../include/eepp/graphics/renderer/renderergl3cp.hpp
|
||||
../../include/eepp/graphics/renderer/renderergles2.hpp
|
||||
../../include/eepp/graphics/renderer/rendererhelper.hpp
|
||||
../../include/eepp/graphics/text.hpp
|
||||
../../include/eepp/graphics/vertexbufferhelper.hpp
|
||||
../../include/eepp/math/interpolation1d.hpp
|
||||
../../include/eepp/math/interpolation2d.hpp
|
||||
../../include/eepp/system/color.hpp
|
||||
@@ -26,6 +37,15 @@
|
||||
../../src/eepp/graphics/globalbatchrenderer.cpp
|
||||
../../src/eepp/graphics/pixeldensity.cpp
|
||||
../../src/eepp/graphics/pixelperfect.cpp
|
||||
../../src/eepp/graphics/renderer/openglext.hpp
|
||||
../../src/eepp/graphics/renderer/renderer.cpp
|
||||
../../src/eepp/graphics/renderer/renderer.cpp
|
||||
../../src/eepp/graphics/renderer/renderergl.cpp
|
||||
../../src/eepp/graphics/renderer/renderergl3.cpp
|
||||
../../src/eepp/graphics/renderer/renderergl3cp.cpp
|
||||
../../src/eepp/graphics/renderer/renderergles2.cpp
|
||||
../../src/eepp/graphics/renderer/rendererstackhelper.hpp
|
||||
../../src/eepp/graphics/renderer/rendererstackhelper.hpp
|
||||
../../src/eepp/graphics/text.cpp
|
||||
../../src/eepp/math/interpolation1d.cpp
|
||||
../../src/eepp/math/interpolation2d.cpp
|
||||
@@ -158,8 +178,6 @@
|
||||
../../src/eepp/gaming/mapeditor/maplayerproperties.cpp
|
||||
../../include/eepp/graphics/blendmode.hpp
|
||||
../../src/eepp/graphics/blendmode.cpp
|
||||
../../include/eepp/graphics/vbohelper.hpp
|
||||
../../include/eepp/graphics/renders.hpp
|
||||
../../include/eepp/graphics/fonthelper.hpp
|
||||
../../include/eepp/graphics/vertexbuffervbo.hpp
|
||||
../../include/eepp/graphics/vertexbufferogl.hpp
|
||||
@@ -200,7 +218,6 @@
|
||||
../../include/eepp/graphics/base.hpp
|
||||
../../include/eepp/graphics/renderer/renderergl3.hpp
|
||||
../../include/eepp/graphics/renderer/renderergl.hpp
|
||||
../../include/eepp/graphics/renderer/gl.hpp
|
||||
../../include/eepp/graphics/renderer/base.hpp
|
||||
../../include/eepp/math/math.hpp
|
||||
../../include/eepp/math/mtrand.hpp
|
||||
@@ -512,7 +529,6 @@
|
||||
../../src/eepp/graphics/batchrenderer.cpp
|
||||
../../src/eepp/graphics/renderer/renderergl3.cpp
|
||||
../../src/eepp/graphics/renderer/renderergl.cpp
|
||||
../../src/eepp/graphics/renderer/gl.cpp
|
||||
../../src/examples/empty_window/empty_window.cpp
|
||||
../../src/test/eetest.hpp
|
||||
../../src/test/eetest.cpp
|
||||
@@ -571,11 +587,9 @@
|
||||
../../src/eepp/window/backend/SFML/clipboardsfml.cpp
|
||||
../../src/eepp/window/backend.hpp
|
||||
../../src/eepp/graphics/framebufferfbo.hpp
|
||||
../../src/eepp/graphics/renderer/rendererhelper.hpp
|
||||
../../include/eepp/graphics/packerhelper.hpp
|
||||
../../include/eepp/system/filesystem.hpp
|
||||
../../src/eepp/system/filesystem.cpp
|
||||
../../include/eepp/graphics/glhelper.hpp
|
||||
../../include/eepp/window/windowhandle.hpp
|
||||
../../include/eepp/window/windowcontext.hpp
|
||||
../../include/eepp/version.hpp
|
||||
@@ -633,7 +647,6 @@
|
||||
../../src/eepp/system/platform/win/conditionimpl.cpp
|
||||
../../src/eepp/system/platform/posix/conditionimpl.hpp
|
||||
../../src/eepp/system/platform/posix/conditionimpl.cpp
|
||||
../../include/eepp/graphics/opengl.hpp
|
||||
../../src/eepp/system/time.cpp
|
||||
../../include/eepp/system/time.hpp
|
||||
../../src/eepp/graphics/texturesaver.hpp
|
||||
|
||||
@@ -10,3 +10,5 @@
|
||||
../../src/eepp/helper/freetype2/include/
|
||||
../../include/eepp/system
|
||||
../../src/eepp/system
|
||||
../../src/eepp/graphics/renderer
|
||||
../../include/eepp/graphics/renderer
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include <eepp/graphics/texture.hpp>
|
||||
#include <eepp/graphics/globalbatchrenderer.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
using namespace EE::Graphics;
|
||||
|
||||
namespace EE { namespace Gaming {
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
#include <eepp/gaming/mapobjectlayer.hpp>
|
||||
|
||||
#include <eepp/system/packmanager.hpp>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/opengl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/primitives.hpp>
|
||||
#include <eepp/graphics/textureatlasmanager.hpp>
|
||||
#include <eepp/graphics/textureatlasloader.hpp>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <eepp/graphics/texture.hpp>
|
||||
#include <eepp/graphics/globalbatchrenderer.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
using namespace EE::Graphics;
|
||||
|
||||
namespace EE { namespace Gaming {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#include <eepp/graphics/texture.hpp>
|
||||
#include <eepp/graphics/texturefactory.hpp>
|
||||
#include <eepp/graphics/globalbatchrenderer.hpp>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <eepp/graphics/blendmode.hpp>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <eepp/graphics/console.hpp>
|
||||
#include <eepp/window/engine.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/audio/audiolistener.hpp>
|
||||
#include <eepp/window/input.hpp>
|
||||
#include <eepp/window/cursormanager.hpp>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <eepp/graphics/framebuffer.hpp>
|
||||
#include <eepp/graphics/globalbatchrenderer.hpp>
|
||||
#include <eepp/window/engine.hpp>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/opengl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/framebufferfbo.hpp>
|
||||
#include <eepp/graphics/framebuffermanager.hpp>
|
||||
#include <eepp/window/window.hpp>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <eepp/graphics/framebufferfbo.hpp>
|
||||
#include <eepp/graphics/texturefactory.hpp>
|
||||
#include <eepp/window/engine.hpp>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/globalbatchrenderer.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <eepp/graphics/particlesystem.hpp>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/texturefactory.hpp>
|
||||
#include <eepp/graphics/batchrenderer.hpp>
|
||||
#include <eepp/graphics/globalbatchrenderer.hpp>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#include <eepp/math/polygon2.hpp>
|
||||
#include <eepp/graphics/batchrenderer.hpp>
|
||||
#include <eepp/graphics/globalbatchrenderer.hpp>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/opengl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
|
||||
@@ -16,6 +16,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <eepp/graphics/opengl.hpp>
|
||||
#include <eepp/graphics/renderer/opengl.hpp>
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/renderer/renderergl.hpp>
|
||||
#include <eepp/graphics/renderer/renderergl3.hpp>
|
||||
#include <eepp/graphics/renderer/renderergl3cp.hpp>
|
||||
@@ -10,11 +10,11 @@ namespace EE { namespace Graphics {
|
||||
|
||||
typedef const GLubyte *( * pglGetStringiFunc) (unsigned int, unsigned int);
|
||||
|
||||
cGL * GLi = NULL;
|
||||
Renderer * GLi = NULL;
|
||||
|
||||
cGL * cGL::ms_singleton = NULL;
|
||||
Renderer * Renderer::sSingleton = NULL;
|
||||
|
||||
cGL * cGL::createSingleton( EEGL_version ver ) {
|
||||
Renderer * Renderer::createSingleton( EEGL_version ver ) {
|
||||
#if !defined( EE_GLES1 ) && !defined( EE_GLES2 )
|
||||
if ( GLv_default == ver )
|
||||
ver = GLv_2;
|
||||
@@ -44,21 +44,21 @@ cGL * cGL::createSingleton( EEGL_version ver ) {
|
||||
case GLv_ES2:
|
||||
{
|
||||
#if defined( EE_GL3_ENABLED ) || defined( EE_GLES2 )
|
||||
ms_singleton = eeNew( RendererGLES2, () );
|
||||
sSingleton = eeNew( RendererGLES2, () );
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
case GLv_3:
|
||||
{
|
||||
#if defined( EE_GL3_ENABLED ) || defined( EE_GLES2 )
|
||||
ms_singleton = eeNew( RendererGL3, () );
|
||||
sSingleton = eeNew( RendererGL3, () );
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
case GLv_3CP:
|
||||
{
|
||||
#if defined( EE_GL3_ENABLED ) || defined( EE_GLES2 )
|
||||
ms_singleton = eeNew( RendererGL3CP, () );
|
||||
sSingleton = eeNew( RendererGL3CP, () );
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
@@ -68,16 +68,16 @@ cGL * cGL::createSingleton( EEGL_version ver ) {
|
||||
default:
|
||||
{
|
||||
#ifndef EE_GLES2
|
||||
ms_singleton = eeNew( RendererGL, () );
|
||||
sSingleton = eeNew( RendererGL, () );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return ms_singleton;
|
||||
return sSingleton;
|
||||
}
|
||||
|
||||
cGL * cGL::createSingleton() {
|
||||
if ( ms_singleton == 0 ) {
|
||||
Renderer * Renderer::createSingleton() {
|
||||
if ( sSingleton == 0 ) {
|
||||
#if defined( EE_GLES_BOTH )
|
||||
ms_singleton = eeNew( RendererGL, () );
|
||||
#elif defined( EE_GLES2 )
|
||||
@@ -85,31 +85,31 @@ cGL * cGL::createSingleton() {
|
||||
#elif defined( EE_GLES1 )
|
||||
ms_singleton = eeNew( RendererGL, () );
|
||||
#else
|
||||
ms_singleton = eeNew( RendererGL, () );
|
||||
sSingleton = eeNew( RendererGL, () );
|
||||
#endif
|
||||
}
|
||||
|
||||
return ms_singleton;
|
||||
return sSingleton;
|
||||
}
|
||||
|
||||
cGL * cGL::existsSingleton() {
|
||||
return ms_singleton;
|
||||
Renderer * Renderer::existsSingleton() {
|
||||
return sSingleton;
|
||||
}
|
||||
|
||||
cGL * cGL::instance() {
|
||||
Renderer * Renderer::instance() {
|
||||
return createSingleton();
|
||||
}
|
||||
|
||||
void cGL::destroySingleton() {
|
||||
if( ms_singleton != 0 ) {
|
||||
eeDelete( ms_singleton );
|
||||
ms_singleton = 0;
|
||||
void Renderer::destroySingleton() {
|
||||
if( sSingleton != 0 ) {
|
||||
eeDelete( sSingleton );
|
||||
sSingleton = 0;
|
||||
}
|
||||
}
|
||||
|
||||
cGL::cGL() :
|
||||
Renderer::Renderer() :
|
||||
mExtensions(0),
|
||||
mStateFlags( 1 << GLSF_LINE_SMOOTH ),
|
||||
mStateFlags( 1 << RSF_LINE_SMOOTH ),
|
||||
mPushClip( true ),
|
||||
mQuadsSupported( true ),
|
||||
mBlendEnabled( false ),
|
||||
@@ -120,31 +120,31 @@ cGL::cGL() :
|
||||
GLi = this;
|
||||
}
|
||||
|
||||
cGL::~cGL() {
|
||||
Renderer::~Renderer() {
|
||||
GLi = NULL;
|
||||
}
|
||||
|
||||
RendererGL * cGL::getRendererGL() {
|
||||
RendererGL * Renderer::getRendererGL() {
|
||||
return reinterpret_cast<RendererGL*>( this );
|
||||
}
|
||||
|
||||
RendererGL3 * cGL::getRendererGL3() {
|
||||
RendererGL3 * Renderer::getRendererGL3() {
|
||||
return reinterpret_cast<RendererGL3*>( this );
|
||||
}
|
||||
|
||||
RendererGL3CP * cGL::getRendererGL3CP() {
|
||||
RendererGL3CP * Renderer::getRendererGL3CP() {
|
||||
return reinterpret_cast<RendererGL3CP*>( this );
|
||||
}
|
||||
|
||||
RendererGLES2 * cGL::getRendererGLES2() {
|
||||
RendererGLES2 * Renderer::getRendererGLES2() {
|
||||
return reinterpret_cast<RendererGLES2*>( this );
|
||||
}
|
||||
|
||||
void cGL::writeExtension( Uint8 Pos, Uint32 BitWrite ) {
|
||||
void Renderer::writeExtension( Uint8 Pos, Uint32 BitWrite ) {
|
||||
BitOp::writeBitKey( &mExtensions, Pos, BitWrite );
|
||||
}
|
||||
|
||||
void cGL::init() {
|
||||
void Renderer::init() {
|
||||
#ifdef EE_GLEW_AVAILABLE
|
||||
glewExperimental = 1;
|
||||
|
||||
@@ -234,7 +234,7 @@ void cGL::init() {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool cGL::isExtension( const std::string& name ) {
|
||||
bool Renderer::isExtension( const std::string& name ) {
|
||||
#ifdef EE_GLEW_AVAILABLE
|
||||
return 0 != glewIsSupported( name.c_str() );
|
||||
#else
|
||||
@@ -242,11 +242,11 @@ bool cGL::isExtension( const std::string& name ) {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool cGL::isExtension( EEGL_extensions name ) {
|
||||
bool Renderer::isExtension( EEGL_extensions name ) {
|
||||
return 0 != ( mExtensions & ( 1 << name ) );
|
||||
}
|
||||
|
||||
bool cGL::pointSpriteSupported() {
|
||||
bool Renderer::pointSpriteSupported() {
|
||||
#ifdef EE_GLES
|
||||
return true;
|
||||
#else
|
||||
@@ -254,7 +254,7 @@ bool cGL::pointSpriteSupported() {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool cGL::shadersSupported() {
|
||||
bool Renderer::shadersSupported() {
|
||||
#ifdef EE_GLES
|
||||
return ( GLv_ES2 == Version() || GLv_3 == Version() || GLv_3CP == Version() );
|
||||
#else
|
||||
@@ -262,7 +262,7 @@ bool cGL::shadersSupported() {
|
||||
#endif
|
||||
}
|
||||
|
||||
Uint32 cGL::getTextureParamEnum( const EE_TEXTURE_PARAM& Type ) {
|
||||
Uint32 Renderer::getTextureParamEnum( const EE_TEXTURE_PARAM& Type ) {
|
||||
#ifndef EE_GLES
|
||||
switch( Type ) {
|
||||
case TEX_PARAM_COLOR_FUNC: return GL_COMBINE_RGB_ARB;
|
||||
@@ -287,7 +287,7 @@ Uint32 cGL::getTextureParamEnum( const EE_TEXTURE_PARAM& Type ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Uint32 cGL::getTextureFuncEnum( const EE_TEXTURE_FUNC& Type ) {
|
||||
Uint32 Renderer::getTextureFuncEnum( const EE_TEXTURE_FUNC& Type ) {
|
||||
#ifndef EE_GLES2
|
||||
switch( Type ) {
|
||||
case TEX_FUNC_MODULATE: return GL_MODULATE;
|
||||
@@ -303,7 +303,7 @@ Uint32 cGL::getTextureFuncEnum( const EE_TEXTURE_FUNC& Type ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Uint32 cGL::getTextureSourceEnum( const EE_TEXTURE_SOURCE& Type ) {
|
||||
Uint32 Renderer::getTextureSourceEnum( const EE_TEXTURE_SOURCE& Type ) {
|
||||
#ifndef EE_GLES2
|
||||
switch ( Type ) {
|
||||
case TEX_SRC_TEXTURE: return GL_TEXTURE;
|
||||
@@ -316,7 +316,7 @@ Uint32 cGL::getTextureSourceEnum( const EE_TEXTURE_SOURCE& Type ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Uint32 cGL::getTextureOpEnum( const EE_TEXTURE_OP& Type ) {
|
||||
Uint32 Renderer::getTextureOpEnum( const EE_TEXTURE_OP& Type ) {
|
||||
#ifndef EE_GLES2
|
||||
switch ( Type ) {
|
||||
case TEX_OP_COLOR: return GL_SRC_COLOR;
|
||||
@@ -329,7 +329,7 @@ Uint32 cGL::getTextureOpEnum( const EE_TEXTURE_OP& Type ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string cGL::getExtensions() {
|
||||
std::string Renderer::getExtensions() {
|
||||
std::string exts;
|
||||
|
||||
#if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX
|
||||
@@ -371,11 +371,11 @@ std::string cGL::getExtensions() {
|
||||
return exts;
|
||||
}
|
||||
|
||||
void cGL::viewport( int x, int y, int width, int height ) {
|
||||
void Renderer::viewport( int x, int y, int width, int height ) {
|
||||
glViewport( x, y, width, height );
|
||||
}
|
||||
|
||||
void cGL::disable ( unsigned int cap ) {
|
||||
void Renderer::disable ( unsigned int cap ) {
|
||||
switch ( cap )
|
||||
{
|
||||
case GL_BLEND:
|
||||
@@ -393,7 +393,7 @@ void cGL::disable ( unsigned int cap ) {
|
||||
glDisable( cap );
|
||||
}
|
||||
|
||||
void cGL::enable( unsigned int cap ) {
|
||||
void Renderer::enable( unsigned int cap ) {
|
||||
switch ( cap )
|
||||
{
|
||||
case GL_BLEND:
|
||||
@@ -411,50 +411,50 @@ void cGL::enable( unsigned int cap ) {
|
||||
glEnable( cap );
|
||||
}
|
||||
|
||||
const char * cGL::getString( unsigned int name ) {
|
||||
const char * Renderer::getString( unsigned int name ) {
|
||||
return (const char*)glGetString( name );
|
||||
}
|
||||
|
||||
void cGL::clear ( unsigned int mask ) {
|
||||
void Renderer::clear ( unsigned int mask ) {
|
||||
glClear( mask );
|
||||
}
|
||||
|
||||
void cGL::clearColor( float red, float green, float blue, float alpha ) {
|
||||
void Renderer::clearColor( float red, float green, float blue, float alpha ) {
|
||||
glClearColor( red, green, blue, alpha );
|
||||
}
|
||||
|
||||
void cGL::scissor ( int x, int y, int width, int height ) {
|
||||
void Renderer::scissor ( int x, int y, int width, int height ) {
|
||||
glScissor( x, y, width, height );
|
||||
}
|
||||
|
||||
void cGL::polygonMode( unsigned int face, unsigned int mode ) {
|
||||
void Renderer::polygonMode( unsigned int face, unsigned int mode ) {
|
||||
#ifndef EE_GLES
|
||||
glPolygonMode( face, mode );
|
||||
#endif
|
||||
}
|
||||
|
||||
void cGL::drawArrays (unsigned int mode, int first, int count) {
|
||||
void Renderer::drawArrays (unsigned int mode, int first, int count) {
|
||||
glDrawArrays( mode, first, count );
|
||||
}
|
||||
|
||||
void cGL::drawElements( unsigned int mode, int count, unsigned int type, const void *indices ) {
|
||||
void Renderer::drawElements( unsigned int mode, int count, unsigned int type, const void *indices ) {
|
||||
glDrawElements( mode, count, type, indices );
|
||||
}
|
||||
|
||||
void cGL::bindTexture ( unsigned int target, unsigned int texture ) {
|
||||
void Renderer::bindTexture ( unsigned int target, unsigned int texture ) {
|
||||
if ( GLv_3CP == version() && 0 == texture ) return;
|
||||
glBindTexture( target, texture );
|
||||
}
|
||||
|
||||
void cGL::activeTexture( unsigned int texture ) {
|
||||
void Renderer::activeTexture( unsigned int texture ) {
|
||||
glActiveTexture( texture );
|
||||
}
|
||||
|
||||
void cGL::blendFunc ( unsigned int sfactor, unsigned int dfactor ) {
|
||||
void Renderer::blendFunc ( unsigned int sfactor, unsigned int dfactor ) {
|
||||
glBlendFunc( sfactor, dfactor );
|
||||
}
|
||||
|
||||
void cGL::setShader( ShaderProgram * Shader ) {
|
||||
void Renderer::setShader( ShaderProgram * Shader ) {
|
||||
#ifdef EE_SHADERS_SUPPORTED
|
||||
if ( NULL != Shader ) {
|
||||
glUseProgram( Shader->getHandler() );
|
||||
@@ -464,15 +464,15 @@ void cGL::setShader( ShaderProgram * Shader ) {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool cGL::isLineSmooth() {
|
||||
return BitOp::readBitKey( &mStateFlags, GLSF_LINE_SMOOTH );
|
||||
bool Renderer::isLineSmooth() {
|
||||
return BitOp::readBitKey( &mStateFlags, RSF_LINE_SMOOTH );
|
||||
}
|
||||
|
||||
void cGL::lineSmooth() {
|
||||
void Renderer::lineSmooth() {
|
||||
lineSmooth( isLineSmooth() );
|
||||
}
|
||||
|
||||
void cGL::lineSmooth( const bool& Enable ) {
|
||||
void Renderer::lineSmooth( const bool& Enable ) {
|
||||
#if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN
|
||||
if ( Enable ) {
|
||||
GLi->enable( GL_LINE_SMOOTH );
|
||||
@@ -480,11 +480,11 @@ void cGL::lineSmooth( const bool& Enable ) {
|
||||
GLi->disable( GL_LINE_SMOOTH );
|
||||
}
|
||||
|
||||
BitOp::writeBitKey( &mStateFlags, GLSF_LINE_SMOOTH, Enable ? 1 : 0 );
|
||||
BitOp::writeBitKey( &mStateFlags, RSF_LINE_SMOOTH, Enable ? 1 : 0 );
|
||||
#endif
|
||||
}
|
||||
|
||||
void cGL::lineWidth(float width) {
|
||||
void Renderer::lineWidth(float width) {
|
||||
if ( width != mLineWidth ) {
|
||||
#if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN
|
||||
if ( GLv_3CP != version() )
|
||||
@@ -497,29 +497,29 @@ void cGL::lineWidth(float width) {
|
||||
|
||||
}
|
||||
|
||||
void cGL::polygonMode() {
|
||||
void Renderer::polygonMode() {
|
||||
EE_FILL_MODE Mode = DRAW_FILL;
|
||||
|
||||
if ( BitOp::readBitKey( &mStateFlags, GLSF_POLYGON_MODE ) )
|
||||
if ( BitOp::readBitKey( &mStateFlags, RSF_POLYGON_MODE ) )
|
||||
Mode = DRAW_LINE;
|
||||
|
||||
polygonMode( Mode );
|
||||
}
|
||||
|
||||
void cGL::pixelStorei(unsigned int pname, int param) {
|
||||
void Renderer::pixelStorei(unsigned int pname, int param) {
|
||||
glPixelStorei( pname, param );
|
||||
}
|
||||
|
||||
void cGL::polygonMode( const EE_FILL_MODE& Mode ) {
|
||||
void Renderer::polygonMode( const EE_FILL_MODE& Mode ) {
|
||||
if ( Mode == DRAW_FILL )
|
||||
polygonMode( GL_FRONT_AND_BACK, GL_FILL );
|
||||
else
|
||||
polygonMode( GL_FRONT_AND_BACK, GL_LINE );
|
||||
|
||||
BitOp::writeBitKey( &mStateFlags, GLSF_POLYGON_MODE, Mode == DRAW_LINE ? 1 : 0 );
|
||||
BitOp::writeBitKey( &mStateFlags, RSF_POLYGON_MODE, Mode == DRAW_LINE ? 1 : 0 );
|
||||
}
|
||||
|
||||
std::string cGL::getVendor() {
|
||||
std::string Renderer::getVendor() {
|
||||
const char * str = getString( GL_VENDOR );
|
||||
|
||||
if ( NULL != str )
|
||||
@@ -528,7 +528,7 @@ std::string cGL::getVendor() {
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::string cGL::getRenderer() {
|
||||
std::string Renderer::getRenderer() {
|
||||
const char * str = getString( GL_RENDERER );
|
||||
|
||||
if ( NULL != str )
|
||||
@@ -537,7 +537,7 @@ std::string cGL::getRenderer() {
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::string cGL::getVersion() {
|
||||
std::string Renderer::getVersion() {
|
||||
const char * str = getString( GL_VERSION );
|
||||
|
||||
if ( NULL != str )
|
||||
@@ -546,7 +546,7 @@ std::string cGL::getVersion() {
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::string cGL::getShadingLanguageVersion() {
|
||||
std::string Renderer::getShadingLanguageVersion() {
|
||||
if ( shadersSupported() ) {
|
||||
#ifdef GL_SHADING_LANGUAGE_VERSION
|
||||
const char * str = getString( GL_SHADING_LANGUAGE_VERSION );
|
||||
@@ -559,11 +559,11 @@ std::string cGL::getShadingLanguageVersion() {
|
||||
return std::string( "Shaders not supported" );
|
||||
}
|
||||
|
||||
void cGL::getViewport( int * viewport ) {
|
||||
void Renderer::getViewport( int * viewport ) {
|
||||
glGetIntegerv( GL_VIEWPORT, viewport );
|
||||
}
|
||||
|
||||
Vector3f cGL::projectCurrent( const Vector3f& point ) {
|
||||
Vector3f Renderer::projectCurrent( const Vector3f& point ) {
|
||||
float projMat[16];
|
||||
getCurrentMatrix( GL_PROJECTION_MATRIX, projMat );
|
||||
|
||||
@@ -583,7 +583,7 @@ Vector3f cGL::projectCurrent( const Vector3f& point ) {
|
||||
return Vector3f( tv3.x, tv3.y, tv3.z );
|
||||
}
|
||||
|
||||
Vector3f cGL::unProjectCurrent( const Vector3f& point ) {
|
||||
Vector3f Renderer::unProjectCurrent( const Vector3f& point ) {
|
||||
float projMat[16];
|
||||
getCurrentMatrix( GL_PROJECTION_MATRIX, projMat );
|
||||
|
||||
@@ -603,27 +603,27 @@ Vector3f cGL::unProjectCurrent( const Vector3f& point ) {
|
||||
return Vector3f( tv3.x, tv3.y, tv3.z );
|
||||
}
|
||||
|
||||
void cGL::stencilFunc( unsigned int func, int ref, unsigned int mask ) {
|
||||
void Renderer::stencilFunc( unsigned int func, int ref, unsigned int mask ) {
|
||||
glStencilFunc( func, ref, mask );
|
||||
}
|
||||
|
||||
void cGL::stencilOp( unsigned int fail, unsigned int zfail, unsigned int zpass ) {
|
||||
void Renderer::stencilOp( unsigned int fail, unsigned int zfail, unsigned int zpass ) {
|
||||
glStencilOp( fail, zfail, zpass );
|
||||
}
|
||||
|
||||
void cGL::stencilMask ( unsigned int mask ) {
|
||||
void Renderer::stencilMask ( unsigned int mask ) {
|
||||
glStencilMask( mask );
|
||||
}
|
||||
|
||||
void cGL::colorMask ( Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha ) {
|
||||
void Renderer::colorMask ( Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha ) {
|
||||
glColorMask( red, green, blue, alpha );
|
||||
}
|
||||
|
||||
const int& cGL::quadVertexs() const {
|
||||
const int& Renderer::quadVertexs() const {
|
||||
return mQuadVertexs;
|
||||
}
|
||||
|
||||
void cGL::bindVertexArray ( unsigned int array ) {
|
||||
void Renderer::bindVertexArray ( unsigned int array ) {
|
||||
#if !defined( EE_GLES )
|
||||
if ( mCurVAO != array ) {
|
||||
glBindVertexArray( array );
|
||||
@@ -633,19 +633,19 @@ void cGL::bindVertexArray ( unsigned int array ) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void cGL::deleteVertexArrays ( int n, const unsigned int *arrays ) {
|
||||
void Renderer::deleteVertexArrays ( int n, const unsigned int *arrays ) {
|
||||
#if !defined( EE_GLES )
|
||||
glDeleteVertexArrays( n, arrays );
|
||||
#endif
|
||||
}
|
||||
|
||||
void cGL::genVertexArrays ( int n, unsigned int *arrays ) {
|
||||
void Renderer::genVertexArrays ( int n, unsigned int *arrays ) {
|
||||
#if !defined( EE_GLES )
|
||||
glGenVertexArrays( n, arrays );
|
||||
#endif
|
||||
}
|
||||
|
||||
const bool& cGL::quadsSupported() const {
|
||||
const bool& Renderer::quadsSupported() const {
|
||||
return mQuadsSupported;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderergl.hpp>
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderergl3.hpp>
|
||||
|
||||
#ifdef EE_GL3_ENABLED
|
||||
|
||||
#include <eepp/graphics/renderer/rendererhelper.hpp>
|
||||
#include <eepp/graphics/renderer/rendererstackhelper.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
@@ -67,7 +67,7 @@ RendererGL3::RendererGL3() :
|
||||
mStack->mProjectionMatrix.push ( glm::mat4( 1.0f ) ); // identity matrix
|
||||
mStack->mModelViewMatrix.push ( glm::mat4( 1.0f ) ); // identity matrix
|
||||
|
||||
cGL::enable( GL_VERTEX_PROGRAM_POINT_SIZE );
|
||||
Renderer::enable( GL_VERTEX_PROGRAM_POINT_SIZE );
|
||||
}
|
||||
|
||||
RendererGL3::~RendererGL3() {
|
||||
@@ -86,7 +86,7 @@ void RendererGL3::init() {
|
||||
if ( !mLoaded ) {
|
||||
Uint32 i;
|
||||
|
||||
cGL::init();
|
||||
Renderer::init();
|
||||
|
||||
std::string vs( EEGL3_SHADER_BASE_VS );
|
||||
std::string fs( EEGL3_SHADER_BASE_FS );
|
||||
@@ -258,7 +258,7 @@ void RendererGL3::enable( unsigned int cap ) {
|
||||
}
|
||||
}
|
||||
|
||||
cGL::enable( cap );
|
||||
Renderer::enable( cap );
|
||||
}
|
||||
|
||||
void RendererGL3::disable ( unsigned int cap ) {
|
||||
@@ -300,7 +300,7 @@ void RendererGL3::disable ( unsigned int cap ) {
|
||||
}
|
||||
}
|
||||
|
||||
cGL::disable( cap );
|
||||
Renderer::disable( cap );
|
||||
}
|
||||
|
||||
void RendererGL3::enableClientState( unsigned int array ) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderergl3cp.hpp>
|
||||
|
||||
#ifdef EE_GL3_ENABLED
|
||||
|
||||
#include <eepp/graphics/renderer/rendererhelper.hpp>
|
||||
#include <eepp/graphics/renderer/rendererstackhelper.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
@@ -108,7 +108,7 @@ void RendererGL3CP::init() {
|
||||
if ( !mLoaded ) {
|
||||
Uint32 i;
|
||||
|
||||
cGL::init();
|
||||
Renderer::init();
|
||||
|
||||
std::string vs( EEGL3CP_SHADER_BASE_VS );
|
||||
std::string fs( EEGL3CP_SHADER_BASE_FS );
|
||||
@@ -289,7 +289,7 @@ void RendererGL3CP::enable( unsigned int cap ) {
|
||||
}
|
||||
}
|
||||
|
||||
cGL::enable( cap );
|
||||
Renderer::enable( cap );
|
||||
}
|
||||
|
||||
void RendererGL3CP::disable ( unsigned int cap ) {
|
||||
@@ -330,7 +330,7 @@ void RendererGL3CP::disable ( unsigned int cap ) {
|
||||
}
|
||||
}
|
||||
|
||||
cGL::disable( cap );
|
||||
Renderer::disable( cap );
|
||||
}
|
||||
|
||||
void RendererGL3CP::enableClientState( unsigned int array ) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderergles2.hpp>
|
||||
|
||||
#ifdef EE_GL3_ENABLED
|
||||
|
||||
#include <eepp/graphics/renderer/rendererhelper.hpp>
|
||||
#include <eepp/graphics/renderer/rendererstackhelper.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
@@ -102,7 +102,7 @@ void RendererGLES2::init() {
|
||||
if ( !mLoaded ) {
|
||||
Uint32 i;
|
||||
|
||||
cGL::init();
|
||||
Renderer::init();
|
||||
|
||||
std::string vs( EEGLES2_SHADER_BASE_VS );
|
||||
std::string fs( EEGLES2_SHADER_BASE_FS );
|
||||
@@ -303,7 +303,7 @@ void RendererGLES2::enable( unsigned int cap ) {
|
||||
{
|
||||
mPointSpriteEnabled = 1;
|
||||
|
||||
//cGL::Enable( GL_VERTEX_PROGRAM_POINT_SIZE );
|
||||
//Renderer::Enable( GL_VERTEX_PROGRAM_POINT_SIZE );
|
||||
|
||||
setShader( EEGLES2_SHADER_POINTSPRITE );
|
||||
|
||||
@@ -311,7 +311,7 @@ void RendererGLES2::enable( unsigned int cap ) {
|
||||
}
|
||||
}
|
||||
|
||||
cGL::enable( cap );
|
||||
Renderer::enable( cap );
|
||||
}
|
||||
|
||||
void RendererGLES2::disable ( unsigned int cap ) {
|
||||
@@ -351,7 +351,7 @@ void RendererGLES2::disable ( unsigned int cap ) {
|
||||
{
|
||||
mPointSpriteEnabled = 0;
|
||||
|
||||
//cGL::Disable( GL_VERTEX_PROGRAM_POINT_SIZE );
|
||||
//Renderer::Disable( GL_VERTEX_PROGRAM_POINT_SIZE );
|
||||
|
||||
setShader( EEGLES2_SHADER_BASE );
|
||||
|
||||
@@ -359,7 +359,7 @@ void RendererGLES2::disable ( unsigned int cap ) {
|
||||
}
|
||||
}
|
||||
|
||||
cGL::disable( cap );
|
||||
Renderer::disable( cap );
|
||||
}
|
||||
|
||||
void RendererGLES2::enableClientState( unsigned int array ) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <eepp/graphics/shader.hpp>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/renderer/renderergl3.hpp>
|
||||
#include <eepp/graphics/renderer/renderergl3cp.hpp>
|
||||
#include <eepp/graphics/renderer/renderergles2.hpp>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <eepp/graphics/shaderprogram.hpp>
|
||||
#include <eepp/graphics/shaderprogrammanager.hpp>
|
||||
#include <eepp/graphics/globalbatchrenderer.hpp>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#include <eepp/graphics/subtexture.hpp>
|
||||
#include <eepp/graphics/texturefactory.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/helper/SOIL2/src/SOIL2/SOIL2.h>
|
||||
#include <eepp/helper/jpeg-compressor/jpge.h>
|
||||
#include <eepp/graphics/texturesaver.hpp>
|
||||
#include <eepp/graphics/renderer/opengl.hpp>
|
||||
using namespace EE::Graphics::Private;
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <eepp/graphics/text.hpp>
|
||||
#include <eepp/graphics/texture.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/renderer/opengl.hpp>
|
||||
#include <eepp/graphics/globalbatchrenderer.hpp>
|
||||
#include <eepp/graphics/texturefactory.hpp>
|
||||
#include <cmath>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#include <eepp/graphics/texturefactory.hpp>
|
||||
#include <eepp/graphics/globalbatchrenderer.hpp>
|
||||
#include <eepp/helper/SOIL2/src/SOIL2/SOIL2.h>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/math/polygon2.hpp>
|
||||
#include <eepp/graphics/texturesaver.hpp>
|
||||
using namespace EE::Graphics::Private;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <eepp/graphics/texturefactory.hpp>
|
||||
#include <eepp/graphics/textureloader.hpp>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/texture.hpp>
|
||||
#include <eepp/helper/SOIL2/src/SOIL2/stb_image.h>
|
||||
#include <eepp/helper/SOIL2/src/SOIL2/SOIL2.h>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#include <eepp/graphics/texture.hpp>
|
||||
#include <eepp/graphics/texturefactory.hpp>
|
||||
#include <eepp/window/engine.hpp>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/opengl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/system/iostreamfile.hpp>
|
||||
#include <eepp/helper/SOIL2/src/SOIL2/stb_image.h>
|
||||
#include <eepp/helper/SOIL2/src/SOIL2/SOIL2.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <eepp/graphics/texturesaver.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/opengl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
|
||||
namespace EE { namespace Graphics { namespace Private {
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define EE_GRAPHICSCTEXTURESAVER_HPP
|
||||
|
||||
#include <eepp/config.hpp>
|
||||
#include <eepp/graphics/opengl.hpp>
|
||||
|
||||
namespace EE { namespace Graphics { namespace Private {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <eepp/graphics/vertexbuffer.hpp>
|
||||
#include <eepp/graphics/vertexbufferogl.hpp>
|
||||
#include <eepp/graphics/vertexbuffervbo.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/vertexbuffermanager.hpp>
|
||||
using namespace EE::Graphics::Private;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <eepp/graphics/vertexbufferogl.hpp>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <eepp/graphics/vertexbuffervbo.hpp>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/renderer/renderergl3.hpp>
|
||||
#include <eepp/graphics/renderer/renderergl3cp.hpp>
|
||||
#include <eepp/graphics/renderer/renderergles2.hpp>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <eepp/physics/constraints/dampedspring.hpp>
|
||||
|
||||
#ifdef PHYSICS_RENDERER_ENABLED
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/opengl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/globalbatchrenderer.hpp>
|
||||
using namespace EE::Graphics;
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <eepp/helper/chipmunk/chipmunk_unsafe.h>
|
||||
|
||||
#ifdef PHYSICS_RENDERER_ENABLED
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/primitives.hpp>
|
||||
using namespace EE::Graphics;
|
||||
#endif
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include <eepp/helper/chipmunk/chipmunk_unsafe.h>
|
||||
|
||||
#ifdef PHYSICS_RENDERER_ENABLED
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/opengl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/primitives.hpp>
|
||||
using namespace EE::Graphics;
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <eepp/ui/uimanager.hpp>
|
||||
#include <eepp/graphics/primitives.hpp>
|
||||
#include <eepp/graphics/subtexture.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/font.hpp>
|
||||
#include <eepp/window/engine.hpp>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <eepp/ui/uicontrolanim.hpp>
|
||||
#include <eepp/ui/uimanager.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/globalbatchrenderer.hpp>
|
||||
#include <eepp/graphics/primitives.hpp>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <eepp/ui/uitabwidget.hpp>
|
||||
#include <eepp/ui/uimanager.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/primitives.hpp>
|
||||
#include <eepp/graphics/fontmanager.hpp>
|
||||
#include <eepp/helper/pugixml/pugixml.hpp>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <eepp/ui/uitextinput.hpp>
|
||||
#include <eepp/ui/uimanager.hpp>
|
||||
#include <eepp/window/engine.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/primitives.hpp>
|
||||
#include <eepp/graphics/font.hpp>
|
||||
#include <eepp/graphics/text.hpp>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <eepp/graphics/vertexbuffermanager.hpp>
|
||||
#include <eepp/graphics/framebuffermanager.hpp>
|
||||
#include <eepp/graphics/texturefactory.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
|
||||
#if EE_PLATFORM == EE_PLATFORM_ANDROID
|
||||
#include <eepp/system/zip.hpp>
|
||||
@@ -227,9 +227,9 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) {
|
||||
|
||||
SDL_GL_MakeCurrent( mSDLWindow, mGLContext );
|
||||
|
||||
if ( NULL == cGL::existsSingleton() ) {
|
||||
cGL::createSingleton( mWindow.ContextConfig.Version );
|
||||
cGL::instance()->init();
|
||||
if ( NULL == Renderer::existsSingleton() ) {
|
||||
Renderer::createSingleton( mWindow.ContextConfig.Version );
|
||||
Renderer::instance()->init();
|
||||
}
|
||||
|
||||
createPlatform();
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <eepp/window/backend/SFML/cursormanagersfml.hpp>
|
||||
#include <eepp/window/platform/platformimpl.hpp>
|
||||
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
|
||||
namespace EE { namespace Window { namespace Backend { namespace SFML {
|
||||
|
||||
@@ -68,9 +68,9 @@ bool WindowSFML::create( WindowSettings Settings, ContextSettings Context ) {
|
||||
|
||||
mSFMLWindow.setVerticalSyncEnabled( Context.VSync );
|
||||
|
||||
if ( NULL == cGL::existsSingleton() ) {
|
||||
cGL::createSingleton( mWindow.ContextConfig.Version );
|
||||
cGL::instance()->init();
|
||||
if ( NULL == Renderer::existsSingleton() ) {
|
||||
Renderer::createSingleton( mWindow.ContextConfig.Version );
|
||||
Renderer::instance()->init();
|
||||
}
|
||||
|
||||
createPlatform();
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <eepp/window/backend.hpp>
|
||||
#include <eepp/window/backend/SDL2/backendsdl2.hpp>
|
||||
#include <eepp/window/backend/SFML/backendsfml.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
|
||||
#define BACKEND_SDL2 1
|
||||
#define BACKEND_SFML 2
|
||||
@@ -60,7 +60,7 @@ Engine::~Engine() {
|
||||
|
||||
UI::UIManager::destroySingleton();
|
||||
|
||||
Graphics::cGL::destroySingleton();
|
||||
Graphics::Renderer::destroySingleton();
|
||||
|
||||
ShaderProgramManager::destroySingleton();
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#include <eepp/window/platform/null/nullimpl.hpp>
|
||||
#include <eepp/window/platformimpl.hpp>
|
||||
#include <eepp/window/engine.hpp>
|
||||
#include <eepp/graphics/glextensions.hpp>
|
||||
#include <eepp/graphics/renderer/gl.hpp>
|
||||
#include <eepp/graphics/renderer/openglext.hpp>
|
||||
#include <eepp/graphics/renderer/renderer.hpp>
|
||||
#include <eepp/graphics/texturefactory.hpp>
|
||||
#include <eepp/graphics/globalbatchrenderer.hpp>
|
||||
#include <eepp/system/filesystem.hpp>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <eepp/ee.hpp>
|
||||
#include <eepp/graphics/opengl.hpp>
|
||||
#include <eepp/graphics/renderer/opengl.hpp>
|
||||
|
||||
/// This example is based on the WebGL demo from http://minimal.be/lab/fluGL/
|
||||
namespace Demo_ExternalShader {
|
||||
|
||||
Reference in New Issue
Block a user