PixelLightAPI  .
ProgramAttribute.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: ProgramAttribute.h                             *
00003  *
00004  *  Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/)
00005  *
00006  *  This file is part of PixelLight.
00007  *
00008  *  PixelLight is free software: you can redistribute it and/or modify
00009  *  it under the terms of the GNU Lesser General Public License as published by
00010  *  the Free Software Foundation, either version 3 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  PixelLight is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  *  GNU Lesser General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Lesser General Public License
00019  *  along with PixelLight. If not, see <http://www.gnu.org/licenses/>.
00020 \*********************************************************/
00021 
00022 
00023 #ifndef __PLRENDERER_PROGRAMATTRIBUTE_H__
00024 #define __PLRENDERER_PROGRAMATTRIBUTE_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLRenderer/Renderer/VertexBuffer.h"
00032 
00033 
00034 //[-------------------------------------------------------]
00035 //[ Namespace                                             ]
00036 //[-------------------------------------------------------]
00037 namespace PLRenderer {
00038 
00039 
00040 //[-------------------------------------------------------]
00041 //[ Classes                                               ]
00042 //[-------------------------------------------------------]
00043 /**
00044 *  @brief
00045 *    Abstract renderer program attribute (also known as "varying parameter")
00046 *
00047 *  @note
00048 *    - For per-vertex data
00049 *    - It doesn't matter whether or not the program, the attribute is part of, is currently used for rendering
00050 */
00051 class ProgramAttribute {
00052 
00053 
00054     //[-------------------------------------------------------]
00055     //[ Public virtual ProgramAttribute functions             ]
00056     //[-------------------------------------------------------]
00057     public:
00058         /**
00059         *  @brief
00060         *    Sets a attribute by using an index to reference the vertex buffer attribute to use
00061         *
00062         *  @param[in] pVertexBuffer
00063         *    Vertex buffer to use, can be a null pointer
00064         *  @param[in] nIndex
00065         *    Index of the vertex buffer attribute to connect with the vertex shader attribute
00066         *
00067         *  @return
00068         *    'true' if all went fine, else 'false'
00069         */
00070         virtual bool Set(PLRenderer::VertexBuffer *pVertexBuffer, PLCore::uint32 nIndex) = 0;
00071 
00072         /**
00073         *  @brief
00074         *    Sets a attribute by using a semantic to reference the vertex buffer attribute to use
00075         *
00076         *  @param[in] pVertexBuffer
00077         *    Vertex buffer to use, can be a null pointer
00078         *  @param[in] nSemantic
00079         *    Semantic of the vertex buffer attribute to connect with the vertex shader attribute
00080         *  @param[in] nChannel
00081         *    Pipeline channel (see ESemantic, maximum see MaxPipelineChannels)
00082         *
00083         *  @return
00084         *    'true' if all went fine, else 'false'
00085         */
00086         virtual bool Set(PLRenderer::VertexBuffer *pVertexBuffer, PLRenderer::VertexBuffer::ESemantic nSemantic, PLCore::uint32 nChannel = 0) = 0;
00087 
00088 
00089     //[-------------------------------------------------------]
00090     //[ Protected functions                                   ]
00091     //[-------------------------------------------------------]
00092     protected:
00093         /**
00094         *  @brief
00095         *    Constructor
00096         */
00097         PLRENDERER_API ProgramAttribute();
00098 
00099         /**
00100         *  @brief
00101         *    Destructor
00102         */
00103         PLRENDERER_API virtual ~ProgramAttribute();
00104 
00105 
00106     //[-------------------------------------------------------]
00107     //[ Private functions                                     ]
00108     //[-------------------------------------------------------]
00109     private:
00110         /**
00111         *  @brief
00112         *    Copy constructor
00113         *
00114         *  @param[in] cSource
00115         *    Source to copy from
00116         */
00117         ProgramAttribute(const ProgramAttribute &cSource);
00118 
00119         /**
00120         *  @brief
00121         *    Copy operator
00122         *
00123         *  @param[in] cSource
00124         *    Source to copy from
00125         *
00126         *  @return
00127         *    Reference to this instance
00128         */
00129         ProgramAttribute &operator =(const ProgramAttribute &cSource);
00130 
00131 
00132 };
00133 
00134 
00135 //[-------------------------------------------------------]
00136 //[ Namespace                                             ]
00137 //[-------------------------------------------------------]
00138 } // PLRenderer
00139 
00140 
00141 #endif // __PLRENDERER_PROGRAMATTRIBUTE_H__


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:08:58
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported