2009-07-29 00:32:10 +03:00
|
|
|
// Copyright (C) 2003 Dolphin Project.
|
2008-12-08 06:46:09 +02:00
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
2009-04-03 17:35:49 +03:00
|
|
|
#ifndef _VERTEXMANAGER_H_
|
|
|
|
#define _VERTEXMANAGER_H_
|
2008-12-08 06:46:09 +02:00
|
|
|
|
|
|
|
#include "CPMemory.h"
|
2010-10-03 03:41:06 +03:00
|
|
|
|
|
|
|
#include "VertexManagerBase.h"
|
|
|
|
|
|
|
|
namespace OGL
|
|
|
|
{
|
2012-10-26 17:34:02 +03:00
|
|
|
class GLVertexFormat : public NativeVertexFormat
|
|
|
|
{
|
|
|
|
PortableVertexDeclaration vtx_decl;
|
|
|
|
|
|
|
|
public:
|
|
|
|
GLVertexFormat();
|
|
|
|
~GLVertexFormat();
|
|
|
|
|
|
|
|
virtual void Initialize(const PortableVertexDeclaration &_vtx_decl);
|
|
|
|
virtual void SetupVertexPointers();
|
2012-12-15 15:43:01 +02:00
|
|
|
|
2012-12-15 18:28:58 +02:00
|
|
|
GLuint VAO;
|
2012-10-26 17:34:02 +03:00
|
|
|
};
|
2008-12-08 06:46:09 +02:00
|
|
|
|
|
|
|
// Handles the OpenGL details of drawing lots of vertices quickly.
|
|
|
|
// Other functionality is moving out.
|
2010-10-03 03:41:06 +03:00
|
|
|
class VertexManager : public ::VertexManager
|
2008-12-08 06:46:09 +02:00
|
|
|
{
|
2010-10-03 03:41:06 +03:00
|
|
|
public:
|
|
|
|
VertexManager();
|
2012-10-26 17:34:02 +03:00
|
|
|
~VertexManager();
|
2010-11-26 11:25:08 +02:00
|
|
|
NativeVertexFormat* CreateNativeVertexFormat();
|
2012-10-20 16:22:15 +03:00
|
|
|
void CreateDeviceObjects();
|
|
|
|
void DestroyDeviceObjects();
|
2012-12-15 15:43:01 +02:00
|
|
|
|
|
|
|
// NativeVertexFormat use this
|
2012-12-15 18:28:58 +02:00
|
|
|
GLuint m_vertex_buffers;
|
|
|
|
GLuint m_index_buffers;
|
2012-12-15 15:43:01 +02:00
|
|
|
GLuint m_last_vao;
|
2010-10-03 03:41:06 +03:00
|
|
|
private:
|
2012-12-15 15:43:01 +02:00
|
|
|
void Draw(u32 stride);
|
2010-10-03 03:41:06 +03:00
|
|
|
void vFlush();
|
2012-10-26 17:34:02 +03:00
|
|
|
void PrepareDrawBuffers(u32 stride);
|
2012-10-27 05:18:09 +03:00
|
|
|
NativeVertexFormat *m_CurrentVertexFmt;
|
2008-12-08 06:46:09 +02:00
|
|
|
};
|
|
|
|
|
2010-10-03 03:41:06 +03:00
|
|
|
}
|
|
|
|
|
2009-04-03 17:35:49 +03:00
|
|
|
#endif // _VERTEXMANAGER_H_
|