dolphin/Source/Core/VideoBackends/OGL/VertexManager.h

51 lines
1.1 KiB
C
Raw Normal View History

// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#pragma once
#include "VideoCommon/CPMemory.h"
#include "VideoCommon/VertexManagerBase.h"
namespace OGL
{
class GLVertexFormat : public NativeVertexFormat
{
PortableVertexDeclaration vtx_decl;
public:
GLVertexFormat();
~GLVertexFormat();
virtual void Initialize(const PortableVertexDeclaration &_vtx_decl) override;
virtual void SetupVertexPointers() override;
GLuint VAO;
};
// Handles the OpenGL details of drawing lots of vertices quickly.
// Other functionality is moving out.
class VertexManager : public ::VertexManager
{
public:
VertexManager();
~VertexManager();
NativeVertexFormat* CreateNativeVertexFormat() override;
void CreateDeviceObjects() override;
void DestroyDeviceObjects() override;
// NativeVertexFormat use this
GLuint m_vertex_buffers;
GLuint m_index_buffers;
GLuint m_last_vao;
2014-01-23 12:41:53 +00:00
protected:
2014-03-08 00:54:44 +00:00
virtual void ResetBuffer(u32 stride) override;
private:
void Draw(u32 stride);
void vFlush(bool useDstAlpha) override;
void PrepareDrawBuffers(u32 stride);
NativeVertexFormat *m_CurrentVertexFmt;
};
}