2013-04-18 03:29:41 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2009-04-03 14:35:49 +00:00
|
|
|
#ifndef _VERTEXMANAGER_H_
|
|
|
|
#define _VERTEXMANAGER_H_
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
#include "CPMemory.h"
|
2010-10-03 00:41:06 +00:00
|
|
|
|
|
|
|
#include "VertexManagerBase.h"
|
|
|
|
|
|
|
|
namespace OGL
|
|
|
|
{
|
2012-10-26 14:34:02 +00:00
|
|
|
class GLVertexFormat : public NativeVertexFormat
|
|
|
|
{
|
|
|
|
PortableVertexDeclaration vtx_decl;
|
|
|
|
|
|
|
|
public:
|
|
|
|
GLVertexFormat();
|
|
|
|
~GLVertexFormat();
|
|
|
|
|
|
|
|
virtual void Initialize(const PortableVertexDeclaration &_vtx_decl);
|
|
|
|
virtual void SetupVertexPointers();
|
2012-12-15 13:43:01 +00:00
|
|
|
|
2012-12-15 16:28:58 +00:00
|
|
|
GLuint VAO;
|
2012-10-26 14:34:02 +00:00
|
|
|
};
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
// Handles the OpenGL details of drawing lots of vertices quickly.
|
|
|
|
// Other functionality is moving out.
|
2010-10-03 00:41:06 +00:00
|
|
|
class VertexManager : public ::VertexManager
|
2008-12-08 04:46:09 +00:00
|
|
|
{
|
2010-10-03 00:41:06 +00:00
|
|
|
public:
|
|
|
|
VertexManager();
|
2012-10-26 14:34:02 +00:00
|
|
|
~VertexManager();
|
2010-11-26 09:25:08 +00:00
|
|
|
NativeVertexFormat* CreateNativeVertexFormat();
|
2012-10-20 13:22:15 +00:00
|
|
|
void CreateDeviceObjects();
|
|
|
|
void DestroyDeviceObjects();
|
2012-12-15 13:43:01 +00:00
|
|
|
|
|
|
|
// NativeVertexFormat use this
|
2012-12-15 16:28:58 +00:00
|
|
|
GLuint m_vertex_buffers;
|
|
|
|
GLuint m_index_buffers;
|
2012-12-15 13:43:01 +00:00
|
|
|
GLuint m_last_vao;
|
2010-10-03 00:41:06 +00:00
|
|
|
private:
|
2012-12-15 13:43:01 +00:00
|
|
|
void Draw(u32 stride);
|
2010-10-03 00:41:06 +00:00
|
|
|
void vFlush();
|
2012-10-26 14:34:02 +00:00
|
|
|
void PrepareDrawBuffers(u32 stride);
|
2012-10-27 02:18:09 +00:00
|
|
|
NativeVertexFormat *m_CurrentVertexFmt;
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|
|
|
|
|
2010-10-03 00:41:06 +00:00
|
|
|
}
|
|
|
|
|
2009-04-03 14:35:49 +00:00
|
|
|
#endif // _VERTEXMANAGER_H_
|