- removed deprecated gl2 code as it was not used
This commit is contained in:
parent
b9d6b38e8f
commit
209458adee
|
@ -1,74 +0,0 @@
|
|||
// ==============================================================
|
||||
// This file is part of Glest (www.glest.org)
|
||||
//
|
||||
// Copyright (C) 2001-2008 Martiño Figueroa
|
||||
//
|
||||
// You can redistribute this code and/or modify it under
|
||||
// the terms of the GNU General Public License as published
|
||||
// by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version
|
||||
// ==============================================================
|
||||
|
||||
#ifndef _SHARED_GRAPHICS_GL_GRAPHICSFACTORYGL2_H_
|
||||
#define _SHARED_GRAPHICS_GL_GRAPHICSFACTORYGL2_H_
|
||||
|
||||
#include "texture_manager.h"
|
||||
#include "model_manager.h"
|
||||
#include "font_manager.h"
|
||||
#include "particle.h"
|
||||
#include "graphics_factory.h"
|
||||
#include "text_renderer_gl.h"
|
||||
#include "model_renderer_gl.h"
|
||||
#include "particle_renderer_gl.h"
|
||||
#include "context_gl.h"
|
||||
#include "model_gl.h"
|
||||
#include "texture_gl.h"
|
||||
#include "font_gl.h"
|
||||
#include "shader_gl.h"
|
||||
#include "shader_manager.h"
|
||||
#include "leak_dumper.h"
|
||||
|
||||
namespace Shared{ namespace Graphics{ namespace Gl{
|
||||
|
||||
// =====================================================
|
||||
// class GraphicsFactoryGl
|
||||
// =====================================================
|
||||
|
||||
class GraphicsFactoryGl2: public GraphicsFactory{
|
||||
public:
|
||||
//context
|
||||
virtual Context *newContext() {return new ContextGl();}
|
||||
|
||||
//textures
|
||||
virtual TextureManager *newTextureManager() {return new TextureManager();}
|
||||
virtual Texture1D *newTexture1D() {return new Texture1DGl();}
|
||||
virtual Texture2D *newTexture2D() {return new Texture2DGl();}
|
||||
virtual Texture3D *newTexture3D() {return new Texture3DGl();}
|
||||
virtual TextureCube *newTextureCube() {return new TextureCubeGl();}
|
||||
|
||||
//models
|
||||
virtual ModelManager *newModelManager() {return new ModelManager();}
|
||||
virtual ModelRenderer *newModelRenderer() {return new ModelRendererGl();}
|
||||
virtual Model *newModel() {return new ModelGl();}
|
||||
|
||||
//text
|
||||
virtual FontManager *newFontManager() {return new FontManager();}
|
||||
virtual TextRenderer2D *newTextRenderer2D() {return new TextRenderer2DGl();}
|
||||
virtual TextRenderer3D *newTextRenderer3D() {return new TextRenderer3DGl();}
|
||||
virtual Font2D *newFont2D() {return new Font2DGl();}
|
||||
virtual Font3D *newFont3D() {return new Font3DGl();}
|
||||
|
||||
//particles
|
||||
virtual ParticleManager *newParticleManager() {return new ParticleManager();}
|
||||
virtual ParticleRenderer *newParticleRenderer() {return new ParticleRendererGl();}
|
||||
|
||||
//shaders
|
||||
virtual ShaderManager *newShaderManager() {return new ShaderManager();}
|
||||
virtual ShaderProgram *newShaderProgram() {return new ShaderProgramGl();}
|
||||
virtual VertexShader *newVertexShader() {return new VertexShaderGl();}
|
||||
virtual FragmentShader *newFragmentShader() {return new FragmentShaderGl();}
|
||||
};
|
||||
|
||||
}}}//end namespace
|
||||
|
||||
#endif
|
|
@ -1,72 +0,0 @@
|
|||
// ==============================================================
|
||||
// This file is part of Glest (www.glest.org)
|
||||
//
|
||||
// Copyright (C) 2001-2008 Martiño Figueroa
|
||||
//
|
||||
// You can redistribute this code and/or modify it under
|
||||
// the terms of the GNU General Public License as published
|
||||
// by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version
|
||||
// ==============================================================
|
||||
|
||||
#ifndef _SHARED_GRAPHICS_GL_GRAPHICSFACTORYGL2_H_
|
||||
#define _SHARED_GRAPHICS_GL_GRAPHICSFACTORYGL2_H_
|
||||
|
||||
#include "texture_manager.h"
|
||||
#include "model_manager.h"
|
||||
#include "particle_manager.h"
|
||||
#include "font_manager.h"
|
||||
#include "graphics_factory.h"
|
||||
#include "text_renderer_gl.h"
|
||||
#include "model_renderer_gl.h"
|
||||
#include "particle_renderer_gl.h"
|
||||
#include "context_gl.h"
|
||||
#include "model_gl.h"
|
||||
#include "texture_gl.h"
|
||||
#include "font_gl.h"
|
||||
#include "shader_gl.h"
|
||||
|
||||
namespace Shared{ namespace Graphics{ namespace Gl{
|
||||
|
||||
// =====================================================
|
||||
// class GraphicsFactoryGl
|
||||
// =====================================================
|
||||
|
||||
class GraphicsFactoryGl: public GraphicsFactory{
|
||||
public:
|
||||
//context
|
||||
virtual Context *newContext() {return new ContextGl();}
|
||||
|
||||
//textures
|
||||
virtual TextureManager *newTextureManager() {return new TextureManager();}
|
||||
virtual Texture1D *newTexture1D() {return new Texture1DGl();}
|
||||
virtual Texture2D *newTexture2D() {return new Texture2DGl();}
|
||||
virtual Texture3D *newTexture3D() {return new Texture3DGl();}
|
||||
virtual TextureCube *newTextureCube() {return new TextureCubeGl();}
|
||||
|
||||
//models
|
||||
virtual ModelManager *newModelManager() {return new ModelManager();}
|
||||
virtual ModelRenderer *newModelRenderer() {return new ModelRendererGl();}
|
||||
virtual Model *newModel() {return new ModelGl();}
|
||||
|
||||
//text
|
||||
virtual FontManager *newFontManager() {return new FontManager();}
|
||||
virtual TextRenderer2D *newTextRenderer2D() {return new TextRenderer2DGl();}
|
||||
virtual TextRenderer3D *newTextRenderer3D() {return new TextRenderer3DGl();}
|
||||
virtual Font2D *newFont2D() {return new Font2DGl();}
|
||||
virtual Font3D *newFont3D() {return new Font3DGl();}
|
||||
|
||||
//particles
|
||||
virtual ParticleManager *newParticleManager() {return new ParticleManager();}
|
||||
virtual ParticleRenderer *newParticleRenderer() {return new ParticleRendererGl();}
|
||||
|
||||
//shaders
|
||||
virtual Shadermanager *newShadermanager() {return new ShaderManager();}
|
||||
virtual ShaderProgram *newShaderProgram() {return new ShaderProgramGl();}
|
||||
virtual VertexShader *newVertexShader() {return new VertexShaderGl();}
|
||||
virtual FragmentShader *newFragmentShader() {return new FragmentShaderGl();}
|
||||
};
|
||||
|
||||
}}}//end namespace
|
||||
|
||||
#endif
|
|
@ -1,110 +0,0 @@
|
|||
// ==============================================================
|
||||
// This file is part of Glest Shared Library (www.glest.org)
|
||||
//
|
||||
// Copyright (C) 2001-2008 Martiño Figueroa
|
||||
//
|
||||
// You can redistribute this code and/or modify it under
|
||||
// the terms of the GNU General Public License as published
|
||||
// by the Free Software Foundation; either version 2 of the
|
||||
// License, or (at your option) any later version
|
||||
// ==============================================================
|
||||
|
||||
#ifndef _SHARED_GRAPHICS_GL_SHADERGL_H_
|
||||
#define _SHARED_GRAPHICS_GL_SHADERGL_H_
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include "shader.h"
|
||||
#include "opengl.h"
|
||||
|
||||
using std::vector;
|
||||
using std::string;
|
||||
using std::pair;
|
||||
|
||||
namespace Shared{ namespace Graphics{ namespace Gl{
|
||||
|
||||
// =====================================================
|
||||
// class ShaderProgramGl
|
||||
// =====================================================
|
||||
|
||||
class ShaderProgramGl: public ShaderProgram{
|
||||
private:
|
||||
typedef pair<string, int> AttributePair;
|
||||
typedef vector<AttributePair> Attributes;
|
||||
|
||||
private:
|
||||
Attributes attributes;
|
||||
GLhandleARB handle;
|
||||
VertexShader *vertexShader;
|
||||
FragmentShader *fragmentShader;
|
||||
bool inited;
|
||||
|
||||
public:
|
||||
ShaderProgramGl();
|
||||
|
||||
GLhandleARB getHandle() const {return handle;}
|
||||
|
||||
virtual void init();
|
||||
virtual void end();
|
||||
|
||||
virtual void attach(VertexShader *vertexShader, FragmentShader *fragmentShader);
|
||||
virtual bool link(string &messages);
|
||||
virtual void activate();
|
||||
|
||||
virtual void setUniform(const string &name, int value);
|
||||
virtual void setUniform(const string &name, float value);
|
||||
virtual void setUniform(const string &name, const Vec2f &value);
|
||||
virtual void setUniform(const string &name, const Vec3f &value);
|
||||
virtual void setUniform(const string &name, const Vec4f &value);
|
||||
virtual void setUniform(const string &name, const Matrix3f &value);
|
||||
virtual void setUniform(const string &name, const Matrix4f &value);
|
||||
|
||||
void bindAttribute(const string &name, int index);
|
||||
|
||||
private:
|
||||
GLint getLocation(const string &name);
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
// class ShaderGl
|
||||
// =====================================================
|
||||
|
||||
class ShaderGl: virtual public Shader{
|
||||
protected:
|
||||
GLhandleARB handle;
|
||||
ShaderSource source;
|
||||
bool inited;
|
||||
|
||||
public:
|
||||
ShaderGl();
|
||||
|
||||
const ShaderSource *getSource() const {return &source;}
|
||||
GLhandleARB getHandle() const {return handle;}
|
||||
|
||||
virtual void load(const string &path);
|
||||
virtual bool compile(string &messages);
|
||||
virtual void end();
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
// class VertexShaderGl
|
||||
// =====================================================
|
||||
|
||||
class VertexShaderGl: public VertexShader, public ShaderGl{
|
||||
public:
|
||||
virtual void init();
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
// class FragmentShaderGl
|
||||
// =====================================================
|
||||
|
||||
class FragmentShaderGl: public FragmentShader, public ShaderGl{
|
||||
public:
|
||||
virtual void init();
|
||||
};
|
||||
|
||||
}}}//end namespace
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user