mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-11 08:39:13 +01:00
937844b9e3
Initial port of original zfreeze branch (3.5-1729) by neobrain into most recent build of Dolphin. Makes Rogue Squadron 2 very playable at full speed thanks to recent core speedups made to Dolphin. Works on DirectX Video plugin only for now. Enjoy! and Merry Xmas!!
57 lines
1.4 KiB
C++
57 lines
1.4 KiB
C++
// Copyright 2013 Dolphin Emulator Project
|
|
// Licensed under GPLv2
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include "VideoBackends/OGL/GLExtensions/GLExtensions.h"
|
|
#include "VideoCommon/CPMemory.h"
|
|
#include "VideoCommon/NativeVertexFormat.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;
|
|
protected:
|
|
virtual void ResetBuffer(u32 stride) override;
|
|
u16* GetIndexBuffer() { return &LocalIBuffer[0]; }
|
|
u8* GetVertexBuffer() { return &LocalVBuffer[0]; }
|
|
private:
|
|
void Draw(u32 stride);
|
|
void vFlush(bool useDstAlpha) override;
|
|
void PrepareDrawBuffers(u32 stride);
|
|
|
|
std::vector<u8> LocalVBuffer;
|
|
std::vector<u16> LocalIBuffer;
|
|
};
|
|
|
|
}
|