More changes to painter

This commit is contained in:
Henrique Santiago 2013-02-22 03:31:13 -03:00
parent 3eeb5ae890
commit 90d2032e9e
18 changed files with 31 additions and 127 deletions

1
.gitignore vendored
View File

@ -38,3 +38,4 @@ LOCALTODO
tags tags
Thumbs.db Thumbs.db
.directory .directory
src/framework/graphics/dx/

View File

@ -36,7 +36,7 @@
#include <framework/core/clock.h> #include <framework/core/clock.h>
#include <framework/graphics/paintershaderprogram.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/texturemanager.h>
#include <framework/graphics/framebuffermanager.h> #include <framework/graphics/framebuffermanager.h>
#include "spritemanager.h" #include "spritemanager.h"

View File

@ -25,7 +25,7 @@
#include "declarations.h" #include "declarations.h"
#include <framework/graphics/declarations.h> #include <framework/graphics/declarations.h>
#include <framework/graphics/painterogl.h> #include <framework/graphics/painter.h>
#include "thingtype.h" #include "thingtype.h"
struct LightSource { struct LightSource {

View File

@ -23,7 +23,7 @@
#include "shadermanager.h" #include "shadermanager.h"
#include <framework/graphics/paintershaderprogram.h> #include <framework/graphics/paintershaderprogram.h>
#include <framework/graphics/graphics.h> #include <framework/graphics/graphics.h>
#include <framework/graphics/painterogl2_shadersources.h> #include <framework/graphics/ogl/painterogl2_shadersources.h>
#include <framework/core/resourcemanager.h> #include <framework/core/resourcemanager.h>
ShaderManager g_shaders; ShaderManager g_shaders;

View File

@ -311,6 +311,10 @@ if(FRAMEWORK_GRAPHICS)
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DDIRECTX) set(framework_DEFINITIONS ${framework_DEFINITIONS} -DDIRECTX)
set(framework_INCLUDE_DIRS ${framework_INCLUDE_DIRS} ${DirectX_INCLUDE_DIR}) set(framework_INCLUDE_DIRS ${framework_INCLUDE_DIRS} ${DirectX_INCLUDE_DIR})
set(framework_LIBRARIES ${framework_LIBRARIES} ${DirectX_LIBRARY} ${DirectX_LIBRARIES}) 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() endif()
else() else()
@ -342,15 +346,13 @@ if(FRAMEWORK_GRAPHICS)
${CMAKE_CURRENT_LIST_DIR}/graphics/image.h ${CMAKE_CURRENT_LIST_DIR}/graphics/image.h
${CMAKE_CURRENT_LIST_DIR}/graphics/painter.cpp ${CMAKE_CURRENT_LIST_DIR}/graphics/painter.cpp
${CMAKE_CURRENT_LIST_DIR}/graphics/painter.h ${CMAKE_CURRENT_LIST_DIR}/graphics/painter.h
${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl.cpp ${CMAKE_CURRENT_LIST_DIR}/graphics/ogl/painterogl.cpp
${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl.h ${CMAKE_CURRENT_LIST_DIR}/graphics/ogl/painterogl.h
${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl1.cpp ${CMAKE_CURRENT_LIST_DIR}/graphics/ogl/painterogl1.cpp
${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl1.h ${CMAKE_CURRENT_LIST_DIR}/graphics/ogl/painterogl1.h
${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl2.cpp ${CMAKE_CURRENT_LIST_DIR}/graphics/ogl/painterogl2.cpp
${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl2.h ${CMAKE_CURRENT_LIST_DIR}/graphics/ogl/painterogl2.h
${CMAKE_CURRENT_LIST_DIR}/graphics/painterdx9.cpp ${CMAKE_CURRENT_LIST_DIR}/graphics/ogl/painterogl2_shadersources.h
${CMAKE_CURRENT_LIST_DIR}/graphics/painterdx9.h
${CMAKE_CURRENT_LIST_DIR}/graphics/painterogl2_shadersources.h
${CMAKE_CURRENT_LIST_DIR}/graphics/paintershaderprogram.cpp ${CMAKE_CURRENT_LIST_DIR}/graphics/paintershaderprogram.cpp
${CMAKE_CURRENT_LIST_DIR}/graphics/paintershaderprogram.h ${CMAKE_CURRENT_LIST_DIR}/graphics/paintershaderprogram.h
${CMAKE_CURRENT_LIST_DIR}/graphics/particleaffector.cpp ${CMAKE_CURRENT_LIST_DIR}/graphics/particleaffector.cpp

View File

@ -23,16 +23,16 @@
#include "fontmanager.h" #include "fontmanager.h"
#if OPENGL_ES==2 #if OPENGL_ES==2
#include "painterogl2.h" #include "ogl/painterogl2.h"
#elif OPENGL_ES==1 #elif OPENGL_ES==1
#include "painterogl1.h" #include "ogl/painterogl1.h"
#else #else
#include "painterogl1.h" #include "ogl/painterogl1.h"
#include "painterogl2.h" #include "ogl/painterogl2.h"
#endif #endif
#if defined(WIN32) && defined(DIRECTX) #if defined(WIN32) && defined(DIRECTX)
#include "painterdx9.h" #include "dx/painterdx9.h"
#endif #endif
#include <framework/graphics/graphics.h> #include <framework/graphics/graphics.h>
@ -184,8 +184,8 @@ bool Graphics::isPainterEngineAvailable(Graphics::PainterEngine painterEngine)
bool Graphics::selectPainterEngine(PainterEngine painterEngine) bool Graphics::selectPainterEngine(PainterEngine painterEngine)
{ {
PainterOGL *painter = nullptr; Painter *painter = nullptr;
PainterOGL *fallbackPainter = nullptr; Painter *fallbackPainter = nullptr;
PainterEngine fallbackPainterEngine = Painter_Any; PainterEngine fallbackPainterEngine = Painter_Any;
#ifdef PAINTER_DX9 #ifdef PAINTER_DX9

View File

@ -21,8 +21,7 @@
*/ */
#include "painterogl.h" #include "painterogl.h"
#include "graphics.h" #include <framework/graphics/graphics.h>
#include <framework/platform/platformwindow.h> #include <framework/platform/platformwindow.h>
PainterOGL::PainterOGL() PainterOGL::PainterOGL()

View File

@ -23,11 +23,7 @@
#ifndef PAINTEROGL_H #ifndef PAINTEROGL_H
#define PAINTEROGL_H #define PAINTEROGL_H
#include "declarations.h" #include <framework/graphics/painter.h>
#include "coordsbuffer.h"
#include "paintershaderprogram.h"
#include "texture.h"
#include "painter.h"
class PainterOGL : public Painter class PainterOGL : public Painter
{ {

View File

@ -23,7 +23,7 @@
#if !defined(OPENGL_ES) || OPENGL_ES==1 #if !defined(OPENGL_ES) || OPENGL_ES==1
#include "painterogl1.h" #include "painterogl1.h"
#include "graphics.h" #include <framework/graphics/graphics.h>
PainterOGL1 *g_painterOGL1 = nullptr; PainterOGL1 *g_painterOGL1 = nullptr;

View File

@ -21,8 +21,6 @@
*/ */
#include "painterogl2.h" #include "painterogl2.h"
#include "texture.h"
#include "graphics.h"
#include "painterogl2_shadersources.h" #include "painterogl2_shadersources.h"
#include <framework/platform/platformwindow.h> #include <framework/platform/platformwindow.h>

View File

@ -23,10 +23,10 @@
#ifndef PAINTER_H #ifndef PAINTER_H
#define PAINTER_H #define PAINTER_H
#include "declarations.h" #include <framework/graphics/declarations.h>
#include "coordsbuffer.h" #include <framework/graphics/coordsbuffer.h>
#include "paintershaderprogram.h" #include <framework/graphics/paintershaderprogram.h>
#include "texture.h" #include <framework/graphics/texture.h>
class Painter class Painter
{ {

View File

@ -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

View File

@ -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

View File

@ -24,7 +24,7 @@
#define PARTICLE_H #define PARTICLE_H
#include "declarations.h" #include "declarations.h"
#include "painterogl.h" #include "painter.h"
class Particle : public stdext::shared_object class Particle : public stdext::shared_object
{ {

View File

@ -24,7 +24,7 @@
#define PARTICLETYPE_H #define PARTICLETYPE_H
#include "declarations.h" #include "declarations.h"
#include <framework/graphics/painterogl.h> #include <framework/graphics/painter.h>
#include <framework/luaengine/luaobject.h> #include <framework/luaengine/luaobject.h>
#include <framework/otml/otml.h> #include <framework/otml/otml.h>