Show vertexbuffermanager.h syntax highlighted
/***************************************************************************
vertexbuffermanager.h - Base vertex buffer allocation manager
-------------------
begin : Sat May 10 2003
copyright : (C) 2003 by Reality Rift Studios
email : mattias@realityrift.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, vertexbuffermanager.h
The Initial Developer of the Original Code is Mattias Jansson.
Portions created by Mattias Jansson are Copyright (C) 2003
Reality Rift Studios. All Rights Reserved.
***************************************************************************/
#ifndef __NEOGLVERTEXBUFFERMANAGER_H
#define __NEOGLVERTEXBUFFERMANAGER_H
/**
* \file vertexbuffermanager.h
* Base vertex buffer allocation manager
*/
#include "device.h"
#include "vertexbuffer.h"
#include <neoengine/vertexbuffer.h>
namespace NeoOGL
{
/**
* Manages vertex buffer allocations from backing store
* \author Mattias Jansson (mattias@realityrift.com)
*/
class VertexBufferManager
{
protected:
/*! Device object */
Device *m_pkDevice;
/*! Normal array enable flag */
bool m_bNormalArrayEnabled;
/*! Diffuse array enable flag */
bool m_bDiffuseArrayEnabled;
/*! Texcoord array enable flag */
bool m_bTexCoordArrayEnabled[8];
/*! Tangent attrib array enable flag */
bool m_bTangentArrayEnabled;
/*! Binormal attrib array enable flag */
bool m_bBinormalArrayEnabled;
/*! Fog coordinate attrib array enable flag */
bool m_bFogCoordArrayEnabled;
public:
/**
* \param pkDevice Device object
*/
VertexBufferManager( Device *pkDevice );
/**
* Free memory
*/
virtual ~VertexBufferManager();
/**
* Set size of backing store
* \param uiSize New size
* \return true if size allocated, false if error
*/
virtual bool SetSize( unsigned int uiSize ) { return true; }
/**
* Create a new vertex buffer object
* \param uiType Buffer type
* \param uiNumVertices Number of vertices
* \param pkFormat Flexible vertex format declaration
* \param pData Optional pointer to data to load buffer with
* \return Ptr to new vertex buffer
*/
virtual NeoEngine::VertexBufferPtr CreateVertexBuffer( unsigned int uiType, unsigned int uiNumVertices, const NeoEngine::VertexDeclaration *pkFormat, const void *pData ) = 0;
/**
* Set fence on buffer
* \param pkVertexBuffer Vertex buffer to fence
*/
virtual void SetFence( VertexBufferGL *pkVertexBuffer ) {}
/**
* Set base pointers for rendering
* \param pkVertexBuffer Vertex buffer object
* \param uiUVLayer UV layer
*/
virtual void SetBasePointers( VertexBufferGL *pkVertexBuffer, unsigned int uiUVLayer );
/**
* Set pointer for texture layer for rendering
* \param pkVertexBuffer Vertex buffer object
* \param uiTexUnit Active texture unit
* \param uiUVLayer UV layer
* \param bDisable Force disable
*/
virtual void SetTexLayerPointer( VertexBufferGL *pkVertexBuffer, unsigned int uiTexUnit, unsigned int uiUVLayer, bool bDisable = false );
};
};
#endif
See more files for this project here