summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2008-12-25 15:56:36 +0000
committerhrydgard <hrydgard@gmail.com>2008-12-25 15:56:36 +0000
commitdcc48d6c417192dec95aa0d0562d6cc2f3cfa18a (patch)
treef64ccb07691d1df7c508403421655d882086b49d /Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
parent3fd665502e7956ebd97391c0f4cc907d70358968 (diff)
just a bunch of random code cleanup i did on the train bored, plus a d3d implementation of NativeVertexFormat which isn't actually used yet.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1658 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp b/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
index 3243092dab..dc87424c1e 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
@@ -48,7 +48,25 @@ DECLARE_IMPORT(glColorPointer);
DECLARE_IMPORT(glTexCoordPointer);
#endif
-NativeVertexFormat::NativeVertexFormat()
+class GLVertexFormat : public NativeVertexFormat
+{
+ u8 *m_compiledCode;
+ PortableVertexDeclaration vtx_decl;
+
+public:
+ GLVertexFormat();
+ ~GLVertexFormat();
+ virtual void Initialize(const PortableVertexDeclaration &_vtx_decl);
+ virtual void SetupVertexPointers() const;
+};
+
+
+NativeVertexFormat *NativeVertexFormat::Create()
+{
+ return new GLVertexFormat();
+}
+
+GLVertexFormat::GLVertexFormat()
{
#ifdef USE_JIT
m_compiledCode = (u8 *)AllocateExecutableMemory(COMPILED_CODE_SIZE, false);
@@ -58,7 +76,7 @@ NativeVertexFormat::NativeVertexFormat()
#endif
}
-NativeVertexFormat::~NativeVertexFormat()
+GLVertexFormat::~GLVertexFormat()
{
#ifdef USE_JIT
FreeMemoryPages(m_compiledCode, COMPILED_CODE_SIZE);
@@ -72,7 +90,7 @@ inline GLuint VarToGL(VarType t)
return lookup[t];
}
-void NativeVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
+void GLVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
{
using namespace Gen;
@@ -148,7 +166,7 @@ void NativeVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
this->vtx_decl = _vtx_decl;
}
-void NativeVertexFormat::SetupVertexPointers() const {
+void GLVertexFormat::SetupVertexPointers() const {
// Cast a pointer to compiled code to a pointer to a function taking no parameters, through a (void *) cast first to
// get around type checking errors, and call it.
#ifdef USE_JIT