[AE Engine logo] Public API Reference
Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

vertexbuffer.h

00001 /*
00002  *  AE Engine
00003  *
00004  *  Copyright (C) 2003 Riku "Rakkis" Nurminen
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 #ifndef __AEPLUGIN_AERENDERER_VERTEXBUFFER_H__
00023 #define __AEPLUGIN_AERENDERER_VERTEXBUFFER_H__
00024 
00025 #include <aedefs.h>
00026 #include <aegeom/vector3.h>
00027 #include <aegfx/color4.h>
00028 #include <aegfx/texcoord2.h>
00029 
00034 class aeVertexBuffer {
00035  private:
00037         unsigned int vertexBufSize;
00039         float *vertexBuffer;
00041         float *normalBuffer;
00043         float *colorBuffer;
00045         float *texcoordBuffer;
00047         bool normalBufEnabled;
00049         bool colorBufEnabled;
00051         bool texcoordBufEnabled;
00053         unsigned int vertexCount;
00055         unsigned int normalCount;
00057         unsigned int colorCount;
00059         unsigned int texcoordCount;
00060 
00061  public:
00074         aeVertexBuffer(unsigned int vertexBufferSize, bool normals = false, bool colors = false,
00075                                    bool texcoords = false);
00076         ~aeVertexBuffer();
00077 
00083         inline unsigned int getVertexBufferSize() const { return vertexBufSize; }
00084 
00090         inline float *getVertexData() const { return vertexBuffer; }
00091 
00098         inline float *getNormalData() const { return normalBuffer; }
00099 
00105         inline float *getColorData() const { return colorBuffer; }
00106 
00113         inline float *getTexCoordData() const { return texcoordBuffer; }
00114 
00120         inline bool hasNormals() const { return (normalBufEnabled ? true : false); }
00121 
00127         inline bool hasColors() const { return (colorBufEnabled ? true : false); }
00128 
00134         inline bool hasTexCoords() const { return (texcoordBufEnabled ? true : false); }
00135 
00141         inline getVertexCount() const { return vertexCount; }
00142 
00148         inline getNormalCount() const { return normalCount; }
00149 
00155         inline getColorCount() const { return colorCount; }
00156 
00162         inline getTexCoordCount() const { return texcoordCount; }
00163 
00169         void addVertex(aeVector3 &v);
00170 
00178         void addVertex(float x, float y, float z);
00179 
00185         void addNormal(aeVector3 &n);
00186 
00194         void addNormal(float x, float y, float z);
00195 
00201         void addColor(aeColor4 &c);
00202 
00211         void addColor(float r, float g, float b, float a);
00212 
00218         void addTexCoord(aeTexCoord2 &tc);
00219 
00226         void addTexCoord(float s, float t);
00227 };
00228 
00229 #endif // __AEPLUGIN_AERENDERER_VERTEXBUFFER_H__

AE Engine Public API Reference
Generated on Wed Apr 9 09:43:40 2003 by Doxygen.