More changes to painter
This commit is contained in:
		
							parent
							
								
									3eeb5ae890
								
							
						
					
					
						commit
						90d2032e9e
					
				|  | @ -38,3 +38,4 @@ LOCALTODO | |||
| tags | ||||
| Thumbs.db | ||||
| .directory | ||||
| src/framework/graphics/dx/ | ||||
|  |  | |||
|  | @ -36,7 +36,7 @@ | |||
| #include <framework/core/clock.h> | ||||
| 
 | ||||
| #include <framework/graphics/paintershaderprogram.h> | ||||
| #include <framework/graphics/painterogl2_shadersources.h> | ||||
| #include <framework/graphics/ogl/painterogl2_shadersources.h> | ||||
| #include <framework/graphics/texturemanager.h> | ||||
| #include <framework/graphics/framebuffermanager.h> | ||||
| #include "spritemanager.h" | ||||
|  |  | |||
|  | @ -25,7 +25,7 @@ | |||
| 
 | ||||
| #include "declarations.h" | ||||
| #include <framework/graphics/declarations.h> | ||||
| #include <framework/graphics/painterogl.h> | ||||
| #include <framework/graphics/painter.h> | ||||
| #include "thingtype.h" | ||||
| 
 | ||||
| struct LightSource { | ||||
|  |  | |||
|  | @ -23,7 +23,7 @@ | |||
| #include "shadermanager.h" | ||||
| #include <framework/graphics/paintershaderprogram.h> | ||||
| #include <framework/graphics/graphics.h> | ||||
| #include <framework/graphics/painterogl2_shadersources.h> | ||||
| #include <framework/graphics/ogl/painterogl2_shadersources.h> | ||||
| #include <framework/core/resourcemanager.h> | ||||
| 
 | ||||
| ShaderManager g_shaders; | ||||
|  |  | |||
|  | @ -311,6 +311,10 @@ if(FRAMEWORK_GRAPHICS) | |||
|             set(framework_DEFINITIONS ${framework_DEFINITIONS} -DDIRECTX) | ||||
|             set(framework_INCLUDE_DIRS ${framework_INCLUDE_DIRS} ${DirectX_INCLUDE_DIR}) | ||||
|             set(framework_LIBRARIES ${framework_LIBRARIES} ${DirectX_LIBRARY} ${DirectX_LIBRARIES}) | ||||
|             set(framework_SOURCES ${framework_SOURCES} | ||||
|                 ${CMAKE_CURRENT_LIST_DIR}/graphics/dx/painterdx9.cpp | ||||
|                 ${CMAKE_CURRENT_LIST_DIR}/graphics/dx/painterdx9.h | ||||
|             ) | ||||
|         endif() | ||||
| 
 | ||||
|     else() | ||||
|  | @ -342,15 +346,13 @@ if(FRAMEWORK_GRAPHICS) | |||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/image.h | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/painter.cpp | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/painter.h | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl.cpp | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl.h | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl1.cpp | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl1.h | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl2.cpp | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl2.h | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/painterdx9.cpp | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/painterdx9.h | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl2_shadersources.h | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/ogl/painterogl.cpp | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/ogl/painterogl.h | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/ogl/painterogl1.cpp | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/ogl/painterogl1.h | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/ogl/painterogl2.cpp | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/ogl/painterogl2.h | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/ogl/painterogl2_shadersources.h | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/paintershaderprogram.cpp | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/paintershaderprogram.h | ||||
|         ${CMAKE_CURRENT_LIST_DIR}/graphics/particleaffector.cpp | ||||
|  |  | |||
|  | @ -23,16 +23,16 @@ | |||
| #include "fontmanager.h" | ||||
| 
 | ||||
| #if OPENGL_ES==2 | ||||
| #include "painterogl2.h" | ||||
| #include "ogl/painterogl2.h" | ||||
| #elif OPENGL_ES==1 | ||||
| #include "painterogl1.h" | ||||
| #include "ogl/painterogl1.h" | ||||
| #else | ||||
| #include "painterogl1.h" | ||||
| #include "painterogl2.h" | ||||
| #include "ogl/painterogl1.h" | ||||
| #include "ogl/painterogl2.h" | ||||
| #endif | ||||
| 
 | ||||
| #if defined(WIN32) && defined(DIRECTX) | ||||
| #include "painterdx9.h" | ||||
| #include "dx/painterdx9.h" | ||||
| #endif | ||||
| 
 | ||||
| #include <framework/graphics/graphics.h> | ||||
|  | @ -184,8 +184,8 @@ bool Graphics::isPainterEngineAvailable(Graphics::PainterEngine painterEngine) | |||
| 
 | ||||
| bool Graphics::selectPainterEngine(PainterEngine painterEngine) | ||||
| { | ||||
|     PainterOGL *painter = nullptr; | ||||
|     PainterOGL *fallbackPainter = nullptr; | ||||
|     Painter *painter = nullptr; | ||||
|     Painter *fallbackPainter = nullptr; | ||||
|     PainterEngine fallbackPainterEngine = Painter_Any; | ||||
| 
 | ||||
| #ifdef PAINTER_DX9 | ||||
|  |  | |||
|  | @ -21,8 +21,7 @@ | |||
|  */ | ||||
| 
 | ||||
| #include "painterogl.h" | ||||
| #include "graphics.h" | ||||
| 
 | ||||
| #include <framework/graphics/graphics.h> | ||||
| #include <framework/platform/platformwindow.h> | ||||
| 
 | ||||
| PainterOGL::PainterOGL() | ||||
|  | @ -23,11 +23,7 @@ | |||
| #ifndef PAINTEROGL_H | ||||
| #define PAINTEROGL_H | ||||
| 
 | ||||
| #include "declarations.h" | ||||
| #include "coordsbuffer.h" | ||||
| #include "paintershaderprogram.h" | ||||
| #include "texture.h" | ||||
| #include "painter.h" | ||||
| #include <framework/graphics/painter.h> | ||||
| 
 | ||||
| class PainterOGL : public Painter | ||||
| { | ||||
|  | @ -23,7 +23,7 @@ | |||
| #if !defined(OPENGL_ES) || OPENGL_ES==1 | ||||
| 
 | ||||
| #include "painterogl1.h" | ||||
| #include "graphics.h" | ||||
| #include <framework/graphics/graphics.h> | ||||
| 
 | ||||
| PainterOGL1 *g_painterOGL1 = nullptr; | ||||
| 
 | ||||
|  | @ -21,8 +21,6 @@ | |||
|  */ | ||||
| 
 | ||||
| #include "painterogl2.h" | ||||
| #include "texture.h" | ||||
| #include "graphics.h" | ||||
| #include "painterogl2_shadersources.h" | ||||
| #include <framework/platform/platformwindow.h> | ||||
| 
 | ||||
|  | @ -23,10 +23,10 @@ | |||
| #ifndef PAINTER_H | ||||
| #define PAINTER_H | ||||
| 
 | ||||
| #include "declarations.h" | ||||
| #include "coordsbuffer.h" | ||||
| #include "paintershaderprogram.h" | ||||
| #include "texture.h" | ||||
| #include <framework/graphics/declarations.h> | ||||
| #include <framework/graphics/coordsbuffer.h> | ||||
| #include <framework/graphics/paintershaderprogram.h> | ||||
| #include <framework/graphics/texture.h> | ||||
| 
 | ||||
| class Painter | ||||
| { | ||||
|  |  | |||
|  | @ -1,34 +0,0 @@ | |||
| /*
 | ||||
|  * Copyright (c) 2010-2013 OTClient <https://github.com/edubart/otclient>
 | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
|  * of this software and associated documentation files (the "Software"), to deal | ||||
|  * in the Software without restriction, including without limitation the rights | ||||
|  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||||
|  * copies of the Software, and to permit persons to whom the Software is | ||||
|  * furnished to do so, subject to the following conditions: | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included in | ||||
|  * all copies or substantial portions of the Software. | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||
|  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||||
|  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||
|  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||||
|  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||||
|  * THE SOFTWARE. | ||||
|  */ | ||||
| 
 | ||||
| #if defined(WIN32) && defined(DIRECTX) | ||||
| 
 | ||||
| #include "painterdx9.h" | ||||
| #include "graphics.h" | ||||
| 
 | ||||
| PainterDX9 *g_painterDX9 = nullptr; | ||||
| 
 | ||||
| PainterDX9::PainterDX9() | ||||
| { | ||||
| } | ||||
| 
 | ||||
| #endif | ||||
|  | @ -1,58 +0,0 @@ | |||
| /*
 | ||||
|  * Copyright (c) 2010-2013 OTClient <https://github.com/edubart/otclient>
 | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
|  * of this software and associated documentation files (the "Software"), to deal | ||||
|  * in the Software without restriction, including without limitation the rights | ||||
|  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||||
|  * copies of the Software, and to permit persons to whom the Software is | ||||
|  * furnished to do so, subject to the following conditions: | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included in | ||||
|  * all copies or substantial portions of the Software. | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||
|  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||||
|  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||
|  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||||
|  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||||
|  * THE SOFTWARE. | ||||
|  */ | ||||
| 
 | ||||
| #ifndef PAINTERDX9_H | ||||
| #define PAINTERDX9_H | ||||
| 
 | ||||
| #define PAINTER_DX9 | ||||
| 
 | ||||
| #include "painter.h" | ||||
| 
 | ||||
| /**
 | ||||
|  * Painter using DirectX9 fixed-function rendering pipeline. | ||||
|  */ | ||||
| class PainterDX9 : public Painter | ||||
| { | ||||
| public: | ||||
|     PainterDX9(); | ||||
| 
 | ||||
|     void bind() {} | ||||
|     void unbind() {} | ||||
| 
 | ||||
|     void refreshState() {} | ||||
| 
 | ||||
|     void drawCoords(CoordsBuffer& coordsBuffer, DrawMode drawMode = Triangles) {} | ||||
|     void drawTextureCoords(CoordsBuffer& coordsBuffer, const TexturePtr& texture) {} | ||||
|     void drawTexturedRect(const Rect& dest, const TexturePtr& texture, const Rect& src) {} | ||||
|     void drawUpsideDownTexturedRect(const Rect& dest, const TexturePtr& texture, const Rect& src) {} | ||||
|     void drawRepeatedTexturedRect(const Rect& dest, const TexturePtr& texture, const Rect& src) {} | ||||
|     void drawFilledRect(const Rect& dest) {} | ||||
|     void drawFilledTriangle(const Point& a, const Point& b, const Point& c) {} | ||||
|     void drawBoundingRect(const Rect& dest, int innerLineWidth) {} | ||||
| 
 | ||||
|     bool hasShaders() { return false; } | ||||
| 
 | ||||
| }; | ||||
| 
 | ||||
| extern PainterDX9 *g_painterDX9; | ||||
| 
 | ||||
| #endif | ||||
|  | @ -24,7 +24,7 @@ | |||
| #define PARTICLE_H | ||||
| 
 | ||||
| #include "declarations.h" | ||||
| #include "painterogl.h" | ||||
| #include "painter.h" | ||||
| 
 | ||||
| class Particle : public stdext::shared_object | ||||
| { | ||||
|  |  | |||
|  | @ -24,7 +24,7 @@ | |||
| #define PARTICLETYPE_H | ||||
| 
 | ||||
| #include "declarations.h" | ||||
| #include <framework/graphics/painterogl.h> | ||||
| #include <framework/graphics/painter.h> | ||||
| #include <framework/luaengine/luaobject.h> | ||||
| #include <framework/otml/otml.h> | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Henrique Santiago
						Henrique Santiago