Show shader.h syntax highlighted
/***************************************************************************
shader-arb.h - ARB vertex/fragment programs
-------------------
begin : Mon Jan 5 2004
copyright : (C) 2004 by Reality Rift Studios
email : mattias@realityrift.com
last modify date : Mon Sep 20 2004
last modify : GLSL manager
l.m. copyright : (C) 2004 by Arcadia Design s.r.l.
email : Dario Deledda (penguindark@hotmail.com)
***************************************************************************
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is the NeoEngine, NeoDevOpenGL, shader-arb.h
The Initial Developer of the Original Code is Mattias Jansson.
Portions created by Mattias Jansson are Copyright (C) 2004
Reality Rift Studios. All Rights Reserved.
Contributors: Dario Deledda (penguindark@hotmail.com)
***************************************************************************/
#ifndef __NEOGLSHADER_H
#define __NEOGLSHADER_H
#include "device.h"
#include <neoengine/shader.h>
#include <neoengine/hashtable.h>
namespace NeoOGL
{
typedef NeoEngine::HashTable< class Shader > ShaderTable;
/**
* \brief OpenGL implementation of pipeline shaders
* \author Matt Holmes (kerion@houston.rr.com)
* \author Cody Russell (cody@jhu.edu)
* \author Mattias Jansson (mattias@realityrift.com)
*/
class Shader : public NeoEngine::Shader
{
friend class Device;
friend class VertexBufferManager;
friend class VertexBufferManagerGLSL;
protected:
/*! Program shader table */
static ShaderTable s_kPSTable;
/*! Render device */
Device *m_pkDevice;
/*! Flag indicating we have been compiled and linked*/
bool m_bIsCompiled;
public:
/**
* \param pkDevice Render device
* \param eType Shader type
* \param rstrName Shader name
* \param pkShaderPool Ptr to shader pool
* \param pkFileManager Filemananger, null if default
*/
//Shader( Device *pkDevice, SHADERTYPE eType, NeoEngine::FileManager *pkFileManager = 0 );
Shader( Device *pkDevice,
SHADERTYPE eType,
const std::string &rstrName,
NeoEngine::ShaderPool *pkShaderPool,
NeoEngine::FileManager *pkFileManager = 0 );
/**
*/
virtual ~Shader();
/**
* Set name of shader
* \param rstrName New name
*/
virtual void SetName( const NeoEngine::HashString &rstrName );
/**
* Bind this pipeline shader and parameters, performing OpenGL specific operations
* \param pkPrimitive Primitive currently processing
* \return True if bound, or false if error
*/
virtual bool Bind( NeoEngine::RenderPrimitive *pkPrimitive ) = 0;
/**
* Bind light parameters
* \param pkPrimitive Primitive currently processing
* \return True if bound, or false if error
*/
virtual bool BindLightParams( NeoEngine::RenderPrimitive *pkPrimitive ) = 0;
/**
* Disable shader
* \return True if successful, false if error
*/
virtual bool Unbind() = 0;
};
#ifdef WIN32
# ifdef _MSC_VER
# pragma warning( disable : 4786 )
# if ( _MSC_VER >= 1300 )
typedef NeoEngine::Pointer< Shader > ShaderPtr;
EXPIMP_TEMPLATE template class NEOENGINE_API NeoEngine::Pointer< Shader >;
EXPIMP_TEMPLATE template class NEOENGINE_API std::allocator< NeoEngine::Pointer< Shader > >;
EXPIMP_TEMPLATE template class NEOENGINE_API std::vector< NeoEngine::Pointer< Shader > >;
# elif defined(_MSC_VER)
typedef NeoEngine::Pointer< Shader > ShaderPtr;
EXPIMP_TEMPLATE template class NEOENGINE_API NeoEngine::Pointer< Shader >;
EXPIMP_TEMPLATE template class NEOENGINE_API std::vector< NeoEngine::Pointer< Shader > >
# endif
# else if defined __MINGW32__
typedef NeoEngine::Pointer< Shader > ShaderPtr;
# endif
#else
typedef NeoEngine::Pointer< Shader > ShaderPtr;
#endif
};
#endif
See more files for this project here